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]: Improving DataGrabber patterns #308

Merged
merged 27 commits into from
Apr 4, 2024
Merged

[ENH]: Improving DataGrabber patterns #308

merged 27 commits into from
Apr 4, 2024

Conversation

synchon
Copy link
Member

@synchon synchon commented Apr 3, 2024

Discussed in #307

Originally posted by synchon February 26, 2024
With the introduction of template space definitions in #252 and #268, the use of PatternDataladDataGrabber via YAML is broken as of 9316bca due to space awareness. The space key is added in get_item method of the DataGrabber and not defined in the constructor. The space key is important for every other component downstream and not having that breaks the pipeline. The solution I propose is not backwards compatible as it re-defines the structure of the patterns parameter, but in my opinion the cleanest and leanest way:

Old:

Python:

patterns = {
    "BOLD": "...",
    "T1w": "...",
}

YAML:

patterns:
  BOLD: "..."
  T1w: "..."

New:

Python:

patterns = {
    "BOLD": {
        "pattern": "...",
        "space": "...",
    },
    "T1w": {
        "pattern": "...",
        "space": "...",
    },
}

YAML:

patterns:
  BOLD:
    pattern: "..."
    space: "..."
  T1w:
    pattern: "..."
    space: "..."

I'm happy to discuss alternatives and adapt my solution.

@synchon synchon added enhancement New feature or request dataset Issues or pull requests related to datagrabbers or datasets labels Feb 26, 2024
@synchon synchon self-assigned this Feb 26, 2024
@synchon synchon changed the title Improving DataGrabber patterns [ENH]: Improving DataGrabber patterns Mar 8, 2024
@synchon synchon added this to the 0.0.4 (alpha 3) milestone Apr 3, 2024
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (407d189) to head (3e89413).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #308   +/-   ##
=========================================
  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.

Copy link

github-actions bot commented Apr 4, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-04 14:01 UTC

Copy link
Collaborator

@LeSasse LeSasse left a comment

Choose a reason for hiding this comment

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

LGTM

@synchon synchon merged commit a9e799c into main Apr 4, 2024
25 of 28 checks passed
@synchon synchon deleted the refactor/dg-patterns branch April 4, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataset Issues or pull requests related to datagrabbers or datasets enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants