juaml / junifer

Forschungszentrum Jülich Neuroimaging Feature Extractor
https://juaml.github.io/junifer
GNU Affero General Public License v3.0
14 stars 13 forks source link

[ENH]: Add `junifer list-elements` for listing out elements of an YAML's DataGrabber #323

Closed LeSasse closed 4 months ago

LeSasse commented 5 months ago

Are you requiring a new dataset or marker?

Which feature do you want to include?

I think it would be fantastic if junifer had a list-elements command line function which can be run on a yaml file with a specific datagrabber, and that will then print out all available elements in the format that junifer likes for subsetting the element keys using the --element elements.txt command line option for queue.

The workflow i imagine would have the advantage that i can very easily discover elements and subset them for testing using arbitrary command line filters, and then write them into a file for queing i.e.:

junifer list-elements <yaml> | tail -2 > elements.txt

How do you imagine this integrated in junifer?

as above

Do you have a sample code that implements this outside of junifer?

No response

Anything else to say?

No response

fraimondo commented 4 months ago

+1

excellent feature

We should implement this.

Maybe add a -o parameter to specify the file (instead of stdout), so we can keep the logging in stdout.

LeSasse commented 4 months ago

+1

excellent feature

We should implement this.

Maybe add a -o parameter to specify the file (instead of stdout), so we can keep the logging in stdout.

I think -o as an optional parameter is good, but i would like the option to go stdout as well for piping

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (08ac0d9) to head (192538e).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/323/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/junifer/pull/323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #323 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 1 1 Lines 1 1 ========================================= Hits 1 1 ``` | [Flag](https://app.codecov.io/gh/juaml/junifer/pull/323/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs](https://app.codecov.io/gh/juaml/junifer/pull/323/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `100.00% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more.
synchon commented 4 months ago

@LeSasse @fraimondo I've kept both of your demands, and junifer list-elements can write to stdout (with a fancy blue colour, of course) and also write to a file (keeping stdout clean) with --output-file or -o option.

github-actions[bot] commented 4 months ago

PR Preview Action v1.4.7 :---: Preview removed because the pull request was closed. 2024-04-16 15:00 UTC

fraimondo commented 4 months ago

Does this work?

junifer list-elements <yaml> | tail -2 > elements.txt
fraimondo commented 4 months ago

This is also excellent to debug/test, related to #319

LeSasse commented 4 months ago

This works very well for me, you have to set --verbose to 0 and run as junifer list-elements smoothing.yaml --verbose 0 | tail -2 > test.txt but I think that is reasonable