Skip to content

Use visit inputs for check_and_update_param_values#1764

Merged
jmchilton merged 4 commits intogalaxyproject:devfrom
guerler:fix_check_and_update_000
Mar 1, 2016
Merged

Use visit inputs for check_and_update_param_values#1764
jmchilton merged 4 commits intogalaxyproject:devfrom
guerler:fix_check_and_update_000

Conversation

@guerler
Copy link
Contributor

@guerler guerler commented Feb 19, 2016

Replaces remaining custom iterations (https://github.com/galaxyproject/galaxy/pull/1764/files#diff-1bef786a2b2ea704c1748e41cd25dd33L1283 and https://github.com/galaxyproject/galaxy/pull/1764/files#diff-ca2e00a05d3404fc5410df390ed69ac1L116) with the common visit inputs caller (guerler@e732f5c#diff-c2872901d34ca0c09ded74872356dd7bL13). Also removes the dependency on __current_case__ for conditionals. Thanks @jmchilton. Additional the PR moves the job resource handling to the job configuration module.

@guerler guerler force-pushed the fix_check_and_update_000 branch from 45930b7 to 4a956a9 Compare February 25, 2016 02:26
@guerler guerler force-pushed the fix_check_and_update_000 branch 10 times, most recently from f9186f6 to a4b8728 Compare February 27, 2016 07:41
@guerler guerler force-pushed the fix_check_and_update_000 branch from a4b8728 to 02187af Compare February 27, 2016 07:43
return
for validator in self.validators:
validator.validate( value, trans )
if value is not '' or not self.optional:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not value or not self.optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a revision of the above line, saying that values which are empty and optional are not validated, but optional values which are set to a non-empty value are validated. For more consistency it would be good to change this to if value is not None or not self.optional: in the future.

# their state in workflow encoding.
if input.is_job_resource_conditional:
if input.name == '__job_resource':
if input.name in values:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge this - but I don't understand your problem with giving names to repeated computations. You are duplicating the check and the resulting if check is both more obtuse and implementation dependent. As a result, this change makes things less readable and more easy to introduce bugs into.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I moved this customization out of the common conditional element code since it is only used for job resources and only consists of the above line. I think it is easier to read too (: but that is obviously subjective, so I am open for suggestions. Thanks a lot for your help. I really appreciate it.

jmchilton added a commit that referenced this pull request Mar 1, 2016
Use visit inputs for check_and_update_param_values
@jmchilton jmchilton merged commit eb2005e into galaxyproject:dev Mar 1, 2016
@guerler guerler mentioned this pull request Mar 4, 2016
@guerler guerler deleted the fix_check_and_update_000 branch February 19, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants