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
6 changes: 3 additions & 3 deletions nibabies/cli/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def test_parser_valid(tmp_path, args):
('1000MB', 1),
('1T', 1000),
('1TB', 1000),
('%dK' % 1e6, 1),
('%dKB' % 1e6, 1),
('%dB' % 1e9, 1),
(f'{1e6:.0f}K', 1),
(f'{1e6:.0f}KB', 1),
(f'{1e9:.0f}B', 1),
],
)
def test_memory_arg(tmp_path, argval, gb):
Expand Down
7 changes: 3 additions & 4 deletions nibabies/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@
# Just get so analytics track one hit
from contextlib import suppress

from requests import ConnectionError, ReadTimeout
from requests import get as _get_url
import requests

with suppress((ConnectionError, ReadTimeout)):
_get_url('https://rig.mit.edu/et/projects/nipy/nipype', timeout=0.05)
with suppress((requests.ConnectionError, requests.ReadTimeout)):
requests.get('https://rig.mit.edu/et/projects/nipy/nipype', timeout=0.05)

# Execution environment
_exec_env = os.name
Expand Down
6 changes: 3 additions & 3 deletions nibabies/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ def _generate_segment(self):
reg = {
'FSL': [
'FSL <code>flirt</code> with boundary-based registration'
' (BBR) metric - %d dof' % dof,
f' (BBR) metric - {dof} dof',
'FSL <code>flirt</code> rigid registration - 6 dof',
],
'FreeSurfer': [
'FreeSurfer <code>bbregister</code> '
'(boundary-based registration, BBR) - %d dof' % dof,
'FreeSurfer <code>mri_coreg</code> - %d dof' % dof,
f'(boundary-based registration, BBR) - {dof} dof',
f'FreeSurfer <code>mri_coreg</code> - {dof} dof',
],
}[self.inputs.registration][self.inputs.fallback]

Expand Down
2 changes: 1 addition & 1 deletion nibabies/reports/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def generate_reports(

logger = logging.getLogger('cli')
error_list = ', '.join(
'%s (%d)' % (subid, err)
f'{subid} ({err})'
for subid, err in zip(sub_ses_list, report_errors, strict=False)
if err
)
Expand Down
2 changes: 1 addition & 1 deletion nibabies/workflows/bold/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def prepare_timing_parameters(metadata: dict):
if run_stc:
first, last = st[0], st[-1]
frac = config.workflow.slice_time_ref
tzero = np.round(first + frac * (last - first), 3)
tzero = float(np.round(first + frac * (last - first), 3))
timing_parameters['StartTime'] = tzero

return timing_parameters
Expand Down
2 changes: 1 addition & 1 deletion nibabies/workflows/bold/stc.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def init_bold_stc_wf(metadata, name='bold_stc_wf'):
frac = config.workflow.slice_time_ref
tzero = np.round(first + frac * (last - first), 3)

afni_ver = ''.join('%02d' % v for v in afni.Info().version() or [])
afni_ver = ''.join(f'{v:02d}' % v for v in afni.Info().version() or [])
workflow = Workflow(name=name)
workflow.__desc__ = f"""\
BOLD runs were slice-time corrected to {tzero:0.3g}s ({frac:g} of slice acquisition range
Expand Down
Loading