Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benk-mira committed Feb 12, 2024
1 parent 2f262ad commit 0ee8145
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ repos:
hooks:
- id: pyupgrade
args: [--py39-plus]
exclude: plates
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
hooks:
Expand Down
3 changes: 2 additions & 1 deletion plate_simulation/models/plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from __future__ import annotations

from collections.abc import Sequence
from typing import Optional

import numpy as np
from geoapps_utils.transformations import rotate_xyz
Expand Down Expand Up @@ -45,7 +46,7 @@ class Plate(BaseModel):
dip: float = 0.0
azimuth: float = 0.0
reference: str = "center"
_surface: Surface | None = None
_surface: Optional[Surface] = None

@classmethod
def from_params(cls, params: PlateParams):
Expand Down
15 changes: 9 additions & 6 deletions tests/models/plates_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ def test_plate(tmp_path):
500.0,
)
assert (
vertical_striking_north.vertices[:, 0].mean() == plate.center_x
) # pylint: disable=no-member
vertical_striking_north.vertices[:, 0].mean()
== plate.center_x # pylint: disable=no-member
)
assert (
vertical_striking_north.vertices[:, 1].mean() == plate.center_y
) # pylint: disable=no-member
vertical_striking_north.vertices[:, 1].mean()
== plate.center_y # pylint: disable=no-member
)
assert (
vertical_striking_north.vertices[:, 2].mean() == plate.center_z
) # pylint: disable=no-member
vertical_striking_north.vertices[:, 2].mean()
== plate.center_z # pylint: disable=no-member
)

plate = Plate(
name="my other plate",
Expand Down

0 comments on commit 0ee8145

Please sign in to comment.