diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3096dfb..3d8049d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,6 @@ repos: - id: mypy name: mypy-physics args: ["--config-file", "pyproject.toml"] - files: pySHiELD - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/examples/notebook/utilities.py b/examples/notebook/utilities.py index 4cfe99c..9096026 100644 --- a/examples/notebook/utilities.py +++ b/examples/notebook/utilities.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 0137f59..342314f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,6 @@ 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 @@ -96,6 +95,13 @@ 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 diff --git a/tests/integration/test_all.py b/tests/integration/test_all.py index 80850ad..f6e699f 100644 --- a/tests/integration/test_all.py +++ b/tests/integration/test_all.py @@ -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) diff --git a/tests/integration/test_gfdl_cld_mp.py b/tests/integration/test_gfdl_cld_mp.py index d8f6e61..cb91673 100644 --- a/tests/integration/test_gfdl_cld_mp.py +++ b/tests/integration/test_gfdl_cld_mp.py @@ -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) diff --git a/tests/integration/test_gfs_mp.py b/tests/integration/test_gfs_mp.py index 148ca65..53334af 100644 --- a/tests/integration/test_gfs_mp.py +++ b/tests/integration/test_gfs_mp.py @@ -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) diff --git a/tests/integration/test_radiation_driver.py b/tests/integration/test_radiation_driver.py index 547a118..ca223f1 100644 --- a/tests/integration/test_radiation_driver.py +++ b/tests/integration/test_radiation_driver.py @@ -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) diff --git a/tests/integration/test_samfshalconv.py b/tests/integration/test_samfshalconv.py index 9f43368..04319bc 100644 --- a/tests/integration/test_samfshalconv.py +++ b/tests/integration/test_samfshalconv.py @@ -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) diff --git a/tests/integration/test_satmedmf.py b/tests/integration/test_satmedmf.py index e9468e8..24363c0 100644 --- a/tests/integration/test_satmedmf.py +++ b/tests/integration/test_satmedmf.py @@ -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) diff --git a/tests/integration/test_sfc.py b/tests/integration/test_sfc.py index a2bc105..940f3fd 100644 --- a/tests/integration/test_sfc.py +++ b/tests/integration/test_sfc.py @@ -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)