Skip to content

Commit

Permalink
Merge pull request galaxyproject#5716 from bernt-matthias/topic/pcik_…
Browse files Browse the repository at this point in the history
…value_format

`pick_value`: implement `format_souce`
  • Loading branch information
mvdbeek authored Jan 15, 2024
2 parents 179e3fd + 64490a6 commit 2d21c3b
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions tools/pick_value/pick_value.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool name="Pick parameter value" id="pick_value" version="0.1.0" profile="21.01" tool_type="expression">
<tool name="Pick parameter value" id="pick_value" version="0.2.0" profile="21.01" tool_type="expression">
<macros>
<xml name="booleans">
<repeat name="pick_from" title="Pick from">
Expand Down Expand Up @@ -146,7 +146,11 @@ return { 'output': out };
<output type="boolean" name="boolean_param" from="output">
<filter>style_cond['type_cond']['param_type'] == 'boolean'</filter>
</output>
<output type="data" name="data_param" from="output">
<!-- Galaxy already copies the dataset with all its properties (including format)
in exec_after_process. setting the format_source here is in this sense
redundant, but helps the workflow editor to infer the data type
(from the dataset in the first repeat element) -->
<output type="data" name="data_param" from="output" format_source="style_cond|type_cond|pick_from_0|value">
<filter>style_cond['type_cond']['param_type'] == 'data'</filter>
</output>
</outputs>
Expand Down Expand Up @@ -185,14 +189,14 @@ taken.
<param name="value" value_json="null" />
</repeat>
<repeat name="pick_from">
<param name="value" value="simple_line.txt" />
<param name="value" value="simple_line.txt" ftype="tsv"/>
</repeat>
<repeat name="pick_from">
<param name="value" value="simple_line_alternative.txt" />
<param name="value" value="simple_line_alternative.txt" ftype="csv" />
</repeat>
</conditional>
</conditional>
<output name="data_param" value="simple_line.txt" />
<output name="data_param" value="simple_line.txt" ftype="tsv" />
</test>
<test expect_num_outputs="1">
<conditional name="style_cond">
Expand Down Expand Up @@ -363,11 +367,30 @@ taken.
<repeat name="pick_from">
<param name="value" value_json="null" />
</repeat>
<param name="default_value" value="simple_line.txt" />
<param name="default_value" value="simple_line.txt" ftype="tsv" />
</conditional>
</conditional>
<output name="data_param" value="simple_line.txt" />
<output name="data_param" value="simple_line.txt" ftype="tsv" />
</test>

<!-- with first_or_default that the default is used if given -->
<test expect_num_outputs="1">
<conditional name="style_cond">
<param name="pick_style" value="first_or_default" />
<conditional name="type_cond">
<param name="param_type" value="data" />
<repeat name="pick_from">
<param name="value" value_json="null" />
</repeat>
<repeat name="pick_from">
<param name="value" value="simple_line.txt" ftype="csv" />
</repeat>
<param name="default_value" value="simple_line_alternative.txt" ftype="tabular" />
</conditional>
</conditional>
<output name="data_param" value="simple_line.txt" ftype="csv"/>
</test>

</tests>
</tool>

0 comments on commit 2d21c3b

Please sign in to comment.