Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add derivatives command and pipeline-catalog submodule #349

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Sep 27, 2024

Changes proposed in this pull request:

  • Add nipoppy/pipeline-catalog as submodule
  • Create new bagel derivatives command
    • Add basic input checks of processing status TSV: no missing subject IDs, no new (unique) subjects, only recognized pipeline names + vers
    • Add command logic to extract completed pipelines per subject-session based on step statuses
    • Aggregate valid pipeline info for missing sessions for a subject under a new custom ses-nb01 ImagingSession
  • Move I/O utils shared between commands into a new module file_utils.py to avoid circular imports
  • Add new derivative_utils.py to hold helper funcs for bagel derivatives
  • Add new example processing status TSVs (7 total)
  • Switch to re-generating the @context in each command (previously, we were stripping it from an input JSONLD and re-adding it at the end. This led to sometimes ending up with an incomplete @context without all the terms used/added to the dataset by the command that was just run)

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 99.24242% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.34%. Comparing base (5d15125) to head (5af6a6d).

Files with missing lines Patch % Lines
bagel/utility.py 94.73% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   98.08%   98.34%   +0.26%     
==========================================
  Files          13       16       +3     
  Lines         782      966     +184     
==========================================
+ Hits          767      950     +183     
- Misses         15       16       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alyssadai alyssadai marked this pull request as ready for review October 1, 2024 16:31
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @alyssadai for this very big PR and for setting up a brand new subcommand!
I really like the extensive testing of the new functionalities.

That said, I have a couple of comments on the code itself that I think make sense to address before merging. Everything runs, so I'll let you take a look at them and tell me when you're ready to merge before approving.

As I mentioned today, I don't know yet how to better break down or review such a big feature, but we should find a more efficient way - this takes a lot of uninterrupted concentration to review well and thus a lot of time.

bagel/cli.py Outdated Show resolved Hide resolved
bagel/cli.py Outdated Show resolved Hide resolved
bagel/cli.py Show resolved Hide resolved
bagel/cli.py Show resolved Hide resolved
bagel/cli.py Outdated Show resolved Hide resolved
bagel/tests/test_utility.py Show resolved Hide resolved
bagel/tests/test_utility.py Outdated Show resolved Hide resolved
bagel/tests/test_utility.py Show resolved Hide resolved
bagel/tests/test_cli_derivatives.py Outdated Show resolved Hide resolved
bagel/tests/test_cli_derivatives.py Outdated Show resolved Hide resolved
@alyssadai alyssadai requested a review from surchs October 3, 2024 15:35
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks very much @alyssadai, looks great.

🧑‍🍳

@alyssadai
Copy link
Contributor Author

Keeping this PR open for now to merge branch for #346 back into this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-minor Non-breaking feature or enhancement, will increment minor version (0.+1.0)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new sub-command for bagel-CLI derivatives: Investigate schema and examples for the Nipoppy imaging bagel
3 participants