forked from nipoppy/nipoppy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to match neurodatascience/nipoppy:main (#51)
- Loading branch information
Showing
14 changed files
with
265 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[flake8] | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
env, | ||
venv, | ||
per-file-ignores = | ||
# - docstrings rules that should not be applied to tests | ||
tests/*: D100, D103, D104 | ||
# allow "weird indentation" | ||
tests/test_workflow_*.py: D100, D103, D104, E131, E127, E501 | ||
max-line-length = 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.PHONY: data/ds004097 | ||
|
||
data/ds004097: | ||
rm -fr data/ds004097 | ||
datalad install -s ///openneuro/ds004097 data/ds004097 | ||
cd data/ds004097 && datalad get sub-NDARDD890AYU/ses-01/anat/ -J 12 | ||
cd data/ds004097 && datalad get sub-NDARDD890AYU/ses-01/dwi/ -J 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,55 @@ | ||
from __future__ import annotations | ||
|
||
import json | ||
import shutil | ||
from pathlib import Path | ||
|
||
|
||
def global_config_file() -> Path: | ||
def _global_config_file() -> Path: | ||
return Path(__file__).parent / "data" / "test_global_configs.json" | ||
|
||
|
||
def global_config_for_testing(pth: Path) -> dict: | ||
"""Set up configuration for testing and create required directories.""" | ||
with open(global_config_file(), "r") as f: | ||
with open(_global_config_file(), "r") as f: | ||
global_configs = json.load(f) | ||
|
||
global_configs["DATASET_ROOT"] = str(pth) | ||
|
||
(pth / "bids").mkdir(parents=True, exist_ok=True) | ||
|
||
return global_configs | ||
|
||
|
||
def create_dummy_bids_filter( | ||
pth: Path, filename: str = "bids_filter.json" | ||
) -> None: | ||
"""Use a modified content from the tractoflow sample.""" | ||
bids_filter = { | ||
"t1w": { | ||
"datatype": "anat", | ||
"session": "01", | ||
"run": "1", | ||
"suffix": "T1w", | ||
}, | ||
"dwi": {"session": "01", "run": "1", "suffix": "dwi"}, | ||
} | ||
|
||
pth.mkdir(parents=True, exist_ok=True) | ||
with open(pth / filename, "w") as f: | ||
json.dump(bids_filter, f) | ||
|
||
|
||
def mock_bids_dataset(pth: Path, dataset: str) -> Path: | ||
"""Copy a BIDS example dataset to the given path.""" | ||
ds = Path(__file__).parent / "data" / dataset | ||
print(f"\nCopying {ds} to {pth}\n") | ||
shutil.copytree( | ||
ds, | ||
pth, | ||
symlinks=True, | ||
ignore_dangling_symlinks=True, | ||
dirs_exist_ok=True, | ||
) | ||
|
||
return pth / "bids" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ds** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.