Skip to content

Commit e44e56c

Browse files
authored
Merge pull request #157 from ajdawson/updates-to-pre-commit-and-pyproject
Updates to checks in pre-commit config
2 parents a6c2f35 + 949bb03 commit e44e56c

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: https://github.com/tox-dev/pyproject-fmt
3-
rev: 0.12.0
3+
rev: v2.5.0
44
hooks:
55
- id: pyproject-fmt
66

7-
- repo: https://github.com/charliermarsh/ruff-pre-commit
8-
rev: v0.0.272
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.7.3
99
hooks:
10-
- id: ruff
10+
- id: ruff

lib/eofs/standard.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def __init__(self, dataset, weights=None, center=True, ddof=1):
153153
raise ValueError('missing values detected in different '
154154
'locations at different times')
155155
if has_dask:
156-
nonMissingIndex = dask.array.where(np.logical_not(np.isnan(self._data[0])))[0]
156+
nonMissingIndex = dask.array.where(
157+
np.logical_not(np.isnan(self._data[0]))
158+
)[0]
157159
else:
158160
nonMissingIndex = np.where(np.logical_not(np.isnan(self._data[0])))[0]
159161
# Remove missing values from the design matrix.
@@ -744,7 +746,9 @@ def projectField(self, field, neofs=None, eofscaling=0, weighted=True):
744746
raise ValueError('missing values detected in different '
745747
'locations at different times')
746748
if has_dask:
747-
nonMissingIndex = dask.array.where(np.logical_not(np.isnan(self._data[0])))[0] # lee1043 testing
749+
nonMissingIndex = dask.array.where(
750+
np.logical_not(np.isnan(self._data[0]))
751+
)[0]
748752
else:
749753
nonMissingIndex = np.where(np.logical_not(np.isnan(field_flat[0])))[0]
750754
try:

pyproject.toml

+21-22
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
build-backend = "setuptools.build_meta"
33
requires = [
44
"setuptools>=42",
5-
"setuptools_scm",
5+
"setuptools-scm",
66
"wheel",
77
]
88

99
[project]
1010
name = "eofs"
1111
description = "EOF analysis in Python"
12-
license = {text = "GPL-3.0"}
12+
license = { text = "GPL-3.0" }
1313
authors = [
14-
{name = "Andrew Dawson", email = "[email protected]"},
14+
{ name = "Andrew Dawson", email = "[email protected]" },
1515
]
1616
requires-python = ">=3.8"
1717
classifiers = [
@@ -21,52 +21,51 @@ classifiers = [
2121
"Programming Language :: Python :: 3.10",
2222
"Programming Language :: Python :: 3.11",
2323
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2425
]
2526
dynamic = [
26-
"version",
2727
"readme",
28+
"version",
2829
]
2930
dependencies = [
3031
"numpy",
3132
]
32-
[project.optional-dependencies]
33-
iris = ["scitools-iris"]
34-
xarray = ["xarray"]
35-
[project.urls]
36-
documentation = "https://ajdawson.github.io/eofs"
37-
homepage = "https://github.com/ajdawson/eofs"
38-
repository = "https://github.com/ajdawson/eofs"
33+
optional-dependencies.iris = [
34+
"scitools-iris",
35+
]
36+
optional-dependencies.xarray = [
37+
"xarray",
38+
]
39+
urls.documentation = "https://ajdawson.github.io/eofs"
40+
urls.homepage = "https://github.com/ajdawson/eofs"
41+
urls.repository = "https://github.com/ajdawson/eofs"
3942

4043
[tool.setuptools]
41-
license-files = ["COPYING"]
44+
license-files = [ "COPYING" ]
4245
include-package-data = true
4346
[tool.setuptools.packages.find]
44-
where = ["lib"]
47+
where = [ "lib" ]
4548
[tool.setuptools.package-data]
4649
eofs_examples = [
4750
"example_data/*",
4851
]
49-
eofs_tests = ["data/*"]
52+
eofs_tests = [ "data/*" ]
5053
[tool.setuptools.dynamic]
51-
readme = {file = "README.md", content-type = "text/markdown"}
54+
readme = { file = "README.md", content-type = "text/markdown" }
5255

5356
[tool.setuptools_scm]
5457
write_to = "lib/eofs/_version.py"
5558
write_to_template = "__version__ = '{version}'"
5659
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"
5760

5861
[tool.ruff]
59-
select = [
60-
"E", # pycodecstyle
62+
lint.select = [
63+
"E", # pycodecstyle
6164
]
62-
[tool.ruff.per-file-ignores]
63-
"doc/conf.py" = [
65+
lint.per-file-ignores."doc/conf.py" = [
6466
"E401",
6567
"E402",
6668
]
67-
"doc/devguide/gitwash_dumper.py" = [
68-
"E714",
69-
]
7069

7170
[tool.pytest.ini_options]
7271
addopts = "-vrsx"

0 commit comments

Comments
 (0)