diff --git a/nibabel/ecat.py b/nibabel/ecat.py index 34ff06323..c4b55624f 100644 --- a/nibabel/ecat.py +++ b/nibabel/ecat.py @@ -957,7 +957,7 @@ def to_file_map(self, file_map=None): hdr.write_to(hdrf) # Write every frames - for index in range(0, self.header['num_frames']): + for index in range(self.header['num_frames']): # Move to subheader offset frame_offset = subheaders._get_frame_offset(index) - 512 imgf.seek(frame_offset) diff --git a/nibabel/streamlines/tests/test_tractogram.py b/nibabel/streamlines/tests/test_tractogram.py index 915968854..72b84fac6 100644 --- a/nibabel/streamlines/tests/test_tractogram.py +++ b/nibabel/streamlines/tests/test_tractogram.py @@ -49,8 +49,8 @@ def make_fake_tractogram( ): """Make multiple streamlines according to provided requirements.""" all_streamlines = [] - all_data_per_point = defaultdict(lambda: []) - all_data_per_streamline = defaultdict(lambda: []) + all_data_per_point = defaultdict(list) + all_data_per_streamline = defaultdict(list) for nb_points in list_nb_points: data = make_fake_streamline( nb_points, data_per_point_shapes, data_for_streamline_shapes, rng diff --git a/pyproject.toml b/pyproject.toml index c5ec15ba7..0c1d5a7b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,7 @@ select = [ "C4", "F", "I", + "PIE", "PLE", "Q", "RSE", @@ -140,6 +141,7 @@ ignore = [ "C401", "C408", "C416", + "PIE790", # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", "E111",