Skip to content

Comments

♻️ DRY up output key collection for group config#2210

Merged
shnizzedy merged 3 commits intodevelopfrom
fix/outputs.tsv
Apr 14, 2025
Merged

♻️ DRY up output key collection for group config#2210
shnizzedy merged 3 commits intodevelopfrom
fix/outputs.tsv

Conversation

@shnizzedy
Copy link
Member

Fixes

Fixes Load preset paired t-test with CPAC by @luisagulleiro

Description

cpac_outputs.csv was transitioned to cpac_outputs.tsv in v1.8.1 (deprecated in #1518 and removed in #1569 but a couple calls in the group runner didn't get updated.

Technical details

This PR consolidates the loading of outputs.tsv to a single call and DRYs up

derivatives = list(keys[keys["Sub-Directory"] == "func"]["Resource"])
derivatives = derivatives + list(
keys[keys["Sub-Directory"] == "anat"]["Resource"]
)
if pull_func:
derivatives = derivatives + list(
keys[keys["Space"] == "functional"]["Resource"]
)
derivative_list = list(keys[keys["Sub-Directory"] == "func"]["Resource"])
derivative_list = derivative_list + list(
keys[keys["Sub-Directory"] == "anat"]["Resource"]
)
if pull_func:
derivative_list = derivative_list + list(
keys[keys["Space"] == "functional"]["Resource"]
)
into

C-PAC/CPAC/utils/outputs.py

Lines 133 to 138 in 09853bd

def group_derivatives(pull_func: bool = False) -> list[str]:
"""Gather keys for anatomical and functional derivatives for group analysis."""
derivatives: list[str] = Outputs.func + Outputs.anat
if pull_func:
derivatives = derivatives + Outputs.bold_native
return derivatives
derivatives = group_derivatives(pull_func)
derivative_list = group_derivatives(pull_func)

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Copy link
Contributor

@birajstha birajstha left a comment

Choose a reason for hiding this comment

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

Just one question.

Co-authored-by: Biraj Shrestha  <111654544+birajstha@users.noreply.github.com>
@birajstha birajstha self-requested a review April 12, 2025 18:02
@shnizzedy shnizzedy merged commit c93c6d5 into develop Apr 14, 2025
27 checks passed
@shnizzedy shnizzedy deleted the fix/outputs.tsv branch April 14, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants