diff --git a/lib/galaxy/tool_util/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd index cd3fa9df84cb..b3d65a126f02 100644 --- a/lib/galaxy/tool_util/xsd/galaxy.xsd +++ b/lib/galaxy/tool_util/xsd/galaxy.xsd @@ -3801,7 +3801,7 @@ In output filters sections are represented as dictionary with the same name as t In order to reference parameters in sections from tags in the `` section, e.g. in the `format_source` attribute of `` tags, the syntax is currently: ``` - + ``` Note that references to other parameters in the `` section are only possible if the reference is in the same section or its parents (and is defined earlier), therefore only `parameter_name` is used. @@ -5949,7 +5949,7 @@ discovered data sets on Galaxy versions prior to 24.0 and should be specified us - This sets the data type of the output dataset(s) to be the same format as that of the specified tool input. + This sets the data type of the output dataset(s) to be the same format as that of the specified tool input. References to parameters in sections or conditionals must be qualified using ``|`` syntax. Elements of collection parameters can be referred to by pythons element access syntax. @@ -6063,8 +6063,10 @@ same as that of the input dataset selected (and named ``input1``) for the tool. The following will create datasets in the history panel, setting the output data type to be the same as that of an input dataset named by the ``format_source`` -attribute. Note that a conditional name is not included, so 2 separate -conditional blocks should not contain parameters with the same name. +attribute. If the parameter is contained in sections or conditionals they need +to be listed separated by ``|``. If the referred parameter is a collection, collection +elements can be referred python's element access syntax, e.g. ``input_collection["forward"]`` +would refer to the forward dataset of a paired collection. ```xml @@ -6085,7 +6087,7 @@ conditional blocks should not contain parameters with the same name. - qual['add'] == 'yes' diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index 841eea988d49..5727fc538b7b 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -1180,6 +1180,7 @@ def determine_output_format( pass ext = random_input_ext format_source = output.format_source + log.error(f"{format_source=} {input_datasets=} {format_source in input_datasets=}") if format_source is not None and format_source in input_datasets: try: input_dataset = input_datasets[output.format_source] diff --git a/lib/galaxy/tools/parameters/wrapped.py b/lib/galaxy/tools/parameters/wrapped.py index d23e9be5edf9..16ce1f32b284 100644 --- a/lib/galaxy/tools/parameters/wrapped.py +++ b/lib/galaxy/tools/parameters/wrapped.py @@ -1,3 +1,4 @@ +import logging from collections import UserDict from typing import ( Any, @@ -30,6 +31,7 @@ split_flattened_repeat_key, ) +log = logging.getLogger(__name__) PARAMS_UNWRAPPED = object() @@ -47,11 +49,13 @@ def set_legacy_alias(self, new_key: str, old_key: str): self._legacy_mapping[old_key] = new_key def __getitem__(self, key): + # log.error(f"__getitem__ {key=} {self.data=} {self._legacy_mapping=}") if key not in self.data and key in self._legacy_mapping: return super().__getitem__(self._legacy_mapping[key]) return super().__getitem__(key) def __contains__(self, key: object) -> bool: + log.error(f"__contains__ {key=} {self.data=} {self._legacy_mapping=}") if super().__contains__(key): return True return key in self._legacy_mapping diff --git a/test/functional/tools/format_source_in_conditional.xml b/test/functional/tools/format_source_in_conditional.xml index 4332c06971fc..7bf0de04e5bd 100644 --- a/test/functional/tools/format_source_in_conditional.xml +++ b/test/functional/tools/format_source_in_conditional.xml @@ -1,5 +1,9 @@ - cp '$input1' '$output1' + @@ -15,14 +19,16 @@ - + - + + + @@ -31,15 +37,19 @@ + + - + - + + +