Skip to content

Commit

Permalink
Update bids.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Sep 21, 2024
1 parent 0846d40 commit d2f2fd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/fmripost_aroma/utils/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ def write_derivative_description(input_dir, output_dir, dataset_links=None):

orig_dset_description = os.path.join(input_dir, 'dataset_description.json')

Check warning on line 263 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L263

Added line #L263 was not covered by tests
if not os.path.isfile(orig_dset_description):
raise FileNotFoundError(f'Dataset description DNE: {orig_dset_description}')
raise FileNotFoundError(f'Dataset description does not exist: {orig_dset_description}')

Check warning on line 265 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L265

Added line #L265 was not covered by tests

with open(orig_dset_description) as fo:
desc = json.load(fo)
with open(orig_dset_description) as fobj:
desc = json.load(fobj)

Check warning on line 268 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L268

Added line #L268 was not covered by tests

# Update dataset description
desc['Name'] = 'fMRIPost-AROMA- ICA-AROMA Postprocessing Outputs'
Expand All @@ -281,8 +281,9 @@ def write_derivative_description(input_dir, output_dir, dataset_links=None):
if name not in ('templateflow', 'input'):
dataset_desc = Path(link) / 'dataset_description.json'

Check warning on line 282 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L282

Added line #L282 was not covered by tests
if dataset_desc.isfile():
with open(dataset_desc) as fo:
dataset_desc_dict = json.load(fo)
with open(dataset_desc) as fobj:
dataset_desc_dict = json.load(fobj)

Check warning on line 285 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L285

Added line #L285 was not covered by tests

if 'GeneratedBy' in dataset_desc_dict:
desc['GeneratedBy'].insert(0, dataset_desc_dict['GeneratedBy'][0])

Check warning on line 288 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L288

Added line #L288 was not covered by tests

Expand All @@ -309,7 +310,6 @@ def write_derivative_description(input_dir, output_dir, dataset_links=None):
'URI': os.getenv('FMRIPOST_AROMA__SINGULARITY_URL'),
}


# Replace local templateflow path with URL
dataset_links = dataset_links.copy()
dataset_links['templateflow'] = 'https://github.com/templateflow/templateflow'

Check warning on line 315 in src/fmripost_aroma/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/bids.py#L314-L315

Added lines #L314 - L315 were not covered by tests
Expand Down

0 comments on commit d2f2fd7

Please sign in to comment.