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
2 changes: 1 addition & 1 deletion .github/workflows/gh_pages_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 9 additions & 14 deletions .github/workflows/pace_tests.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 9 additions & 10 deletions .github/workflows/pyshield_tests.yaml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 13 additions & 13 deletions .github/workflows/translate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]

Expand All @@ -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 \
Expand All @@ -82,18 +82,18 @@ 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=pyproject.toml -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: |
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 \
Expand All @@ -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 \
Expand Down
64 changes: 28 additions & 36 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,43 @@ default_language_version:
python: python3

repos:
- repo: https://github.com/psf/black
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
additional_dependencies: ["click==8.0.4"]
- id: black

- repo: https://github.com/pre-commit/mirrors-isort
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
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.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, pyproject.toml]
files: pyFV3
- 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: [--config, setup.cfg]
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]
- id: flake8
name: flake8
language_version: python3
additional_dependencies: [Flake8-pyproject]

- 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"]
82 changes: 41 additions & 41 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions pyfv3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
DryConvectiveAdjustment: Sub-grid dry convective adjustment
DynamicalCore: The FV3 dynamical core
"""

__all__ = [
"DynamicalCoreConfig",
"DycoreState",
"DryConvectiveAdjustment",
"DynamicalCore",
]
2 changes: 2 additions & 0 deletions pyfv3/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
"""
init_analytic_state: Creates dycore state object out of analytic initial conditions
"""

__all__ = ["init_analytic_state"]
34 changes: 34 additions & 0 deletions pyfv3/stencils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Loading