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

STY: Assorted refurb suggestions #831

Merged
merged 3 commits into from
Oct 24, 2023
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
1 change: 0 additions & 1 deletion docs/sphinxext/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,3 @@ def setup(app):
app.add_role('ghuser', ghuser_role)
app.add_role('ghcommit', ghcommit_role)
app.add_config_value('github_project_url', None, 'env')
return
4 changes: 2 additions & 2 deletions niworkflows/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
""" py.test configuration file """
import os
from pathlib import Path
from datetime import datetime as dt
import datetime as dt
import pytest
from templateflow.api import get as get_template
from niworkflows.testing import test_data_env, data_env_canary
Expand All @@ -34,7 +34,7 @@

def _run_interface_mock(objekt, runtime):
runtime.returncode = 0
runtime.endTime = dt.isoformat(dt.utcnow())
runtime.endTime = dt.datetime.isoformat(dt.datetime.now(dt.timezone.utc))

objekt._out_report = os.path.abspath(objekt.inputs.out_report)
objekt._post_run_hook(runtime)
Expand Down
12 changes: 5 additions & 7 deletions niworkflows/viz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ def _3d_in_file(in_file):

in_file = filemanip.filename_to_list(in_file)[0]

try:
in_file = nb.load(in_file)
except AttributeError:
in_file = in_file
in_file = nb.load(in_file)

if len(in_file.shape) == 3:
return in_file
Expand Down Expand Up @@ -589,9 +586,10 @@ def plot_melodic_components(
else:
mask_img = nb.load(report_mask)

mask_sl = []
for j in range(3):
mask_sl.append(transform_to_2d(mask_img.get_fdata(), j))
mask_sl = [
transform_to_2d(mask_img.get_fdata(), j)
for j in range(3)
]

timeseries = np.loadtxt(os.path.join(melodic_dir, "melodic_mix"))
power = np.loadtxt(os.path.join(melodic_dir, "melodic_FTmix"))
Expand Down