Skip to content
Draft
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
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ repos:
- id: mypy
name: mypy-physics
args: ["--config-file", "pyproject.toml"]
files: pySHiELD
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why mypy never complained because that's a case-sensitive file filter that wasn't updated when the source directory was renamed from pySHiELD to pyshield.

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion examples/notebook/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def states_from_fortran_restarts(
tracer_datafile: Path,
ak: Quantity,
quantity_factory: QuantityFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
dycore_data = xr.open_dataset(dycore_datafile)
phys_data = xr.open_dataset(phys_datafile)
Expand Down
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
use_parentheses = true

[tool.mypy]
exclude = ["tests/conftest.py"]
explicit_package_bases = true
follow_imports = "normal"
ignore_missing_imports = true
namespace_packages = true
strict_optional = false
warn_unreachable = true

[[tool.mypy.overrides]]
ignore_errors = true
module = [
# We currently can't type tracers correctly
"pyshield.stencils.*"
]

[tool.setuptools]
include-package-data = true

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def states_from_fortran_restarts(
quantity_factory: QuantityFactory,
qf_sfc: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_gfdl_cld_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def states_from_fortran_restarts(
ak: Quantity,
quantity_factory: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_gfs_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def states_from_fortran_restarts(
ak: Quantity,
quantity_factory: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_radiation_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def states_from_fortran_restarts(
tracer_datafile: Path,
ak: Quantity,
quantity_factory: QuantityFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
dycore_data = xr.open_dataset(dycore_datafile)
phys_data = xr.open_dataset(phys_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_samfshalconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def states_from_fortran_restarts(
ak: Quantity,
quantity_factory: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_satmedmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def states_from_fortran_restarts(
ak: Quantity,
quantity_factory: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_sfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def states_from_fortran_restarts(
quantity_factory: QuantityFactory,
qf_sfc: QuantityFactory,
stencil_factory: StencilFactory,
schemes: PHYSICS_PACKAGES,
schemes: list[PHYSICS_PACKAGES],
):
pk0inv = (1.0 / physcons.P00) ** constants.KAPPA
dycore_data = xr.open_dataset(dycore_datafile)
Expand Down
Loading