Skip to content

Conversation

@bernt-matthias
Copy link
Contributor

Was wondering converters should be added automatically for subclassed datatypes?

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

<option value="directory">directory</option>
<option value="zarr">zarr</option>
<option value="ome_zarr">ome_zarr</option>
<option value="lexicmap_index">lexicmap_index</option>
Copy link
Contributor Author

@bernt-matthias bernt-matthias Sep 4, 2025

Choose a reason for hiding this comment

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

Wondering why the tar2directory converter does not have this parameter. Should I add it?

Edit: Or should the tar2directory converter be replaced by this tool?
EditEdit: Ahh it already is.

@bernt-matthias
Copy link
Contributor Author

bernt-matthias commented Sep 4, 2025

Hrm, Timeout for the test? Worked with planemo...

Edit: Guess this was the galaxy-tool-util problem with conda

@bernt-matthias bernt-matthias changed the base branch from dev to release_25.0 September 4, 2025 08:45
@github-actions github-actions bot changed the title Add converters for lexicmap datatype [25.0] Add converters for lexicmap datatype Sep 4, 2025
@bernt-matthias
Copy link
Contributor Author

Setting this to draft until this is tested: galaxyproject/tools-iuc#7106 (comment)

@bernt-matthias bernt-matthias marked this pull request as draft September 4, 2025 16:13
@bernt-matthias bernt-matthias marked this pull request as ready for review September 4, 2025 19:25
@bernt-matthias
Copy link
Contributor Author

Instead of 4679231 one might modify the extract method .. but I was afraid of the fallout.

@bernt-matthias bernt-matthias changed the title [25.0] Add converters for lexicmap datatype [25.0] Add converters for lexicmap datatype and fix for flat zip files Sep 4, 2025
<datatype extension='qiime2.tabular' type="galaxy.datatypes.qiime2:QIIME2Metadata" display_in_upload="true"/>
<datatype extension="zip" type="galaxy.datatypes.binary:CompressedZipArchive" display_in_upload="true">
<converter file="archive_to_directory.xml" target_datatype="directory" />
<converter file="archive_to_directory.xml" target_datatype="lexicmap_index"/>
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't really make sense to me, that means every zip file is also a lexicmap_index.

@mvdbeek
Copy link
Member

mvdbeek commented Sep 5, 2025

<!-- Don't use tar directly so we can verify safety of results - tar -xzf '$input1'; -->
<requirements>
<requirement type="package" version="23.2.1">galaxy-util</requirement>
<requirement type="package" version="25.0.2">galaxy-util</requirement>
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix is in the command block.

The bump is essentially a backport of #20834

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to cleanup the PR and removed all the lexicmap stuff

Copy link
Member

Choose a reason for hiding this comment

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

The command block doesn't look right to me, if the input was flat files or directories it either shouldn't be needed or there is a fix necessary in CompressedFile.

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/util/compression_utils.py#L257-L259 that seems like it would be a problem, and is rather unpredictable.

with conda I get

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from galaxy.util.compression_utils import CompressedFile; CompressedFile('/tmp/tmp3v2nuot4/files/a/9/7/dataset_a97aebb4-46f7-47a9-b418-11ff1deeed74.dat').extract('.')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/compression_utils.py", line 29, in <module>
    from .checkers import (
    ...<2 lines>...
    )
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/checkers.py", line 20, in <module>
    from galaxy.util.image_util import image_type
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/image_util.py", line 3, in <module>
    import imghdr
ModuleNotFoundError: No module named 'imghdr'
```
zip files whose content is in a single top dir is correctly extracted.
but if the content is contained in the zip's root the extract method will
[add another level (the dataset name)](https://github.com/galaxyproject/galaxy/blob/af2d24082c52cbf8709561044f2082758aec6ff3/lib/galaxy/util/compression_utils.py#L256).
@bernt-matthias bernt-matthias changed the title [25.0] Add converters for lexicmap datatype and fix for flat zip files [25.0] Directory converters: fix for flat zip files Sep 5, 2025
@bernt-matthias
Copy link
Contributor Author

Closing in favor of: #20929

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.

2 participants