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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ repos:
# - id: poetry-check
# args: [--no-plugins]
- repo: https://github.com/hadialqattan/pycln
rev: v2.5.0
rev: v2.6.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.4
rev: v0.15.1
hooks:
- id: ruff
- id: ruff-check
args:
- --fix
- --exit-non-zero-on-fix
# - --unsafe-fixes
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies: [
Expand Down Expand Up @@ -71,7 +71,7 @@ repos:
exclude: (-lock\.ya?ml|\benvironments/.*\.ya?ml|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
entry: codespell -I .codespellignore
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: \.mdj$
Expand Down Expand Up @@ -99,7 +99,7 @@ repos:
exclude_types: [jupyter]
exclude: ^docs/(.*/)?images/
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
rev: v6.2.5
hooks:
- id: rstcheck
exclude: ^THIRD_PARTY_SOFTWARE.rst$
Expand Down
4 changes: 2 additions & 2 deletions geoapps_utils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Driver(ABC):
:param params: Application parameters.
"""

_params_class: type[Options | BaseParams]
_params_class: type[Options] | type[BaseParams]
_validations: dict | None = None

def __init__(self, params: Options | BaseParams):
Expand All @@ -56,7 +56,7 @@ def params(self):
return self._params

@params.setter
def params(self, val: Options):
def params(self, val: Options | BaseParams):
if not isinstance(val, self._params_class):
raise TypeError(
f"Parameters must be of type {self._params_class}.\n"
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ show_column_numbers = true
check_untyped_defs = true

plugins = [
"numpy.typing.mypy_plugin",
"pydantic.mypy"
]

Expand Down
2 changes: 1 addition & 1 deletion tests/driver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_fetch_driver(tmp_path):

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

# Repeat with missing driver in module
Expand Down
8 changes: 4 additions & 4 deletions tests/transformations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def test_spherical_to_direction_and_dip_upwards(theta, phi, polarity, expected):


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

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

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

# Mean reference locations
Expand Down
2 changes: 1 addition & 1 deletion tests/uijson_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_out_group_errors(tmp_path):
def test_utils_errors(tmp_path):
create_uijson(tmp_path)

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

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