diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc1f9db..5967653 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/tox-dev/pyproject-fmt - rev: 0.12.0 + rev: v2.5.0 hooks: - id: pyproject-fmt -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.272 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.3 hooks: - - id: ruff \ No newline at end of file + - id: ruff diff --git a/lib/eofs/standard.py b/lib/eofs/standard.py index 89306ee..7312d5a 100644 --- a/lib/eofs/standard.py +++ b/lib/eofs/standard.py @@ -153,7 +153,9 @@ def __init__(self, dataset, weights=None, center=True, ddof=1): raise ValueError('missing values detected in different ' 'locations at different times') if has_dask: - nonMissingIndex = dask.array.where(np.logical_not(np.isnan(self._data[0])))[0] + nonMissingIndex = dask.array.where( + np.logical_not(np.isnan(self._data[0])) + )[0] else: nonMissingIndex = np.where(np.logical_not(np.isnan(self._data[0])))[0] # Remove missing values from the design matrix. @@ -744,7 +746,9 @@ def projectField(self, field, neofs=None, eofscaling=0, weighted=True): raise ValueError('missing values detected in different ' 'locations at different times') if has_dask: - nonMissingIndex = dask.array.where(np.logical_not(np.isnan(self._data[0])))[0] # lee1043 testing + nonMissingIndex = dask.array.where( + np.logical_not(np.isnan(self._data[0])) + )[0] else: nonMissingIndex = np.where(np.logical_not(np.isnan(field_flat[0])))[0] try: diff --git a/pyproject.toml b/pyproject.toml index 1ec1801..ecbd9ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,16 +2,16 @@ build-backend = "setuptools.build_meta" requires = [ "setuptools>=42", - "setuptools_scm", + "setuptools-scm", "wheel", ] [project] name = "eofs" description = "EOF analysis in Python" -license = {text = "GPL-3.0"} +license = { text = "GPL-3.0" } authors = [ - {name = "Andrew Dawson", email = "dawson@atm.ox.ac.uk"}, + { name = "Andrew Dawson", email = "dawson@atm.ox.ac.uk" }, ] requires-python = ">=3.8" classifiers = [ @@ -21,34 +21,37 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dynamic = [ - "version", "readme", + "version", ] dependencies = [ "numpy", ] -[project.optional-dependencies] -iris = ["scitools-iris"] -xarray = ["xarray"] -[project.urls] -documentation = "https://ajdawson.github.io/eofs" -homepage = "https://github.com/ajdawson/eofs" -repository = "https://github.com/ajdawson/eofs" +optional-dependencies.iris = [ + "scitools-iris", +] +optional-dependencies.xarray = [ + "xarray", +] +urls.documentation = "https://ajdawson.github.io/eofs" +urls.homepage = "https://github.com/ajdawson/eofs" +urls.repository = "https://github.com/ajdawson/eofs" [tool.setuptools] -license-files = ["COPYING"] +license-files = [ "COPYING" ] include-package-data = true [tool.setuptools.packages.find] -where = ["lib"] +where = [ "lib" ] [tool.setuptools.package-data] eofs_examples = [ "example_data/*", ] -eofs_tests = ["data/*"] +eofs_tests = [ "data/*" ] [tool.setuptools.dynamic] -readme = {file = "README.md", content-type = "text/markdown"} +readme = { file = "README.md", content-type = "text/markdown" } [tool.setuptools_scm] write_to = "lib/eofs/_version.py" @@ -56,17 +59,13 @@ write_to_template = "__version__ = '{version}'" tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" [tool.ruff] -select = [ - "E", # pycodecstyle +lint.select = [ + "E", # pycodecstyle ] -[tool.ruff.per-file-ignores] -"doc/conf.py" = [ +lint.per-file-ignores."doc/conf.py" = [ "E401", "E402", ] -"doc/devguide/gitwash_dumper.py" = [ - "E714", -] [tool.pytest.ini_options] addopts = "-vrsx"