Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed May 7, 2024
1 parent 4145361 commit 2821b0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fmripost_aroma/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@ def write_metrics(features_df, out_dir, metric_metadata=None):
motion_ICs = features_df["classification"][features_df["classification"] == "rejected"].index
motion_ICs = motion_ICs.values

Check warning on line 155 in src/fmripost_aroma/utils/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/utils.py#L154-L155

Added lines #L154 - L155 were not covered by tests

with open(op.join(out_dir, "AROMAnoiseICs.csv"), "w") as fo:
with open(op.join(out_dir, "AROMAnoiseICs.csv"), "w") as file_obj:
out_str = ",".join(motion_ICs.astype(str))
fo.write(out_str)
file_obj.write(out_str)

Check warning on line 159 in src/fmripost_aroma/utils/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/utils.py#L158-L159

Added lines #L158 - L159 were not covered by tests

# Create a summary overview of the classification
out_file = op.join(out_dir, "desc-AROMA_metrics.tsv")
features_df.to_csv(out_file, sep="\t", index_label="IC")

Check warning on line 163 in src/fmripost_aroma/utils/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/utils.py#L162-L163

Added lines #L162 - L163 were not covered by tests

if isinstance(metric_metadata, dict):
with open(op.join(out_dir, "desc-AROMA_metrics.json"), "w") as fo:
json.dump(metric_metadata, fo, sort_keys=True, indent=4)
with open(op.join(out_dir, "desc-AROMA_metrics.json"), "w") as file_obj:
json.dump(metric_metadata, file_obj, sort_keys=True, indent=4)

Check warning on line 167 in src/fmripost_aroma/utils/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/utils.py#L167

Added line #L167 was not covered by tests

return motion_ICs

Check warning on line 169 in src/fmripost_aroma/utils/utils.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/utils/utils.py#L169

Added line #L169 was not covered by tests

Expand Down

0 comments on commit 2821b0d

Please sign in to comment.