Skip to content

Commit a112dcc

Browse files
STY: Apply ruff/flake8-logging-format rule G004
G004 Logging statement uses f-string
1 parent ee935b2 commit a112dcc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

niworkflows/interfaces/bids.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def _run_interface(self, runtime):
673673
data_dtype = nb.load(self.inputs.source_file[0]).get_data_dtype()
674674
except Exception: # noqa: BLE001
675675
LOGGER.warning(
676-
f'Could not get data type of file {self.inputs.source_file[0]}'
676+
'Could not get data type of file %s', self.inputs.source_file[0]
677677
)
678678
data_dtype = None
679679

@@ -682,8 +682,10 @@ def _run_interface(self, runtime):
682682
orig_dtype = nii.get_data_dtype()
683683
if orig_dtype != data_dtype:
684684
LOGGER.warning(
685-
f'Changing {Path(dest_file).name} dtype '
686-
f'from {orig_dtype} to {data_dtype}'
685+
'Changing %s dtype from %s to %s',
686+
Path(dest_file).name,
687+
orig_dtype,
688+
data_dtype,
687689
)
688690
# coerce dataobj to new data dtype
689691
if np.issubdtype(data_dtype, np.integer):
@@ -1186,7 +1188,7 @@ def _run_interface(self, runtime):
11861188
data_dtype = nb.load(self.inputs.source_file[0]).get_data_dtype()
11871189
except Exception: # noqa: BLE001
11881190
LOGGER.warning(
1189-
f'Could not get data type of file {self.inputs.source_file[0]}'
1191+
'Could not get data type of file %s', self.inputs.source_file[0]
11901192
)
11911193
data_dtype = None
11921194

@@ -1195,7 +1197,7 @@ def _run_interface(self, runtime):
11951197
orig_dtype = nii.get_data_dtype()
11961198
if orig_dtype != data_dtype:
11971199
LOGGER.warning(
1198-
f'Changing {out_file} dtype from {orig_dtype} to {data_dtype}'
1200+
'Changing %s dtype from %s to %s', out_file, orig_dtype, orig_dtype
11991201
)
12001202
# coerce dataobj to new data dtype
12011203
if np.issubdtype(data_dtype, np.integer):

0 commit comments

Comments
 (0)