Skip to content

Commit 668a9e0

Browse files
authored
Merge pull request #180 from MiraGeoscience/GEOPY-2661
GEOPY-2661: remove obsolete mypy plugin for numpy
2 parents 4fd4527 + e3f42a0 commit 668a9e0

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ repos:
1717
# - id: poetry-check
1818
# args: [--no-plugins]
1919
- repo: https://github.com/hadialqattan/pycln
20-
rev: v2.5.0
20+
rev: v2.6.0
2121
hooks:
2222
- id: pycln
2323
args: [--config=pyproject.toml]
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.11.4
25+
rev: v0.15.1
2626
hooks:
27-
- id: ruff
27+
- id: ruff-check
2828
args:
2929
- --fix
3030
- --exit-non-zero-on-fix
3131
# - --unsafe-fixes
3232
- id: ruff-format
3333
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: v1.15.0
34+
rev: v1.19.1
3535
hooks:
3636
- id: mypy
3737
additional_dependencies: [
@@ -71,7 +71,7 @@ repos:
7171
exclude: (-lock\.ya?ml|\benvironments/.*\.ya?ml|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
7272
entry: codespell -I .codespellignore
7373
- repo: https://github.com/pre-commit/pre-commit-hooks
74-
rev: v5.0.0
74+
rev: v6.0.0
7575
hooks:
7676
- id: trailing-whitespace
7777
exclude: \.mdj$
@@ -99,7 +99,7 @@ repos:
9999
exclude_types: [jupyter]
100100
exclude: ^docs/(.*/)?images/
101101
- repo: https://github.com/rstcheck/rstcheck
102-
rev: v6.2.4
102+
rev: v6.2.5
103103
hooks:
104104
- id: rstcheck
105105
exclude: ^THIRD_PARTY_SOFTWARE.rst$

geoapps_utils/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Driver(ABC):
4343
:param params: Application parameters.
4444
"""
4545

46-
_params_class: type[Options | BaseParams]
46+
_params_class: type[Options] | type[BaseParams]
4747
_validations: dict | None = None
4848

4949
def __init__(self, params: Options | BaseParams):
@@ -56,7 +56,7 @@ def params(self):
5656
return self._params
5757

5858
@params.setter
59-
def params(self, val: Options):
59+
def params(self, val: Options | BaseParams):
6060
if not isinstance(val, self._params_class):
6161
raise TypeError(
6262
f"Parameters must be of type {self._params_class}.\n"

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ show_column_numbers = true
176176
check_untyped_defs = true
177177

178178
plugins = [
179-
"numpy.typing.mypy_plugin",
180179
"pydantic.mypy"
181180
]
182181

tests/driver_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_fetch_driver(tmp_path):
188188

189189
# Repeat with missing run_command
190190
del dict_params["run_command"]
191-
with pytest.raises(KeyError, match="'run_command' in ui.json must be a string"):
191+
with pytest.raises(KeyError, match=r"'run_command' in ui\.json must be a string"):
192192
fetch_driver_class(dict_params)
193193

194194
# Repeat with missing driver in module

tests/transformations_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def test_spherical_to_direction_and_dip_upwards(theta, phi, polarity, expected):
8989

9090

9191
def test_spherical_values(tmp_path): # pylint: disable=too-many-locals
92-
theta, phi = np.meshgrid(np.arange(0, 360, 10), np.arange(-90, 90, 10))
93-
theta = theta.flatten()
94-
phi = phi.flatten()
92+
theta_multi, phi_multi = np.meshgrid(np.arange(0, 360, 10), np.arange(-90, 90, 10))
93+
theta = theta_multi.flatten()
94+
phi = phi_multi.flatten()
9595

9696
rad = 100.0
9797
x = rad * np.cos(np.radians(theta)) * np.cos(np.radians(phi))
@@ -211,7 +211,7 @@ def test_cartesian_to_polar():
211211
polar[:, 1], np.rad2deg(azm)
212212
) # All other distances positive
213213

214-
with pytest.raises(ValueError, match="Origin must be an iterable of length 3."):
214+
with pytest.raises(ValueError, match=r"Origin must be an iterable of length 3\."):
215215
_ = cartesian_to_polar(locations, origin=(5.0, "abc"))
216216

217217
# Mean reference locations

tests/uijson_run_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def test_out_group_errors(tmp_path):
212212
def test_utils_errors(tmp_path):
213213
create_uijson(tmp_path)
214214

215-
with pytest.raises(ValueError, match="Invalid ui.json file"):
215+
with pytest.raises(ValueError, match=r"Invalid ui\.json file"):
216216
load_ui_json_as_dict(123) # type: ignore
217217

218218
with pytest.raises(FileExistsError, match="File "):

0 commit comments

Comments
 (0)