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

Merged
synchon merged 5 commits from feat/list-elements into main 2024-04-16 14:29:04 +00:00
synchon commented 2024-04-16 09:50:54 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

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

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### 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 2024-04-12 17:00:54 +00:00 (Migrated from github.com)

+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.

+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 2024-04-12 17:14:52 +00:00 (Migrated from github.com)

+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

> +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 2024-04-16 10:12:20 +00:00 (Migrated from github.com)

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #323   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            1         1           
=========================================
  Hits             1         1           
Flag Coverage Δ
docs 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/323?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report All modified and coverable lines are covered by tests :white_check_mark: > Project coverage is 100.00%. Comparing base [(`08ac0d9`)](https://app.codecov.io/gh/juaml/junifer/commit/08ac0d9872664f39ae75537c0c4636accc33ef79?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) to head [(`192538e`)](https://app.codecov.io/gh/juaml/junifer/pull/323?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml). <details><summary>Additional details and impacted files</summary> [![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. </details>
synchon commented 2024-04-16 10:14:08 +00:00 (Migrated from github.com)

@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.

@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 2024-04-16 10:18:16 +00:00 (Migrated from github.com)
PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-16 15:00 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.4.7 :---: Preview removed because the pull request was closed. 2024-04-16 15:00 UTC <!-- Sticky Pull Request Commentpr-preview -->
fraimondo commented 2024-04-16 12:07:42 +00:00 (Migrated from github.com)

Does this work?

junifer list-elements <yaml> | tail -2 > elements.txt
Does this work? ``` junifer list-elements <yaml> | tail -2 > elements.txt ```
fraimondo (Migrated from github.com) approved these changes 2024-04-16 12:09:18 +00:00
fraimondo (Migrated from github.com) left a comment

If the command that @LeSasse needed works, then I'm good with it.

If the command that @LeSasse needed works, then I'm good with it.
fraimondo commented 2024-04-16 12:10:21 +00:00 (Migrated from github.com)

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

This is also excellent to debug/test, related to #319
LeSasse commented 2024-04-16 14:15:44 +00:00 (Migrated from github.com)

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

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
LeSasse (Migrated from github.com) approved these changes 2024-04-16 14:18:02 +00:00
LeSasse (Migrated from github.com) left a comment

LGTM

LGTM
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!323
No description provided.