From 5df509dea67ebbf32513ca5dddea10c14f1afd72 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 15 Jul 2025 11:08:02 -0400 Subject: [PATCH 01/12] Adding back in pyshield tests --- .github/workflows/pyshield_tests.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pyshield_tests.yaml b/.github/workflows/pyshield_tests.yaml index 745e2722..91f8d012 100644 --- a/.github/workflows/pyshield_tests.yaml +++ b/.github/workflows/pyshield_tests.yaml @@ -1,11 +1,10 @@ -# TODO: Reactivate after PR 60 -# name: "pySHiELD translate tests" -# on: -# pull_request: +name: "pySHiELD translate tests" +on: + pull_request: -# jobs: -# pyshield_translate_tests: -# uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop -# with: -# component_trigger: true -# component_name: pyFV3 +jobs: + pyshield_translate_tests: + uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop + with: + component_trigger: true + component_name: pyFV3 From d6b82411a485b5e4db1c5ce75234b9728061c50a Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 15 Jul 2025 12:55:34 -0400 Subject: [PATCH 02/12] New linting tools --- .github/workflows/lint.yaml | 30 ++--- .github/workflows/pyshield_tests.yaml | 2 +- .github/workflows/translate.yaml | 20 ++-- .pre-commit-config.yaml | 80 +++++++------ pyfv3/initialization/init_utils.py | 2 +- .../test_cases/initialize_tc.py | 2 +- pyfv3/stencils/divergence_damping.py | 4 +- pyfv3/stencils/fv_subgridz.py | 2 +- pyfv3/stencils/pk3_halo.py | 2 +- pyfv3/stencils/ppm.py | 4 +- pyfv3/stencils/remap_profile.py | 44 ++----- pyfv3/stencils/saturation_adjustment.py | 9 +- pyproject.toml | 113 ++++++++++++------ .../translate/overrides/baroclinic.yaml | 16 +-- .../translate/overrides/standard.yaml | 72 +++++------ .../translate/translate_tracer2d1l.py | 6 +- 16 files changed, 216 insertions(+), 192 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 06c5a25a..7e790e2f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,21 +6,21 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: '3.11' + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' - - name: Install pre-commit - run: | - pip install pre-commit - - name: Run lint via pre-commit - run: | - pre-commit run --all-files + - name: Install pre-commit + run: | + pip install pre-commit + - name: Run lint via pre-commit + run: | + pre-commit run --all-files - - name: Check advection code consistency - run: | - ./.github/workflows/scripts/ensure_xppm_yppm_consistency.sh + - name: Check advection code consistency + run: | + ./.github/workflows/scripts/ensure_xppm_yppm_consistency.sh diff --git a/.github/workflows/pyshield_tests.yaml b/.github/workflows/pyshield_tests.yaml index 91f8d012..10b8ff19 100644 --- a/.github/workflows/pyshield_tests.yaml +++ b/.github/workflows/pyshield_tests.yaml @@ -4,7 +4,7 @@ on: jobs: pyshield_translate_tests: - uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop + uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop with: component_trigger: true component_name: pyFV3 diff --git a/.github/workflows/translate.yaml b/.github/workflows/translate.yaml index 3a1ee86e..4c01a3a0 100644 --- a/.github/workflows/translate.yaml +++ b/.github/workflows/translate.yaml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 with: submodules: 'recursive' - repository: noaa-gfdl/pyFV3 + repository: noaa-gfdl/pyFV3 path: pyFV3 - name: Checkout hash that triggered CI @@ -43,14 +43,14 @@ jobs: - name: External trigger install NDSL packages if: ${{inputs.component_trigger}} - run: | + run: | cd ${GITHUB_WORKSPACE}/pyFV3 cd NDSL && pip3 install .[test] && cd ../ pip3 install .[test] - name: Install pyFV3 packages if: ${{ ! inputs.component_trigger }} - run : | + run: | cd ${GITHUB_WORKSPACE}/pyFV3 pip install .[ndsl,test] @@ -82,13 +82,13 @@ jobs: - name: Numpy D_SW run: | - cd ${GITHUB_WORKSPACE}/pyFV3 - coverage run --rcfile=setup.cfg -m pytest \ - -v -s --data_path=${{ env.DATA_PATH }} \ - --backend=numpy \ - --which_modules=D_SW \ - --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ - ./tests/savepoint + cd ${GITHUB_WORKSPACE}/pyFV3 + coverage run --rcfile=setup.cfg -m pytest \ + -v -s --data_path=${{ env.DATA_PATH }} \ + --backend=numpy \ + --which_modules=D_SW \ + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ + ./tests/savepoint - name: Numpy Remapping run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5b42407a..f53bdcc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,51 +2,59 @@ default_language_version: python: python3 repos: -- repo: https://github.com/psf/black - rev: 20.8b1 + - repo: https://github.com/psf/black + rev: 25.1.0 hooks: - - id: black - additional_dependencies: ["click==8.0.4"] + - id: black + additional_dependencies: ["click==8.0.4"] -- repo: https://github.com/pre-commit/mirrors-isort + - repo: https://github.com/pre-commit/mirrors-isort rev: v5.4.2 hooks: - - id: isort - args: ["--profile", "black"] + - id: isort + args: ["--profile", "black"] -- repo: https://github.com/pre-commit/mirrors-mypy + - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.4.1 hooks: - - id: mypy - name: mypy-fv3core - args: [--config-file, setup.cfg] - additional_dependencies: [types-PyYAML] - files: pyFV3 - exclude: | - (?x)^( - pyFV3/stencils/fv_subgridz.py | - pyFV3/tests/conftest.py - )$ -- repo: https://github.com/pre-commit/pre-commit-hooks + - id: mypy + name: mypy-fv3core + args: ["--config-file", "pyproject.toml"] + additional_dependencies: [types-PyYAML] + files: pyFV3 + exclude: | + (?x)^( + pyFV3/stencils/fv_subgridz.py | + pyFV3/tests/conftest.py + )$ + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - - id: check-toml - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace -- repo: https://github.com/pycqa/flake8 + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/flake8 rev: 3.9.2 hooks: - - id: flake8 - name: flake8 - language_version: python3 - args: [--config, setup.cfg] - exclude: | - (?x)^( - .*/__init__.py | - )$ - - id: flake8 - name: flake8 __init__.py files - files: "__init__.py" + - id: flake8 + name: flake8 + language_version: python3 + args: ["--ignore=F401,E203,E501,F841,W503,E704"] + exclude: | + (?x)^( + .*/__init__.py | + )$ + - id: flake8 + name: flake8 __init__.py files + files: "__init__.py" # ignore unused import error in __init__.py files - args: ["--ignore=F401,E203", --config, setup.cfg] + args: ["--ignore=F401,E203,E501"] + + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.15.0 + hooks: + - id: pretty-format-toml + args: [--autofix, --indent, "2"] + - id: pretty-format-yaml + args: [--autofix, --preserve-quotes, --indent, "2", --offset, "2"] diff --git a/pyfv3/initialization/init_utils.py b/pyfv3/initialization/init_utils.py index 7c500cf7..761d21c8 100644 --- a/pyfv3/initialization/init_utils.py +++ b/pyfv3/initialization/init_utils.py @@ -208,7 +208,7 @@ def initialize_kappa_pressures(pe, peln, ptop): """ pk = np.zeros(pe.shape) pkz = np.zeros(pe.shape) - pk[:, :, 0] = ptop ** constants.KAPPA + pk[:, :, 0] = ptop**constants.KAPPA pk[:, :, 1:] = np.exp(constants.KAPPA * np.log(pe[:, :, 1:])) pkz[:, :, :-1] = (pk[:, :, 1:] - pk[:, :, :-1]) / ( constants.KAPPA * (peln[:, :, 1:] - peln[:, :, :-1]) diff --git a/pyfv3/initialization/test_cases/initialize_tc.py b/pyfv3/initialization/test_cases/initialize_tc.py index 8dac18c2..2c3d48ad 100644 --- a/pyfv3/initialization/test_cases/initialize_tc.py +++ b/pyfv3/initialization/test_cases/initialize_tc.py @@ -15,7 +15,7 @@ def _calculate_distance_from_tc_center(pe_v, ps_v, muv, calc, tc_properties): muv["midpoint"][:, :, 0] - calc["p0"][0] ) d2 = np.cos(calc["p0"][1]) * np.sin(muv["midpoint"][:, :, 0] - calc["p0"][0]) - d = np.sqrt(d1 ** 2 + d2 ** 2) + d = np.sqrt(d1**2 + d2**2) d[d < 1e-15] = 1e-15 r = great_circle_distance_lon_lat( diff --git a/pyfv3/stencils/divergence_damping.py b/pyfv3/stencils/divergence_damping.py index d1f2fff7..9e4d8c10 100644 --- a/pyfv3/stencils/divergence_damping.py +++ b/pyfv3/stencils/divergence_damping.py @@ -246,7 +246,7 @@ def smagorinsky_diffusion_approx(delpc: FloatField, vort: FloatField, absdt: Flo absdt (in): abs(dt) """ with computation(PARALLEL), interval(...): - vort = absdt * (delpc ** 2.0 + vort ** 2.0) ** 0.5 + vort = absdt * (delpc**2.0 + vort**2.0) ** 0.5 def smag_corner( @@ -290,7 +290,7 @@ def smag_corner( wk = rarea * (vt2 - vt2[0, 1, 0] + ut2 - ut2[1, 0, 0]) shear = doubly_periodic_a2b_ord4(wk) - smag_c = dt * sqrt(shear ** 2 + smag_c_t ** 2) + smag_c = dt * sqrt(shear**2 + smag_c_t**2) class DivergenceDamping: diff --git a/pyfv3/stencils/fv_subgridz.py b/pyfv3/stencils/fv_subgridz.py index a186bbcf..9090da16 100644 --- a/pyfv3/stencils/fv_subgridz.py +++ b/pyfv3/stencils/fv_subgridz.py @@ -59,7 +59,7 @@ def standard_cm(cpm, cvm, q0_vapor, q0_liquid, q0_rain, q0_ice, q0_snow, q0_grau @gtfunction def tvol(gz, u0, v0, w0): - return gz + 0.5 * (u0 ** 2 + v0 ** 2 + w0 ** 2) + return gz + 0.5 * (u0**2 + v0**2 + w0**2) def init( diff --git a/pyfv3/stencils/pk3_halo.py b/pyfv3/stencils/pk3_halo.py index a031be2d..83234363 100644 --- a/pyfv3/stencils/pk3_halo.py +++ b/pyfv3/stencils/pk3_halo.py @@ -28,7 +28,7 @@ def edge_pe_update( region[local_is - 2 : local_ie + 3, local_je + 1 : local_je + 3], ): pe = pe + delp[0, 0, -1] - pk3 = pe ** akap + pk3 = pe**akap class PK3Halo: diff --git a/pyfv3/stencils/ppm.py b/pyfv3/stencils/ppm.py index 870eea7c..ccde252b 100644 --- a/pyfv3/stencils/ppm.py +++ b/pyfv3/stencils/ppm.py @@ -21,7 +21,7 @@ def pert_ppm_standard_constraint_fcn(a0: FloatField, al: FloatField, ar: FloatField): if al * ar < 0.0: da1 = al - ar - da2 = da1 ** 2 + da2 = da1**2 a6da = 3.0 * (al + ar) * da1 if a6da < -da2: ar = -2.0 * al @@ -45,7 +45,7 @@ def pert_ppm_positive_definite_constraint_fcn( a4 = -3.0 * (ar + al) da1 = ar - al if abs(da1) < -a4: - fmin = a0 + 0.25 / a4 * da1 ** 2 + a4 * (1.0 / 12.0) + fmin = a0 + 0.25 / a4 * da1**2 + a4 * (1.0 / 12.0) if fmin < 0.0: if ar > 0.0 and al > 0.0: ar = 0.0 diff --git a/pyfv3/stencils/remap_profile.py b/pyfv3/stencils/remap_profile.py index 2c213d20..8019d382 100644 --- a/pyfv3/stencils/remap_profile.py +++ b/pyfv3/stencils/remap_profile.py @@ -37,9 +37,7 @@ def constrain_interior(q, gam, a4): return ( limit_both(q, a4) if (gam[0, 0, -1] * gam[0, 0, 1] > 0.0) - else limit_maxmin(q, a4) - if (gam[0, 0, -1] > 0.0) - else limit_minmax(q, a4) + else limit_maxmin(q, a4) if (gam[0, 0, -1] > 0.0) else limit_minmax(q, a4) ) @@ -402,17 +400,13 @@ def set_interpolation_coefficients( tmp_min = ( a4_1 if (a4_1 < pmp_1) and (a4_1 < lac_1) - else pmp_1 - if pmp_1 < lac_1 - else lac_1 + else pmp_1 if pmp_1 < lac_1 else lac_1 ) tmp_max0 = a4_2 if a4_2 > tmp_min else tmp_min tmp_max = ( a4_1 if (a4_1 > pmp_1) and (a4_1 > lac_1) - else pmp_1 - if pmp_1 > lac_1 - else lac_1 + else pmp_1 if pmp_1 > lac_1 else lac_1 ) a4_2 = tmp_max0 if tmp_max0 < tmp_max else tmp_max # right edges? @@ -421,17 +415,13 @@ def set_interpolation_coefficients( tmp_min = ( a4_1 if (a4_1 < pmp_2) and (a4_1 < lac_2) - else pmp_2 - if pmp_2 < lac_2 - else lac_2 + else pmp_2 if pmp_2 < lac_2 else lac_2 ) tmp_max0 = a4_3 if a4_3 > tmp_min else tmp_min tmp_max = ( a4_1 if (a4_1 > pmp_2) and (a4_1 > lac_2) - else pmp_2 - if pmp_2 > lac_2 - else lac_2 + else pmp_2 if pmp_2 > lac_2 else lac_2 ) a4_3 = tmp_max0 if tmp_max0 < tmp_max else tmp_max a4_4 = 3.0 * (2.0 * a4_1 - (a4_2 + a4_3)) @@ -458,33 +448,25 @@ def set_interpolation_coefficients( tmp_min = ( a4_1 if (a4_1 < pmp_1) and (a4_1 < lac_1) - else pmp_1 - if pmp_1 < lac_1 - else lac_1 + else pmp_1 if pmp_1 < lac_1 else lac_1 ) tmp_max0 = a4_2 if a4_2 > tmp_min else tmp_min tmp_max = ( a4_1 if (a4_1 > pmp_1) and (a4_1 > lac_1) - else pmp_1 - if pmp_1 > lac_1 - else lac_1 + else pmp_1 if pmp_1 > lac_1 else lac_1 ) a4_2 = tmp_max0 if tmp_max0 < tmp_max else tmp_max tmp_min = ( a4_1 if (a4_1 < pmp_2) and (a4_1 < lac_2) - else pmp_2 - if pmp_2 < lac_2 - else lac_2 + else pmp_2 if pmp_2 < lac_2 else lac_2 ) tmp_max0 = a4_3 if a4_3 > tmp_min else tmp_min tmp_max = ( a4_1 if (a4_1 > pmp_2) and (a4_1 > lac_2) - else pmp_2 - if pmp_2 > lac_2 - else lac_2 + else pmp_2 if pmp_2 > lac_2 else lac_2 ) a4_3 = tmp_max0 if tmp_max0 < tmp_max else tmp_max a4_4 = 6.0 * a4_1 - 3.0 * (a4_2 + a4_3) @@ -499,16 +481,12 @@ def set_interpolation_coefficients( tmp_min2 = ( a4_1 if (a4_1 < pmp_1) and (a4_1 < lac_1) - else pmp_1 - if pmp_1 < lac_1 - else lac_1 + else pmp_1 if pmp_1 < lac_1 else lac_1 ) tmp_max2 = ( a4_1 if (a4_1 > pmp_1) and (a4_1 > lac_1) - else pmp_1 - if pmp_1 > lac_1 - else lac_1 + else pmp_1 if pmp_1 > lac_1 else lac_1 ) tmp2 = a4_2 if a4_2 > tmp_min2 else tmp_min2 tmp_min3 = a4_1 if a4_1 < pmp_2 else pmp_2 diff --git a/pyfv3/stencils/saturation_adjustment.py b/pyfv3/stencils/saturation_adjustment.py index 32f375fc..b4e4009f 100644 --- a/pyfv3/stencils/saturation_adjustment.py +++ b/pyfv3/stencils/saturation_adjustment.py @@ -256,7 +256,7 @@ def heterogeneous_freezing( ): tc = constants.TICE0 - pt1 if ql > 0.0 and tc > 0.0: - sink = 3.3333e-10 * dt_bigg * (exptc - 1.0) * den * ql ** 2 + sink = 3.3333e-10 * dt_bigg * (exptc - 1.0) * den * ql**2 sink = min(ql, sink) sink = min(sink, tc / icp2) ql = ql - sink @@ -354,10 +354,7 @@ def sublimation( * 349138.78 * expsubl / ( - iqs2 - * den - * constants.LAT2 - / (0.0243 * constants.RVGAS * pt1 ** 2.0) + iqs2 * den * constants.LAT2 / (0.0243 * constants.RVGAS * pt1**2.0) + 4.42478e4 ) ) @@ -892,7 +889,7 @@ def satadjust( mindw = min(1.0, abs(hs) / (10.0 * constants.GRAV)) dw = dw_ocean + (dw_land - dw_ocean) * mindw # "scale - aware" subgrid variability: 100 - km as the base - dbl_sqrt_area = dw * (area ** 0.5 / 100.0e3) ** 0.5 + dbl_sqrt_area = dw * (area**0.5 / 100.0e3) ** 0.5 maxtmp = max(0.01, dbl_sqrt_area) hvar = min(0.2, maxtmp) # partial cloudiness by pdf: diff --git a/pyproject.toml b/pyproject.toml index b8954c79..7923154d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,57 +1,98 @@ [build-system] -requires = ["setuptools >= 64"] build-backend = "setuptools.build_meta" +requires = ["setuptools >= 77.0.3"] [project] -name = "pyfv3" -version = "0.2.0" +authors = [{name = "NOAA - Geophysical Fluid Dynamics Laboratory", email = "oliver.elbert@noaa.gov"}] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11" +] dependencies = [ - "f90nml>=1.1.0", - "numpy==1.26.4", - "xarray", + "f90nml>=1.1.0", + "numpy==1.26.4", + "xarray" ] -requires-python = ">=3.11,<3.12" -authors = [{name = "NOAA - Geophysical Fluid Dynamics Laboratory", email = "oliver.elbert@noaa.gov"}] description = "PyFV3 is a NDSL-based FV3 dynamical core for atmospheric models." +license = "Apache-2.0" +license-files = ["LICENSE.md"] +name = "pyfv3" readme = "README.md" -license = {file = "LICENSE.md"} -classifiers = [ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", -] +requires-python = ">=3.11,<3.12" +version = "0.2.0" [project.optional-dependencies] -test = [ - "coverage", - "pytest", - "pytest-subtests", - "serialbox", -] -ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@develop"] -develop = [ - "pyfv3[test]", - "pyfv3[ndsl]", - "pre-commit", +dev = [ + "pyfv3[test]", + "pyfv3[ndsl]", + "pre-commit" ] extras = [ - "pyfv3[test]", - "pyfv3[ndsl]", - "pyfv3[develop]", + "pyfv3[test]", + "pyfv3[ndsl]", + "pyfv3[develop]", + "flake8-pyproject" +] +ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@develop"] +test = [ + "coverage", + "pytest", + "pytest-subtests", + "serialbox" ] [project.urls] Repository = "https://github.com/NOAA-GFDL/pyFV3" -[tool.setuptools.packages.find] -include = ["pyfv3", "pyfv3.*"] +[tool.aliases] + +[tool.black] +line-length = 88 +target_version = ['py311'] + +[tool.bumpversion] +commit = "True" +current_version = "0.2.0" + +[tool.coverage.run] +branch = true +omit = ["tests/*", "*gt_cache*", ".dacecache*", "external/*", "__init__.py"] +parallel = true +source_pkgs = ["pyfv3"] + +[tool.disutils.bdist_wheel] +universal = 1 + +[tool.flake8] +exclude = ["docs"] +extend-ignore = ["W503", "E302", "E203", "F841"] +max-line-length = 88 + +[tool.isort] +default_section = "THIRDPARTY" +force_grid_wrap = 0 +include_trailing_comma = true +known_first_party = "pyfv3,ndsl,pyshield" +known_third_party = "f90nml,pytest,xarray,numpy,mpi4py,gt4py" +line_length = 88 +lines_after_imports = 2 +multi_line_output = 3 +sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER" +use_parentheses = true + +[tool.mypy] +explicit_package_bases = true +follow_imports = "normal" +ignore_missing_imports = true +namespace_packages = true +strict_optional = false +warn_unreachable = true [tool.setuptools] include-package-data = true -[tool.black] -line-length = 88 -target_version = ['py38'] +[tool.setuptools.packages.find] +include = ["pyfv3", "pyfv3.*"] diff --git a/tests/savepoint/translate/overrides/baroclinic.yaml b/tests/savepoint/translate/overrides/baroclinic.yaml index 2b288372..a2b17526 100644 --- a/tests/savepoint/translate/overrides/baroclinic.yaml +++ b/tests/savepoint/translate/overrides/baroclinic.yaml @@ -32,24 +32,24 @@ DivergenceDamping: delpc: 1e-15 DivgDel6: - - max_error: 3e-12 # 48_6ranks + - max_error: 3e-12 # 48_6ranks DxDy: - - max_error: 6e-13 # 48_6ranks + - max_error: 6e-13 # 48_6ranks EdgeFactors: - - max_error: 3e-11 # 48_6ranks + - max_error: 3e-11 # 48_6ranks DerivedTrig: - - max_error: 2e-9 # 192_6ranks + - max_error: 2e-9 # 192_6ranks GridGrid: - - max_error: 2e-11 # 192_6ranks + - max_error: 2e-11 # 192_6ranks InitGridUtils: - - max_error: 5e-6 # 48_6ranks - near_zero: 5e-8 - ignore_near_zero_errors: + - max_error: 5e-6 # 48_6ranks + near_zero: 5e-8 + ignore_near_zero_errors: - l2c_v - l2c_u - ee1 diff --git a/tests/savepoint/translate/overrides/standard.yaml b/tests/savepoint/translate/overrides/standard.yaml index 4b9994e3..f6dd1baa 100644 --- a/tests/savepoint/translate/overrides/standard.yaml +++ b/tests/savepoint/translate/overrides/standard.yaml @@ -121,62 +121,62 @@ FVSubgridZ: max_error: 1e-8 DynCore: - - backend: gt:gpu - ignore_near_zero_errors: - - wsd - - backend: cuda - ignore_near_zero_errors: - - wsd - - backend: dace:cpu - ignore_near_zero_errors: - - wsd - - backend: dace:gpu - ignore_near_zero_errors: - - wsd + - backend: gt:gpu + ignore_near_zero_errors: + - wsd + - backend: cuda + ignore_near_zero_errors: + - wsd + - backend: dace:cpu + ignore_near_zero_errors: + - wsd + - backend: dace:gpu + ignore_near_zero_errors: + - wsd Tracer2D1L: - - backend: gt:gpu - max_error: 1e-9 - - backend: cuda - max_error: 1e-9 - - backend: dace:cpu - ignore_near_zero_errors: - tracers: 1e-9 - - backend: dace:gpu - ignore_near_zero_errors: - tracers: 1e-9 - - backend: gt:cpu_ifirst - ignore_near_zero_errors: - tracers: 1e-15 + - backend: gt:gpu + max_error: 1e-9 + - backend: cuda + max_error: 1e-9 + - backend: dace:cpu + ignore_near_zero_errors: + tracers: 1e-9 + - backend: dace:gpu + ignore_near_zero_errors: + tracers: 1e-9 + - backend: gt:cpu_ifirst + ignore_near_zero_errors: + tracers: 1e-15 DivgDel6: - - max_error: 3e-13 # 48_6ranks + - max_error: 3e-13 # 48_6ranks DxDy: - - max_error: 2e-13 # 48_6ranks + - max_error: 2e-13 # 48_6ranks EdgeFactors: - - max_error: 2e-12 # 48_6ranks + - max_error: 2e-12 # 48_6ranks DerivedTrig: - - max_error: 2e-11 # 48_6ranks + - max_error: 2e-11 # 48_6ranks GridAreas: - - max_error: 9e-12 # 48_6ranks + - max_error: 9e-12 # 48_6ranks GridGrid: - - max_error: 6e-13 # 48_6ranks + - max_error: 6e-13 # 48_6ranks InitGrid: - - max_error: 7e-12 # 48_6ranks + - max_error: 7e-12 # 48_6ranks InitGridUtils: - - max_error: 2e-7 # 48_6ranks - near_zero: 2e-13 + - max_error: 2e-7 # 48_6ranks + near_zero: 2e-13 InitCubedtoLatLon: - - max_error: 9e-13 # 48_6ranks - platform: metal + - max_error: 9e-13 # 48_6ranks + platform: metal TrigSg: - max_error: 2e-7 # 48_6ranks diff --git a/tests/savepoint/translate/translate_tracer2d1l.py b/tests/savepoint/translate/translate_tracer2d1l.py index 5f89a4e8..48759417 100644 --- a/tests/savepoint/translate/translate_tracer2d1l.py +++ b/tests/savepoint/translate/translate_tracer2d1l.py @@ -77,9 +77,9 @@ def compute_parallel(self, inputs, communicator): inputs["mfyd"] = inputs.pop("y_mass_flux") inputs["cxd"] = inputs.pop("x_courant") inputs["cyd"] = inputs.pop("y_courant") - inputs[ - "tracers" - ] = all_tracers # some aren't advected, still need to be validated + inputs["tracers"] = ( + all_tracers # some aren't advected, still need to be validated + ) # need to convert tracers dict to [x, y, z, n_tracer] array before subsetting outputs = self._base.slice_output(inputs) outputs["tracers"] = self.subset_output("tracers", outputs["tracers"]) From 4c95d9e529008ff50dde54b7a8dccdc8432a95a8 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 15 Jul 2025 13:42:57 -0400 Subject: [PATCH 03/12] Activating Pace unit tests --- .github/workflows/pace_tests.yaml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pace_tests.yaml b/.github/workflows/pace_tests.yaml index 8819f93b..ce13a8cc 100644 --- a/.github/workflows/pace_tests.yaml +++ b/.github/workflows/pace_tests.yaml @@ -1,15 +1,10 @@ -# TODO: Re-activate after PR 60 -# TODO: Temporarily removing tests due to dependent changes in -# Pace#129, PyFV3#64 PRs; tests should be reverted back after -# these PRs are merged. +name: "pace main tests" +on: + pull_request: -# name: "pace main tests" -# on: -# pull_request: - -# jobs: -# pace_main_tests: -# uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop -# with: -# component_trigger: true -# component_name: pyFV3 +jobs: + pace_main_tests: + uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop + with: + component_trigger: true + component_name: pyFV3 From 0e4a18c8bbe7ca04a5cc65e57dbe9d774f076ff4 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 15 Jul 2025 13:55:03 -0400 Subject: [PATCH 04/12] Removing setup.cfg --- .pre-commit-config.yaml | 8 +++---- setup.cfg | 49 ----------------------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f53bdcc1..031017ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,13 @@ repos: additional_dependencies: ["click==8.0.4"] - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.4.2 + rev: v5.10.1 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 + rev: v1.17.0 hooks: - id: mypy name: mypy-fv3core @@ -28,14 +28,14 @@ repos: pyFV3/tests/conftest.py )$ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v5.0.0 hooks: - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 7.3.0 hooks: - id: flake8 name: flake8 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index be4c19e5..00000000 --- a/setup.cfg +++ /dev/null @@ -1,49 +0,0 @@ -[bumpversion] -current_version = 0.2.0 -commit = True - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs -ignore = W503,E302,E203,F841 -max-line-length = 88 - -[aliases] - -[tool:isort] -line_length = 88 -force_grid_wrap = 0 -include_trailing_comma = true -multi_line_output = 3 -use_parentheses = true -lines_after_imports = 2 -default_section = THIRDPARTY -sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER -known_first_party = pyfv3,ndsl,pyshield -known_third_party = f90nml,pytest,xarray,numpy,mpi4py,gt4py - -[mypy] -ignore_missing_imports = True -follow_imports = normal -namespace_packages = True -strict_optional = False -warn_unreachable = True -explicit_package_bases = True - -[coverage:run] -parallel = true -branch = true -omit = - tests/* - *gt_cache* - .dacecache* - external/* - __init__.py -source_pkgs = pyfv3 - -[metadata] -# Include the license file in the generated wheel, see -# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file -license_files = LICENSE.md From bb71cb84b51620159460b62b9eab5aab1216f4c8 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 15 Jul 2025 15:18:03 -0400 Subject: [PATCH 05/12] Fixing translate test workflow --- .github/workflows/translate.yaml | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/translate.yaml b/.github/workflows/translate.yaml index 4c01a3a0..07b156c1 100644 --- a/.github/workflows/translate.yaml +++ b/.github/workflows/translate.yaml @@ -73,7 +73,7 @@ jobs: - name: NumPy FvTp2d run: | cd ${GITHUB_WORKSPACE}/pyFV3 - coverage run --rcfile=setup.cfg -m pytest \ + coverage run --rcfile=pyproject.toml -m pytest \ -v -s --data_path=${{ env.DATA_PATH }} \ --backend=numpy \ --which_modules=FvTp2d \ @@ -83,7 +83,7 @@ jobs: - name: Numpy D_SW run: | cd ${GITHUB_WORKSPACE}/pyFV3 - coverage run --rcfile=setup.cfg -m pytest \ + coverage run --rcfile=pyproject.toml -m pytest \ -v -s --data_path=${{ env.DATA_PATH }} \ --backend=numpy \ --which_modules=D_SW \ @@ -93,7 +93,7 @@ jobs: - name: Numpy Remapping run: | cd ${GITHUB_WORKSPACE}/pyFV3 - coverage run --rcfile=setup.cfg -m pytest \ + coverage run --rcfile=pyproject.toml -m pytest \ -v -s --data_path=${{ env.DATA_PATH }} \ --backend=numpy \ --which_modules=Remapping \ @@ -107,7 +107,7 @@ jobs: export PACE_FLOAT_PRECISION=64 export OMP_NUM_THREADS=1 export PACE_LOGLEVEL=Debug - mpiexec -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe coverage run --rcfile=setup.cfg -m mpi4py -m pytest \ + mpiexec -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe coverage run --rcfile=pyproject.toml -m mpi4py -m pytest \ -v -s --data_path=${{ env.DATA_PATH }} \ --backend=dace:cpu \ -m parallel \ diff --git a/pyproject.toml b/pyproject.toml index 7923154d..9bf95e30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dev = [ extras = [ "pyfv3[test]", "pyfv3[ndsl]", - "pyfv3[develop]", + "pyfv3[dev]", "flake8-pyproject" ] ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@develop"] From 4c60be7ac20beadcd23c5e72302757ebdf4433ef Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Wed, 16 Jul 2025 15:34:22 -0400 Subject: [PATCH 06/12] Adding Flake8-pyproject as additional dependency in pre-commit-config.yaml --- .pre-commit-config.yaml | 36 ++++++++++++++++++------------------ pyproject.toml | 25 ++++++++++++------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e24176e..1b39a41a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,39 +17,39 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.17.0 hooks: - - id: mypy - name: mypy-fv3core - args: [--config-file, setup.cfg] - additional_dependencies: [types-PyYAML] - files: pyFV3 - exclude: | - (?x)^( - pyFV3/stencils/fv_subgridz.py | - pyFV3/tests/conftest.py - )$ -- repo: https://github.com/pre-commit/pre-commit-hooks + - id: mypy + name: mypy-fv3core + args: [--config-file, setup.cfg] + additional_dependencies: [types-PyYAML] + files: pyFV3 + exclude: | + (?x)^( + pyFV3/stencils/fv_subgridz.py | + pyFV3/tests/conftest.py + )$ + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - - id: check-toml - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace -- repo: https://github.com/pycqa/flake8 + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/flake8 rev: 7.3.0 hooks: - id: flake8 name: flake8 language_version: python3 - args: ["--ignore=F401,E203,E501,F841,W503,E704"] + additional_dependencies: [Flake8-pyproject] exclude: | (?x)^( .*/__init__.py | )$ - id: flake8 name: flake8 __init__.py files + additional_dependencies: [Flake8-pyproject] files: "__init__.py" # ignore unused import error in __init__.py files - args: ["--ignore=F401,E203,E501"] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.15.0 diff --git a/pyproject.toml b/pyproject.toml index 68aa0074..664e43c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,22 +4,21 @@ requires = ["setuptools >= 77.0.3"] [project] authors = [{name = "NOAA - Geophysical Fluid Dynamics Laboratory", email = "oliver.elbert@noaa.gov"}] -description = "PyFV3 is a NDSL-based FV3 dynamical core for atmospheric models." -readme = "README.md" -license = "Apache-2.0" -license-files = ["LICENSE.md"] classifiers = [ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11" ] dependencies = [ "f90nml>=1.1.0", "numpy==1.26.4", "xarray" ] +description = "PyFV3 is a NDSL-based FV3 dynamical core for atmospheric models." +license = "Apache-2.0" +license-files = ["LICENSE.md"] name = "pyfv3" readme = "README.md" requires-python = ">=3.11,<3.12" @@ -29,13 +28,13 @@ version = "0.2.0" dev = [ "pyfv3[test]", "pyfv3[ndsl]", - "pre-commit" + "pre-commit", + "flake8-pyproject" ] extras = [ "pyfv3[test]", "pyfv3[ndsl]", - "pyfv3[dev]", - "flake8-pyproject" + "pyfv3[dev]" ] ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@develop"] test = [ @@ -69,7 +68,7 @@ universal = 1 [tool.flake8] exclude = ["docs"] -extend-ignore = ["W503", "E302", "E203", "F841"] +extend-ignore = ["W503", "E302", "E203", "F841", "F401"] max-line-length = 88 [tool.isort] From 6681412a8a875417c39c06d6538bfe243a1fa41d Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Thu, 17 Jul 2025 13:09:07 -0400 Subject: [PATCH 07/12] Removing bumpversion tool --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 664e43c6..c9968799 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,10 +53,6 @@ Repository = "https://github.com/NOAA-GFDL/pyFV3" line-length = 88 target_version = ['py311'] -[tool.bumpversion] -commit = "True" -current_version = "0.2.0" - [tool.coverage.run] branch = true omit = ["tests/*", "*gt_cache*", ".dacecache*", "external/*", "__init__.py"] From 63c69aaa466baca181bbc004ec683e0674f59b3c Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Thu, 17 Jul 2025 13:26:36 -0400 Subject: [PATCH 08/12] Removing bdist_wheel universal 1 and using per-file-ignore for __init__.py in pyproject.toml --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c9968799..081448a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,13 +59,11 @@ omit = ["tests/*", "*gt_cache*", ".dacecache*", "external/*", "__init__.py"] parallel = true source_pkgs = ["pyfv3"] -[tool.disutils.bdist_wheel] -universal = 1 - [tool.flake8] exclude = ["docs"] -extend-ignore = ["W503", "E302", "E203", "F841", "F401"] +extend-ignore = ["W503", "E302", "E203", "F841"] max-line-length = 88 +per-file-ignores = "__init__.py: F401" [tool.isort] default_section = "THIRDPARTY" From 5177a0cd0a81b3d93ce0400bd06111f14f71f018 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Mon, 21 Jul 2025 10:33:10 -0400 Subject: [PATCH 09/12] Fixed config file for mypy in .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b39a41a..ce26ca85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: mypy name: mypy-fv3core - args: [--config-file, setup.cfg] + args: [--config-file, pyproject.toml] additional_dependencies: [types-PyYAML] files: pyFV3 exclude: | From f2e050f4071029bd39c54ad1adf0475401245940 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Mon, 21 Jul 2025 15:39:47 -0400 Subject: [PATCH 10/12] Using __all__ to avoid unused import error in __init__ files --- .pre-commit-config.yaml | 16 --------------- pyfv3/__init__.py | 7 +++++++ pyfv3/initialization/__init__.py | 2 ++ pyfv3/stencils/__init__.py | 34 ++++++++++++++++++++++++++++++++ pyfv3/testing/__init__.py | 8 +++++++- pyfv3/wrappers/__init__.py | 3 +++ pyproject.toml | 4 ++-- 7 files changed, 55 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce26ca85..f563b09e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,6 @@ repos: rev: 25.1.0 hooks: - id: black - additional_dependencies: ["click==8.0.4"] - repo: https://github.com/pre-commit/mirrors-isort rev: v5.10.1 @@ -20,13 +19,7 @@ repos: - id: mypy name: mypy-fv3core args: [--config-file, pyproject.toml] - additional_dependencies: [types-PyYAML] files: pyFV3 - exclude: | - (?x)^( - pyFV3/stencils/fv_subgridz.py | - pyFV3/tests/conftest.py - )$ - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: @@ -41,15 +34,6 @@ repos: name: flake8 language_version: python3 additional_dependencies: [Flake8-pyproject] - exclude: | - (?x)^( - .*/__init__.py | - )$ - - id: flake8 - name: flake8 __init__.py files - additional_dependencies: [Flake8-pyproject] - files: "__init__.py" - # ignore unused import error in __init__.py files - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.15.0 diff --git a/pyfv3/__init__.py b/pyfv3/__init__.py index ecd9a134..18f74fb3 100644 --- a/pyfv3/__init__.py +++ b/pyfv3/__init__.py @@ -9,3 +9,10 @@ DryConvectiveAdjustment: Sub-grid dry convective adjustment DynamicalCore: The FV3 dynamical core """ + +__all__ = [ + "DynamicalCoreConfig", + "DycoreState", + "DryConvectiveAdjustment", + "DynamicalCore", +] diff --git a/pyfv3/initialization/__init__.py b/pyfv3/initialization/__init__.py index 89c88247..dec99af7 100644 --- a/pyfv3/initialization/__init__.py +++ b/pyfv3/initialization/__init__.py @@ -4,3 +4,5 @@ """ init_analytic_state: Creates dycore state object out of analytic initial conditions """ + +__all__ = ["init_analytic_state"] diff --git a/pyfv3/stencils/__init__.py b/pyfv3/stencils/__init__.py index 047d2e7f..3eddb220 100644 --- a/pyfv3/stencils/__init__.py +++ b/pyfv3/stencils/__init__.py @@ -63,3 +63,37 @@ XPiecewiseParabolic: Piecewise parabolic method advection in x-direction YPiecewiseParabolic: Piecewise parabolic method advection in y-direction """ + +__all__ = [ + "AGrid2BGridFourthOrder", + "CGridShallowWaterDynamics", + "DGrid2AGrid2CGridVectors", + "DGridShallowWaterLagrangianDynamics", + "HyperdiffusionDamping", + "DelnFlux", + "DelnFluxNoSG", + "DivergenceDamping", + "AcousticDynamics", + "FillNegativeTracerValues", + "DynamicalCore", + "DryConvectiveAdjustment", + "FiniteVolumeTransport", + "FiniteVolumeFluxPrep", + "MapSingle", + "MapNTracer", + "AdjustNegativeTracerMixingRatio", + "NonHydrostaticPressureGradient", + "PK3Halo", + "RayleighDamping", + "RemapProfile", + "LagrangianToEulerian", + "NonhydrostaticVerticalSolver", + "NonhydrostaticVerticalSolverCGrid", + "SatAdjust3d", + "Sim1Solver", + "TracerAdvection", + "UpdateGeopotentialHeightOnCGrid", + "UpdateHeightOnDGrid", + "XPiecewiseParabolic", + "YPiecewiseParabolic", +] diff --git a/pyfv3/testing/__init__.py b/pyfv3/testing/__init__.py index 19aa4c4c..15a378cb 100644 --- a/pyfv3/testing/__init__.py +++ b/pyfv3/testing/__init__.py @@ -1,4 +1,3 @@ -# flake8: noqa: F401 from .translate_dyncore import TranslateDynCore from .translate_fvdynamics import TranslateDycoreFortranData2Py, TranslateFVDynamics from .validation import enable_selective_validation @@ -10,3 +9,10 @@ TranslateFVDynamics: Translate test of acoustic dynamics enable_selective_validation: Allows for selection of data for translate tests """ + +__all__ = [ + "TranslateDynCore", + "TranslateDycoreFortranData2Py", + "TranslateFVDynamics", + "enable_selective_validation", +] diff --git a/pyfv3/wrappers/__init__.py b/pyfv3/wrappers/__init__.py index 21cf9454..733f69cd 100644 --- a/pyfv3/wrappers/__init__.py +++ b/pyfv3/wrappers/__init__.py @@ -1 +1,4 @@ from .geos_wrapper import GeosDycoreWrapper, MemorySpace, StencilBackendCompilerOverride + + +__all__ = ["GeosDycoreWrapper", "MemorySpace", "StencilBackendCompilerOverride"] diff --git a/pyproject.toml b/pyproject.toml index 081448a2..a42ccfbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,9 +61,8 @@ source_pkgs = ["pyfv3"] [tool.flake8] exclude = ["docs"] -extend-ignore = ["W503", "E302", "E203", "F841"] +extend-ignore = ["W503", "E302", "E203", "F841", "E501"] max-line-length = 88 -per-file-ignores = "__init__.py: F401" [tool.isort] default_section = "THIRDPARTY" @@ -78,6 +77,7 @@ sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER" use_parentheses = true [tool.mypy] +exclude = ["pyFV3/stencils/fv_subgridz.py", "pyFV3/tests/conftest.py"] explicit_package_bases = true follow_imports = "normal" ignore_missing_imports = true From 31779a3862e9a2c8661a88713b9c35ddadf65231 Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 22 Jul 2025 10:29:50 -0400 Subject: [PATCH 11/12] Changing exclude in pyproject.toml to use correct case for directory name --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a42ccfbf..50ad87ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER" use_parentheses = true [tool.mypy] -exclude = ["pyFV3/stencils/fv_subgridz.py", "pyFV3/tests/conftest.py"] +exclude = ["pyfv3/stencils/fv_subgridz.py", "tests/conftest.py"] explicit_package_bases = true follow_imports = "normal" ignore_missing_imports = true From bf51aab5d2f07e429386b2be17b80514437063cf Mon Sep 17 00:00:00 2001 From: Frank Malatino Date: Tue, 22 Jul 2025 10:44:10 -0400 Subject: [PATCH 12/12] Linting --- .github/workflows/gh_pages_doc.yml | 2 +- mkdocs.yml | 82 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/gh_pages_doc.yml b/.github/workflows/gh_pages_doc.yml index 22f6c28a..c5128e1a 100644 --- a/.github/workflows/gh_pages_doc.yml +++ b/.github/workflows/gh_pages_doc.yml @@ -26,7 +26,7 @@ jobs: git config user.email github-actions[bot]@users.noreply.github.com - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: 3.x - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - uses: actions/cache@v4 with: diff --git a/mkdocs.yml b/mkdocs.yml index f3f30e7d..e727a0c1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,47 +15,47 @@ plugins: nav: - Home: index.md - Top: - - "_config": top/_config.md - - "dycore_state": top/dycore_state.md - - "version": top/version.md + - "_config": top/_config.md + - "dycore_state": top/dycore_state.md + - "version": top/version.md - Stencils: - - "a2b_ord4": stencils/a2b_ord4.md - - "c_sw": stencils/c_sw.md - - "d2a2c_vect": stencils/d2a2c_vect.md - - "d_sw": stencils/d_sw.md - - "del2cubed": stencils/del2cubed.md - - "delnflux": stencils/delnflux.md - - "divergence_damping": stencils/divergence_damping.md - - "dyn_core": stencils/dyn_core.md - - "fillz": stencils/fillz.md - - "fv_dynamics": stencils/fv_dynamics.md - - "fv_subgridz": stencils/fv_subgridz.md - - "fvtp2d": stencils/fvtp2d.md - - "fxadv": stencils/fxadv.md - - "map_single": stencils/map_single.md - - "mapn_tracer": stencils/mapn_tracer.md - - "moist_cv": stencils/moist_cv.md - - "neg_adj3": stencils/neg_adj3.md - - "nh_p_grad": stencils/nh_p_grad.md - - "pe_halo": stencils/pe_halo.md - - "pk3_halo": stencils/pk3_halo.md - - "ppm": stencils/ppm.md - - "ray_fast": stencils/ray_fast.md - - "remap_profile": stencils/remap_profile.md - - "remapping": stencils/remapping.md - - "riem_solver3": stencils/riem_solver3.md - - "riem_solver_c": stencils/riem_solver_c.md - - "saturation_adjustment": stencils/saturation_adjustment.md - - "sim1_solver": stencils/sim1_solver.md - - "temperature_adjust": stencils/temperature_adjust.md - - "tracer_2d_1l": stencils/tracer_2d_1l.md - - "updatedzc": stencils/updatedzc.md - - "updatedzd": stencils/updatedzd.md - - "xppm": stencils/xppm.md - - "xtp_u": stencils/xtp_u.md - - "yppm": stencils/yppm.md - - "ytp_v": stencils/ytp_v.md + - "a2b_ord4": stencils/a2b_ord4.md + - "c_sw": stencils/c_sw.md + - "d2a2c_vect": stencils/d2a2c_vect.md + - "d_sw": stencils/d_sw.md + - "del2cubed": stencils/del2cubed.md + - "delnflux": stencils/delnflux.md + - "divergence_damping": stencils/divergence_damping.md + - "dyn_core": stencils/dyn_core.md + - "fillz": stencils/fillz.md + - "fv_dynamics": stencils/fv_dynamics.md + - "fv_subgridz": stencils/fv_subgridz.md + - "fvtp2d": stencils/fvtp2d.md + - "fxadv": stencils/fxadv.md + - "map_single": stencils/map_single.md + - "mapn_tracer": stencils/mapn_tracer.md + - "moist_cv": stencils/moist_cv.md + - "neg_adj3": stencils/neg_adj3.md + - "nh_p_grad": stencils/nh_p_grad.md + - "pe_halo": stencils/pe_halo.md + - "pk3_halo": stencils/pk3_halo.md + - "ppm": stencils/ppm.md + - "ray_fast": stencils/ray_fast.md + - "remap_profile": stencils/remap_profile.md + - "remapping": stencils/remapping.md + - "riem_solver3": stencils/riem_solver3.md + - "riem_solver_c": stencils/riem_solver_c.md + - "saturation_adjustment": stencils/saturation_adjustment.md + - "sim1_solver": stencils/sim1_solver.md + - "temperature_adjust": stencils/temperature_adjust.md + - "tracer_2d_1l": stencils/tracer_2d_1l.md + - "updatedzc": stencils/updatedzc.md + - "updatedzd": stencils/updatedzd.md + - "xppm": stencils/xppm.md + - "xtp_u": stencils/xtp_u.md + - "yppm": stencils/yppm.md + - "ytp_v": stencils/ytp_v.md - Utils: - - "functional_validation": utils/functional_validation.md + - "functional_validation": utils/functional_validation.md - Wrappers: - - "geos_wrapper": wrappers/geos_wrapper.md + - "geos_wrapper": wrappers/geos_wrapper.md