commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/e7271620d7d7/ Changeset: e7271620d7d7 User: jmchilton Date: 2014-06-09 20:36:17 Summary: Hide concept of job resources in workflows interface, scrupt tool state when extracting workflows. Workflows describe abstract computational flow - not how to run the job - so I think it makes sense to not include the state of resource parameters in the workflow. Ideally, the option to override the defaults would always be available at runtime - this is not there currently but I think it is better to have a lower utility core functionality that is correct and can be supported than having something currently maximally functional but may be difficult/impossible to support in the future. Also now auto-fill of job resource defaults produces no warnings (improves UX when rerunning job with previously didn't have resource parameters or if job resource types change over time). Affected #: 5 files diff -r 5884328e91724e9bdf4b43f012eb63fa0c803ef6 -r e7271620d7d7ee8b322d21d7eab9c85bff032133 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2589,10 +2589,13 @@ # No value, insert the default if input.name not in values: if isinstance( input, Conditional ): - messages[ input.name ] = { input.test_param.name: "No value found for '%s%s', used default" % ( prefix, input.label ) } + cond_messages = {} + if not input.is_job_resource_conditional: + cond_messages = { input.test_param.name: "No value found for '%s%s', used default" % ( prefix, input.label ) } + messages[ input.name ] = cond_messages test_value = input.test_param.get_initial_value( trans, context ) current_case = input.get_current_case( test_value, trans ) - self.check_and_update_param_values_helper( input.cases[ current_case ].inputs, {}, trans, messages[ input.name ], context, prefix, allow_workflow_parameters=allow_workflow_parameters ) + self.check_and_update_param_values_helper( input.cases[ current_case ].inputs, {}, trans, cond_messages, context, prefix, allow_workflow_parameters=allow_workflow_parameters ) elif isinstance( input, Repeat ): if input.min: messages[ input.name ] = [] diff -r 5884328e91724e9bdf4b43f012eb63fa0c803ef6 -r e7271620d7d7ee8b322d21d7eab9c85bff032133 lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -540,6 +540,10 @@ cond_dict[ "test_param" ] = nested_to_dict( self.test_param ) return cond_dict + @property + def is_job_resource_conditional(self): + return self.name == "__job_resource" + class ConditionalWhen( object, Dictifiable ): dict_collection_visible_keys = ( 'value', ) diff -r 5884328e91724e9bdf4b43f012eb63fa0c803ef6 -r e7271620d7d7ee8b322d21d7eab9c85bff032133 lib/galaxy/workflow/extract.py --- a/lib/galaxy/workflow/extract.py +++ b/lib/galaxy/workflow/extract.py @@ -317,6 +317,13 @@ rep_index = rep_values['__index__'] cleanup( "%s%s_%d|" % (prefix, key, rep_index ), input.inputs, group_values[i] ) elif isinstance( input, Conditional ): + # Scrub dynamic resource related parameters from workflows, + # they cause problems and the workflow probably should include + # their state in workflow encoding. + if input.is_job_resource_conditional: + if input.name in values: + del values[input.name] + return group_values = values[input.name] current_case = group_values['__current_case__'] cleanup( "%s%s|" % ( prefix, key ), input.cases[current_case].inputs, group_values ) diff -r 5884328e91724e9bdf4b43f012eb63fa0c803ef6 -r e7271620d7d7ee8b322d21d7eab9c85bff032133 templates/webapps/galaxy/workflow/editor_tool_form.mako --- a/templates/webapps/galaxy/workflow/editor_tool_form.mako +++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako @@ -28,6 +28,9 @@ <div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div></div> %elif input.type == "conditional": + %if input.is_job_resource_conditional: + <% continue %> + %endif <% group_values = values[input.name] %><% current_case = group_values['__current_case__'] %><% group_prefix = prefix + input.name + "|" %> diff -r 5884328e91724e9bdf4b43f012eb63fa0c803ef6 -r e7271620d7d7ee8b322d21d7eab9c85bff032133 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -339,6 +339,9 @@ ## <div class="form-row"><input type="submit" name="${step.id}|${prefix}${input.name}_add" value="Add new ${input.title}" /></div></div> %elif input.type == "conditional": + %if input.is_job_resource_conditional: + <% continue %> + %endif <% group_values = values[input.name] %><% current_case = group_values['__current_case__'] %><% new_prefix = prefix + input.name + "|" %> https://bitbucket.org/galaxy/galaxy-central/commits/db92f6e19b38/ Changeset: db92f6e19b38 User: jmchilton Date: 2014-06-10 03:15:37 Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #407) Hide concept of job resources in workflows interface, scrub tool state when extracting workflows. Affected #: 5 files diff -r 702004fc9ca216594ba7c88deb1153cafd37a573 -r db92f6e19b3818097bd3d5a149acf80ced90675c lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2589,10 +2589,13 @@ # No value, insert the default if input.name not in values: if isinstance( input, Conditional ): - messages[ input.name ] = { input.test_param.name: "No value found for '%s%s', used default" % ( prefix, input.label ) } + cond_messages = {} + if not input.is_job_resource_conditional: + cond_messages = { input.test_param.name: "No value found for '%s%s', used default" % ( prefix, input.label ) } + messages[ input.name ] = cond_messages test_value = input.test_param.get_initial_value( trans, context ) current_case = input.get_current_case( test_value, trans ) - self.check_and_update_param_values_helper( input.cases[ current_case ].inputs, {}, trans, messages[ input.name ], context, prefix, allow_workflow_parameters=allow_workflow_parameters ) + self.check_and_update_param_values_helper( input.cases[ current_case ].inputs, {}, trans, cond_messages, context, prefix, allow_workflow_parameters=allow_workflow_parameters ) elif isinstance( input, Repeat ): if input.min: messages[ input.name ] = [] diff -r 702004fc9ca216594ba7c88deb1153cafd37a573 -r db92f6e19b3818097bd3d5a149acf80ced90675c lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -540,6 +540,10 @@ cond_dict[ "test_param" ] = nested_to_dict( self.test_param ) return cond_dict + @property + def is_job_resource_conditional(self): + return self.name == "__job_resource" + class ConditionalWhen( object, Dictifiable ): dict_collection_visible_keys = ( 'value', ) diff -r 702004fc9ca216594ba7c88deb1153cafd37a573 -r db92f6e19b3818097bd3d5a149acf80ced90675c lib/galaxy/workflow/extract.py --- a/lib/galaxy/workflow/extract.py +++ b/lib/galaxy/workflow/extract.py @@ -317,6 +317,13 @@ rep_index = rep_values['__index__'] cleanup( "%s%s_%d|" % (prefix, key, rep_index ), input.inputs, group_values[i] ) elif isinstance( input, Conditional ): + # Scrub dynamic resource related parameters from workflows, + # they cause problems and the workflow probably should include + # their state in workflow encoding. + if input.is_job_resource_conditional: + if input.name in values: + del values[input.name] + return group_values = values[input.name] current_case = group_values['__current_case__'] cleanup( "%s%s|" % ( prefix, key ), input.cases[current_case].inputs, group_values ) diff -r 702004fc9ca216594ba7c88deb1153cafd37a573 -r db92f6e19b3818097bd3d5a149acf80ced90675c templates/webapps/galaxy/workflow/editor_tool_form.mako --- a/templates/webapps/galaxy/workflow/editor_tool_form.mako +++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako @@ -28,6 +28,9 @@ <div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div></div> %elif input.type == "conditional": + %if input.is_job_resource_conditional: + <% continue %> + %endif <% group_values = values[input.name] %><% current_case = group_values['__current_case__'] %><% group_prefix = prefix + input.name + "|" %> diff -r 702004fc9ca216594ba7c88deb1153cafd37a573 -r db92f6e19b3818097bd3d5a149acf80ced90675c templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -339,6 +339,9 @@ ## <div class="form-row"><input type="submit" name="${step.id}|${prefix}${input.name}_add" value="Add new ${input.title}" /></div></div> %elif input.type == "conditional": + %if input.is_job_resource_conditional: + <% continue %> + %endif <% group_values = values[input.name] %><% current_case = group_values['__current_case__'] %><% new_prefix = prefix + input.name + "|" %> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org