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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.1
rev: v0.16.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -68,7 +68,7 @@ repos:


- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.27.0"
rev: "v2.27.1"
hooks:
- id: pyproject-fmt

Expand Down
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@


# -- Extension configuration -------------------------------------------------
# Ignore self-ref URLs
linkcheck_ignore = [
"https://stackoverflow.com/*",
]
2 changes: 1 addition & 1 deletion oceans/RPSstuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def ms2hms(millisecs):
return hour, mn, sec


def julian(y, m=0, d=0, h=0, mi=0, s=0, *, noon=False): # noqa: PLR0913
def julian(y, m=0, d=0, h=0, mi=0, s=0, *, noon=False): # noqa: PLR0917, PLR0913
"""Converts Gregorian calendar dates to Julian dates

USAGE: [j]=julian(y,m,d,h)
Expand Down
2 changes: 1 addition & 1 deletion oceans/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def woa_profile(


@functools.lru_cache(maxsize=256)
def woa_subset( # noqa: PLR0913
def woa_subset( # noqa: PLR0917, PLR0913
min_lon,
max_lon,
min_lat,
Expand Down
2 changes: 1 addition & 1 deletion oceans/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def smoo1(datain, window_len=11, window="hanning"):
return data_out[window_len - 1 : -window_len + 1]


def smoo2(A, hei, wid, kind="hann", badflag=-9999, beta=14): # noqa: ARG001, PLR0915, PLR0913, C901
def smoo2(A, hei, wid, kind="hann", badflag=-9999, beta=14): # noqa: ARG001, PLR0917, PLR0915, PLR0913, C901
"""Calculates the smoothed array 'As' from the original array 'A' using the
specified window of type 'kind' and shape ('hei', 'wid').

Expand Down
2 changes: 1 addition & 1 deletion oceans/ocfis.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def alphanum_key(s):
return key


def get_profile(x, y, f, xi, yi, mode="nearest", order=3): # noqa: PLR0913
def get_profile(x, y, f, xi, yi, mode="nearest", order=3): # noqa: PLR0913, PLR0917
"""Interpolate regular data.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion oceans/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class EditPoints:
>>> _ = ax.set_title("Click and drag a point to move it")
>>> _ = ax.axis([-2, 2, -2, 2])

Based on https://matplotlib.org/examples/event_handling/poly_editor.html
Based on https://matplotlib.org/stable/gallery/event_handling/poly_editor.html

"""

Expand Down
2 changes: 1 addition & 1 deletion oceans/sw_extras/waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Waves:

"""

def __init__(self, h, T=None, L=None, thetao=None, Ho=None, lat=None): # noqa: PLR0915, PLR0913, PLR0912, C901
def __init__(self, h, T=None, L=None, thetao=None, Ho=None, lat=None): # noqa: PLR0917, PLR0915, PLR0913, PLR0912, C901
self.T = np.asarray(T, dtype=np.float64)
self.L = np.asarray(L, dtype=np.float64)
self.Ho = np.asarray(Ho, dtype=np.float64)
Expand Down
2 changes: 1 addition & 1 deletion oceans/synop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np


def scaloa(xc, yc, x, y, t=None, corrlen=None, err=None, zc=None): # noqa: PLR0913
def scaloa(xc, yc, x, y, t=None, corrlen=None, err=None, zc=None): # noqa: PLR0913, PLR0917
"""Scalar objective analysis. Interpolates t(x, y) into tp(xc, yc)
Assumes spatial correlation function to be isotropic and Gaussian in the
form of: C = (1 - err) * np.exp(-d**2 / corrlen**2) where:
Expand Down
57 changes: 29 additions & 28 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ line-length = 110
lint.select = ["ALL"]

lint.ignore = [
"COM812", # missing-trailing-comma
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D213", # incompatible. Ignoring `multi-line-summary-second-line`
"TRY003", # Avoid specifying long messages outside the exception class
"ANN", # Missing type annotation
"D", # Missing type annotation
"N", # Missing type annotation
"PLR2004", # Magic value used in comparison
"PLC0415", # `import` should be at the top-level of a file
"INP001", # implicit namespace package
"RUF015", # Prefer `next(...)` over single element slice
"ANN", # Missing type annotation
"COM812", # missing-trailing-comma
"CPY001", # Missing copyright notice at top of file
"D", # Missing type annotation
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D213", # incompatible. Ignoring `multi-line-summary-second-line`
"INP001", # implicit namespace package
"N", # Missing type annotation
"PLC0415", # `import` should be at the top-level of a file
"PLR2004", # Magic value used in comparison
"RUF015", # Prefer `next(...)` over single element slice
"TRY003", # Avoid specifying long messages outside the exception class
]

[lint.extend-per-file-ignores]
Expand All @@ -27,26 +28,26 @@ lint.ignore = [
"EXE001", # Shebang is present but file is not executable
]
"test_*.py" = [
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"INP001", # File is part of an implicit namespace package
"PD901", # Avoid using the generic variable name `df` for DataFrames
"S101", # Use of assert detected
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"INP001", # File is part of an implicit namespace package
"PD901", # Avoid using the generic variable name `df` for DataFrames
"S101", # Use of assert detected
]
# nbqa-ruff acts on converted .py so we cannot glob .ipynb :-/
# https://github.com/nbQA-dev/nbQA/issues/823
"notebooks/*" = [
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"B018", # Found useless expression. Either assign it to a variable or remove it
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"E402", # Module level import not at top of file
"FBT003", # Boolean positional value in function call
"INP001", # File is part of an implicit namespace package
"PD901", # Avoid using the generic variable name `df` for DataFrames
"T201", # `print` found"
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"B018", # Found useless expression. Either assign it to a variable or remove it
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"E402", # Module level import not at top of file
"FBT003", # Boolean positional value in function call
"INP001", # File is part of an implicit namespace package
"PD901", # Avoid using the generic variable name `df` for DataFrames
"T201", # `print` found"
]
[lint.pycodestyle]
max-doc-length = 180