Skip to content

Commit

Permalink
fix: apply ruff check fixes for Python docstrings (D409) (#232)
Browse files Browse the repository at this point in the history
Applies ruff check section-underline-matches-section-length (D409), which impacts two Python source files.

Also re-configures ruff's configuration to remove "include" to apply the checks globally. It also removes the extend-include since the default value for include already has "*.ipynb". A default line-length = 88 is also re-iterated at the top of the configuration.
  • Loading branch information
mwtoews authored Nov 19, 2024
1 parent e15df40 commit aaf5c74
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
19 changes: 8 additions & 11 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
line-length = 88
target-version = "py39"
include = [
"autotest/**/*.py",
"scripts/**/*.py",
"etc/**/*.py",
".doc/**/*.py",
]
extend-include = [
".doc/**/*.ipynb"
]

[lint]
select = ["F", "E", "I001"]
select = [
"D409", # pydocstyle - section-underline-matches-section-length
"E", # pycodestyle error
"F", # Pyflakes
"I001", # isort - unsorted-imports
]
ignore = [
"E501", # line too long TODO FIXME
"E722", # do not use bare `except`
"E741", # ambiguous variable name
"F841", # local variable assigned but never used
]
]
16 changes: 8 additions & 8 deletions scripts/ex-gwf-curvilinear-90.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ def iter_row_col(self):
"""Generator that iterates through each rows' columns.
Yields
-------
------
(int, int)
Row index, column index
"""
Expand All @@ -995,7 +995,7 @@ def iter_row_cellid(self, row):
Row index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -1012,7 +1012,7 @@ def iter_column_cellid(self, col):
Column index.
Yields
-------
------
int
cellid index
"""
Expand Down Expand Up @@ -1141,7 +1141,7 @@ class DisvGridMerger:
name, and value is the merged grid's cellid.
Notes
-------
-----
The following is always true:
``cell2name[cell] == name2vert[cell2name[cell]]``
Expand Down Expand Up @@ -2066,7 +2066,7 @@ def iter_rad_col(self):
"""Generator that iterates through the radial band columns, then bands.
Yields
-------
------
(int, int)
radial band index, column index
"""
Expand All @@ -2082,7 +2082,7 @@ def iter_radial_cellid(self, rad):
Radial index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -2102,7 +2102,7 @@ def iter_column_cellid(self, col):
Column index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -2120,7 +2120,7 @@ def iter_columns(self, rad):
Radial index.
Yields
-------
------
int
column index
"""
Expand Down
16 changes: 8 additions & 8 deletions scripts/ex-gwf-curvilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ def iter_row_col(self):
"""Generator that iterates through each rows' columns.
Yields
-------
------
(int, int)
Row index, column index
"""
Expand All @@ -995,7 +995,7 @@ def iter_row_cellid(self, row):
Row index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -1012,7 +1012,7 @@ def iter_column_cellid(self, col):
Column index.
Yields
-------
------
int
cellid index
"""
Expand Down Expand Up @@ -1141,7 +1141,7 @@ class DisvGridMerger:
name, and value is the merged grid's cellid.
Notes
-------
-----
The following is always true:
``cell2name[cell] == name2vert[cell2name[cell]]``
Expand Down Expand Up @@ -2066,7 +2066,7 @@ def iter_rad_col(self):
"""Generator that iterates through the radial band columns, then bands.
Yields
-------
------
(int, int)
radial band index, column index
"""
Expand All @@ -2082,7 +2082,7 @@ def iter_radial_cellid(self, rad):
Radial index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -2102,7 +2102,7 @@ def iter_column_cellid(self, col):
Column index.
Yields
-------
------
int
cellid index
"""
Expand All @@ -2120,7 +2120,7 @@ def iter_columns(self, rad):
Radial index.
Yields
-------
------
int
column index
"""
Expand Down

0 comments on commit aaf5c74

Please sign in to comment.