Skip to content

Commit

Permalink
Merge pull request #1354 from DimitriPapadopoulos/PIE
Browse files Browse the repository at this point in the history
STY: Enforce ruff/flake8-pie rules (PIE)
  • Loading branch information
effigies authored Sep 22, 2024
2 parents 7b3c1b2 + 576b74b commit 4b6132d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nibabel/ecat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions nibabel/streamlines/tests/test_tractogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ select = [
"C4",
"F",
"I",
"PIE",
"PLE",
"Q",
"RSE",
Expand All @@ -140,6 +141,7 @@ ignore = [
"C401",
"C408",
"C416",
"PIE790",
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
Expand Down

0 comments on commit 4b6132d

Please sign in to comment.