Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1

test:
if: "!contains(github.event.head_commit.message, '[skip ci]' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nipreps/sdcflows'))"
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
datalad get -r -J 2 -d ds000206/ ds000206/sub-05/

# Brain extraction tests
datalad install -r https://gin.g-node.org/nipreps-data/brain-extraction-tests
datalad install -r https://github.com/nipreps-data/brain-extraction-tests
datalad update --merge -d brain-extraction-tests/
datalad get -r -J 2 -d brain-extraction-tests brain-extraction-tests/*

Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/validate.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test = [
"pytest >= 8.1",
"pytest-cov >= 2.11",
"pytest-env",
"pytest-xdist >= 2.5",
"pytest-xdist >= 3.3",
]

# Aliases
Expand Down
20 changes: 20 additions & 0 deletions sdcflows/utils/tests/test_wrangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,26 @@ def test_wrangler_URIs(tmpdir, name, skeleton, session, estimations, total_estim
clear_registry()


@pytest.mark.parametrize('bids_filters', [None, {'datatype': 'fmap'}])
def test_sessionwise_queries(tmp_path, bids_filters):
"""One query per session must find that session's fieldmap."""
bids_dir = tmp_path / 'bids'
generate_bids_skeleton(bids_dir, phasediff)
layout = gen_layout(bids_dir)

for session in ('01', '02', '03'):
est = find_estimators(
layout=layout,
subject='01',
sessions=[session],
bids_filters=bids_filters,
)
assert len(est) == 1
assert all(f'ses-{session}' in str(source.path) for source in est[0].sources)

clear_registry()


def test_single_reverse_pedir(tmp_path):
bids_dir = tmp_path / 'bids'
generate_bids_skeleton(bids_dir, pepolar)
Expand Down
10 changes: 4 additions & 6 deletions sdcflows/utils/wrangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@ def find_estimators(

if bids_filters:
filters = bids_filters.copy() # copy to avoid altering in place
if 'session' in bids_filters and sessions is not None:
raise ValueError('Filters include session, but session is already defined.')
sessions = listify(filters.pop('session', None))
if 'session' in filters:
if sessions is not None:
raise ValueError('Filters include session, but session is already defined.')
sessions = listify(filters.pop('session'))
base_entities.update(filters)

subject_root = Path(layout.root) / f'sub-{subject}'
Expand Down Expand Up @@ -363,9 +364,6 @@ def find_estimators(

for b0_id in b0_ids:
# Found B0FieldIdentifier metadata entries
b0_entities = base_entities.copy()
b0_entities['B0FieldIdentifier'] = b0_id

bare_ids = layout.get(**base_entities, B0FieldIdentifier=b0_id)
listed_ids = layout.get(
**base_entities,
Expand Down
Loading