diff --git a/workflows/MUSE_v3/__init__.py b/workflows/MUSE_v3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/workflows/MUSE_v3/db/package_data.json b/workflows/MUSE_v3/db/package_data.json new file mode 100644 index 0000000000000000000000000000000000000000..867971efe52e62f3f712a7ec88aedcf3de4f3e8d --- /dev/null +++ b/workflows/MUSE_v3/db/package_data.json @@ -0,0 +1,261 @@ +[ + { + "pk": 20, + "model": "workflows.category", + "fields": { + "uid": "853d1bb3-3710-4fae-a95a-2955abd7b7fe", + "parent": null, + "workflow": null, + "user": null, + "order": 1, + "name": "MUSE_v3" + } + }, + { + "pk": 98, + "model": "workflows.abstractwidget", + "fields": { + "category": 20, + "treeview_image": "", + "name": "Create Integer List", + "is_streaming": false, + "uid": "5ff6a81e-c5c8-4f95-b7d3-c55c69af1997", + "interaction_view": "", + "image": "", + "package": "MUSE_v3", + "static_image": "construction_work .png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "action": "MUSE_v3_create_integers", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "" + } + }, + { + "pk": 248, + "model": "workflows.abstractinput", + "fields": { + "widget": 98, + "name": "Integer List String", + "short_name": "str", + "uid": "043d99f3-117f-4678-aeff-f7536823510c", + "default": "3\r\n2\r\n1\r\n4", + "required": false, + "multi": false, + "parameter_type": "textarea", + "variable": "intStr", + "parameter": true, + "order": 1, + "description": "Comma or new-line separated list of integers" + } + }, + { + "pk": 253, + "model": "workflows.abstractinput", + "fields": { + "widget": 98, + "name": "Sort list", + "short_name": "bol", + "uid": "46440b57-a531-42c2-813d-7faacf61c53d", + "default": "true", + "required": true, + "multi": false, + "parameter_type": "checkbox", + "variable": "sort", + "parameter": true, + "order": 2, + "description": "Should the list be sorted" + } + }, + { + "pk": 104, + "model": "workflows.abstractoutput", + "fields": { + "widget": 98, + "name": "Integer List", + "short_name": "lst", + "variable": "intList", + "uid": "5256b420-0263-4c53-a9ef-2fbbb504870f", + "order": 1, + "description": "List of integers" + } + }, + { + "pk": 101, + "model": "workflows.abstractwidget", + "fields": { + "category": 20, + "treeview_image": "", + "name": "Filter Integers", + "is_streaming": false, + "uid": "573e5851-454f-4f86-ae38-b1066d0427f6", + "interaction_view": "MUSE_v3_filter_integers", + "image": "", + "package": "MUSE_v3", + "static_image": "construction_work .png", + "post_interact_action": "MUSE_v3_post_filter_integers", + "user": null, + "visualization_view": "", + "action": "MUSE_v3_pre_filter_integers", + "wsdl_method": "", + "wsdl": "", + "interactive": true, + "has_progress_bar": false, + "order": 2, + "description": "" + } + }, + { + "pk": 250, + "model": "workflows.abstractinput", + "fields": { + "widget": 101, + "name": "Integer List", + "short_name": "lst", + "uid": "12c980ea-31bf-472b-b977-154ecb27b460", + "default": "", + "required": true, + "multi": false, + "parameter_type": null, + "variable": "intList", + "parameter": false, + "order": 1, + "description": "List of integers" + } + }, + { + "pk": 106, + "model": "workflows.abstractoutput", + "fields": { + "widget": 101, + "name": "Filtered Integer List", + "short_name": "lst", + "variable": "intList", + "uid": "ff1b21a8-6c28-4e84-adbd-b15b03255dc3", + "order": 1, + "description": "Filtered list of integers" + } + }, + { + "pk": 99, + "model": "workflows.abstractwidget", + "fields": { + "category": 20, + "treeview_image": "", + "name": "Sum Integers", + "is_streaming": false, + "uid": "4669c737-83d0-4c9f-8470-6c13606f62fb", + "interaction_view": "", + "image": "", + "package": "MUSE_v3", + "static_image": "construction_work .png", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "action": "MUSE_v3_sum_integers", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 3, + "description": "" + } + }, + { + "pk": 249, + "model": "workflows.abstractinput", + "fields": { + "widget": 99, + "name": "Integer List", + "short_name": "lst", + "uid": "2f960d52-6ca7-41bd-8136-a4068480c1d2", + "default": "", + "required": true, + "multi": false, + "parameter_type": null, + "variable": "intList", + "parameter": false, + "order": 1, + "description": "List of integers" + } + }, + { + "pk": 105, + "model": "workflows.abstractoutput", + "fields": { + "widget": 99, + "name": "Sum", + "short_name": "int", + "variable": "sum", + "uid": "3a482328-6fc4-4876-aa7f-e6770050d4a9", + "order": 1, + "description": "Sum of integer list" + } + }, + { + "pk": 100, + "model": "workflows.abstractwidget", + "fields": { + "category": 20, + "treeview_image": "", + "name": "Display Summation", + "is_streaming": false, + "uid": "53faa492-56ad-4102-9aee-5aec008aba16", + "interaction_view": "", + "image": "", + "package": "MUSE_v3", + "static_image": "construction_work .png", + "post_interact_action": "", + "user": null, + "visualization_view": "MUSE_v3_display_summation", + "action": "MUSE_v3_pre_display_summation", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 4, + "description": "" + } + }, + { + "pk": 251, + "model": "workflows.abstractinput", + "fields": { + "widget": 100, + "name": "Integer List", + "short_name": "lst", + "uid": "59bed2f6-cef1-4e9f-b0e8-30c134fbf21f", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "intList", + "parameter": false, + "order": 1, + "description": "List of integers" + } + }, + { + "pk": 252, + "model": "workflows.abstractinput", + "fields": { + "widget": 100, + "name": "Sum", + "short_name": "int", + "uid": "397eeb5b-1fe7-485f-8898-f043115e11b9", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "sum", + "parameter": false, + "order": 2, + "description": "Sum (possibly correct) of integer list" + } + } +] \ No newline at end of file diff --git a/workflows/MUSE_v3/interaction_views.py b/workflows/MUSE_v3/interaction_views.py new file mode 100644 index 0000000000000000000000000000000000000000..367988c35f549c2031f427ea942b143113a58e4c --- /dev/null +++ b/workflows/MUSE_v3/interaction_views.py @@ -0,0 +1,4 @@ +from django.shortcuts import render + +def MUSE_v3_filter_integers(request,input_dict,output_dict,widget): + return render(request, 'interactions/MUSE_v3_filter_integers.html',{'widget':widget,'intList':input_dict['intList']}) \ No newline at end of file diff --git a/workflows/MUSE_v3/library.py b/workflows/MUSE_v3/library.py new file mode 100644 index 0000000000000000000000000000000000000000..902c9e49db0ab8d2e7f80b7158f0634991dbe546 --- /dev/null +++ b/workflows/MUSE_v3/library.py @@ -0,0 +1,33 @@ +import re + +def MUSE_v3_create_integers(input_dict): + intStr = input_dict['intStr'] + intList = [] + for i in re.findall(r'\w+', intStr): + try: + intList.append(int(i)) + except: + pass + if input_dict['sort'].lower() == "true": + intList.sort() + return {'intList':intList} + +def MUSE_v3_sum_integers(input_dict): + intList = input_dict['intList'] + return {'sum':sum(intList)} + +def MUSE_v3_pre_filter_integers(input_dict): + return input_dict + +def MUSE_v3_post_filter_integers(postdata,input_dict,output_dict): + intListOut = postdata['intListOut'] + intList = [] + for i in intListOut: + try: + intList.append(int(i)) + except: + pass + return {'intList': intList} + +def MUSE_v3_pre_display_summation(input_dict): + return {} \ No newline at end of file diff --git a/workflows/MUSE_v3/package_data/categories/853d1bb3-3710-4fae-a95a-2955abd7b7fe.json b/workflows/MUSE_v3/package_data/categories/853d1bb3-3710-4fae-a95a-2955abd7b7fe.json new file mode 100644 index 0000000000000000000000000000000000000000..5829082bff34c0b376dab3e26e162d5e1ad79656 --- /dev/null +++ b/workflows/MUSE_v3/package_data/categories/853d1bb3-3710-4fae-a95a-2955abd7b7fe.json @@ -0,0 +1,9 @@ +{ + "model": "workflows.category", + "fields": { + "name": "MUSE_v3", + "parent": null, + "order": 1, + "uid": "853d1bb3-3710-4fae-a95a-2955abd7b7fe" + } +} \ No newline at end of file diff --git a/workflows/MUSE_v3/settings.py b/workflows/MUSE_v3/settings.py new file mode 100644 index 0000000000000000000000000000000000000000..5b3f27db6fc91a7f0a0c9e5578bfdc2aa65a21af --- /dev/null +++ b/workflows/MUSE_v3/settings.py @@ -0,0 +1,13 @@ +import os + +# === STANDARD PACKAGE SETTINGS === +PACKAGE_ROOT = os.path.dirname(__file__) + +# === AUTO IMPORT OPTIONS === +#If auto_import_package_data is true then given data file is automatically imported when ClowdFlows project is newly deployed or refreshed from git +AUTO_IMPORT_DB = False +#For auto_import_package_data_replace_option description see the 'replace' option in workflows/import_package command +AUTO_IMPORT_DB_REPLACE_OPTION = True +#If file(s) other than ./db/package_data.json should be imported, auto_import_package_data_files should be corrected +AUTO_IMPORT_DB_FILES = [os.path.join(PACKAGE_ROOT,'db/package_data.json')] + diff --git a/workflows/MUSE_v3/static/MUSE_v3/icons/treeview/construction_work .png b/workflows/MUSE_v3/static/MUSE_v3/icons/treeview/construction_work .png new file mode 100644 index 0000000000000000000000000000000000000000..69bd351914a95f81eb1941f6e7908474916f6116 Binary files /dev/null and b/workflows/MUSE_v3/static/MUSE_v3/icons/treeview/construction_work .png differ diff --git a/workflows/MUSE_v3/static/MUSE_v3/icons/widget/construction_work .png b/workflows/MUSE_v3/static/MUSE_v3/icons/widget/construction_work .png new file mode 100644 index 0000000000000000000000000000000000000000..bc16d376995c1545972b60487ee8cd653177b407 Binary files /dev/null and b/workflows/MUSE_v3/static/MUSE_v3/icons/widget/construction_work .png differ diff --git a/workflows/MUSE_v3/templates/interactions/MUSE_v3_filter_integers.html b/workflows/MUSE_v3/templates/interactions/MUSE_v3_filter_integers.html new file mode 100644 index 0000000000000000000000000000000000000000..af34d24d1dd6449b32e3698bc5f69e4ffd8a74a5 --- /dev/null +++ b/workflows/MUSE_v3/templates/interactions/MUSE_v3_filter_integers.html @@ -0,0 +1,8 @@ +
+
+{% for i in intList %} +{{i}}
+{% endfor %} + +
+
\ No newline at end of file diff --git a/workflows/MUSE_v3/templates/visualizations/MUSE_v3_display_integers.html b/workflows/MUSE_v3/templates/visualizations/MUSE_v3_display_integers.html new file mode 100644 index 0000000000000000000000000000000000000000..8e7696871187fab8e44a115435fd791b2c226840 --- /dev/null +++ b/workflows/MUSE_v3/templates/visualizations/MUSE_v3_display_integers.html @@ -0,0 +1,28 @@ +
+
+ + + {% for i in input_dict.intList %} + + + + + {% endfor %} + + + + +
+ {% if forloop.first %} {% else %}+{% endif %} + + {{ i }} +
+ = + + {{ input_dict.sum }} +
+
+{{ check }} + +
+
\ No newline at end of file diff --git a/workflows/MUSE_v3/urls.py b/workflows/MUSE_v3/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..7c56d8e8861188bdd8b72151f491c761a654e179 --- /dev/null +++ b/workflows/MUSE_v3/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls.defaults import patterns, include, url + +urlpatterns = patterns('', + #url(r'^get-adc-index/widget(?P[0-9]+)/nx/Index.html$', 'workflows.latino.views.get_adc_index', name='get adc index'), + #url(r'^get-adc-index/widget(?P[0-9]+)/(?Pn?)x/Index.html$', 'workflows.latino.views.get_adc_index', name='get adc index'), + #url(r'^get-adc-index/widget(?P[0-9]+)/(?Pn?)x/Index(?P[0-9]+)-(?P[0-9]+).html$', 'workflows.latino.views.get_adc_index', name='get adc index'), + #url(r'^get-adc-index/widget(?P[0-9]+)/(?Pn?)x/Document(?P[0-9]+).html', 'workflows.latino.views.get_adc_page', name='get adc page'), +) \ No newline at end of file diff --git a/workflows/MUSE_v3/views.py b/workflows/MUSE_v3/views.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/workflows/MUSE_v3/visualization_views.py b/workflows/MUSE_v3/visualization_views.py new file mode 100644 index 0000000000000000000000000000000000000000..92483a86361c08781b262f403aff2275d0123391 --- /dev/null +++ b/workflows/MUSE_v3/visualization_views.py @@ -0,0 +1,8 @@ +from django.shortcuts import render + +def MUSE_v3_display_summation(request,input_dict,output_dict,widget): + if sum(input_dict['intList']) == input_dict['sum']: + check = 'The calculation appears correct.' + else: + check = 'The calculation appears incorrect!' + return render(request, 'visualizations/MUSE_v3_display_integers.html',{'widget':widget,'input_dict':input_dict, 'output_dict':output_dict, 'check':check})