Skip to content

Commit

Permalink
Merge pull request #355 from neutrinoceros/sty/select_missing_rules
Browse files Browse the repository at this point in the history
STY: re-sync linting rules with yt dev
  • Loading branch information
neutrinoceros authored Jan 8, 2025
2 parents b52c9fb + a313452 commit 8356d47
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ exclude = [".*"] # exclude dot files (.gitignore is still included)
exclude = ["tests"]

[tool.ruff.lint]
preview = true # needed for RUF031
explicit-preview-rules = true
exclude = [
"*/api.py",
"*/__init__.py",
Expand All @@ -90,6 +92,8 @@ select = [
"YTT", # flake8-2020
"UP", # pyupgrade
"I", # isort
"NPY", # numpy specific rules
"RUF031"# incorrectly-parenthesized-tuple-in-subscript
]
ignore = [
"E501", # line too long
Expand Down
2 changes: 1 addition & 1 deletion src/yt_idefix/_io/dmp_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def read_single_field(
data: 3D np.ndarray with dtype float64
"""
fh.seek(field_offset)
field_name, dtype, ndim, dim = read_next_field_properties(fh, byteorder=byteorder)
_field_name, dtype, _ndim, dim = read_next_field_properties(fh, byteorder=byteorder)
data = read_distributed(fh, dim, dtype=dtype, byteorder=byteorder, skip_data=False)
return data

Expand Down
2 changes: 1 addition & 1 deletion src/yt_idefix/_io/vtk_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def read_field_offset_index(
if len(line) < 2:
break
s = line.decode()
datatype, varname, dtype = s.split()
datatype, varname, _dtype = s.split()

# some versions of Pluto define field names in lower case
# so we normalize standard output field names to upper case
Expand Down
2 changes: 1 addition & 1 deletion src/yt_idefix/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _read_fluid_selection(self, chunks, selector, fields, size):
for grid in chunk.objs:
nd = 0
for field in fields:
ftype, fname = field
_ftype, fname = field
foffset = grid._index._field_offsets[fname]
values = self._read_single_field(fh, foffset)
nd = grid.select(selector, values, data[field], ind)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_get_data():

def test_read_dmp():
fn = idefix_khi
fprops, fdata = read_idefix_dmpfile(fn)
fprops, _fdata = read_idefix_dmpfile(fn)

expected_fields = {
"x1",
Expand Down

0 comments on commit 8356d47

Please sign in to comment.