Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ci/min_deps_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def parse_requirements(fname) -> Iterator[tuple[str, int, int, int | None]]:

try:
version_tup = tuple(int(x) for x in version.split("."))
except ValueError:
raise ValueError("non-numerical version: " + row)
except ValueError as e:
raise ValueError("non-numerical version: " + row) from e

if len(version_tup) == 2:
yield (pkg, *version_tup, None) # type: ignore[misc]
Expand Down
4 changes: 2 additions & 2 deletions parcels/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def __init__(

try:
dtype = np.dtype(dtype)
except (TypeError, ValueError):
except (TypeError, ValueError) as e:
if dtype is not _SAME_AS_FIELDSET_TIME_INTERVAL.VALUE:
raise TypeError(f"Variable dtype must be a valid numpy dtype. Got {dtype=!r}")
raise TypeError(f"Variable dtype must be a valid numpy dtype. Got {dtype=!r}") from e

if to_write not in _TO_WRITE_OPTIONS:
raise ValueError(f"to_write must be one of {_TO_WRITE_OPTIONS!r}. Got {to_write=!r}")
Expand Down
2 changes: 1 addition & 1 deletion parcels/xgcm/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def check_neighbor(link, position):
try:
neighbor_link = face_links[idx][ax][correct_position]
except (KeyError, IndexError):
raise KeyError(
raise KeyError( # noqa: B904
f"Couldn't find a face link for face {idx!r}in axis {ax!r} at position {correct_position!r}"
)
idx_n, ax_n, rev_n = neighbor_link
Expand Down
11 changes: 0 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ parcels = { path = ".", editable = true }
[tool.setuptools]
packages = ["parcels"]

[tool.setuptools.package-data]
parcels = ["parcels/include/*"]

[tool.setuptools_scm]
write_to = "parcels/_version_setup.py"
local_scheme = "no-local-version"
Expand Down Expand Up @@ -193,15 +190,7 @@ ignore = [
"D404",
# 1 blank line required between summary line and description (requires writing of summaries)
"D205",
# do not use bare except, specify exception instead
"E722",
"F811",


# TODO: These bugbear issues are to be resolved
"B011", # Do not `assert False`
"B016", # Cannot raise a literal. Did you intend to return it or raise an Exception?
"B904", # Within an `except` clause, raise exceptions
]

[tool.ruff.lint.pydocstyle]
Expand Down
Loading