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
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Lint"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Pace repository
uses: actions/checkout@v3.5.2
with:
submodules: 'recursive'
- name: Step Python 3.8.12
uses: actions/setup-python@v4.6.0
with:
python-version: '3.8.12'
- name: Install OpenMPI for gt4py
run: |
sudo apt-get install libopenmpi-dev
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt -r requirements_lint.txt
- name: Run lint via pre-commit
run: |
pre-commit run --all-files
27 changes: 27 additions & 0 deletions .github/workflows/main_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Main unit tests"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
main_unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Pace repository
uses: actions/checkout@v3.5.2
with:
submodules: 'recursive'
- name: Step Python 3.8.12
uses: actions/setup-python@v4.6.0
with:
python-version: '3.8.12'
- name: Install OpenMPI for gt4py
run: |
sudo apt-get install libopenmpi-dev
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Run all main tests
run: |
pytest -x tests/main
2 changes: 1 addition & 1 deletion driver/pace/driver/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import click
import yaml

from pace.util.mpi import MPI
from pace.util import pace_log
from pace.util.mpi import MPI

from .driver import Driver, DriverConfig

Expand Down
60 changes: 33 additions & 27 deletions tests/main/fv3core/test_init_from_geos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def test_geos_wrapper():

namelist_dict = {
"stencil_config": {
"compilation_config": {
Expand Down Expand Up @@ -82,7 +81,12 @@ def test_geos_wrapper():
comm = NullComm(rank=0, total_ranks=6, fill_value=0.0)
backend = "numpy"

wrapper = fv3core.GeosDycoreWrapper(namelist, comm, backend)
wrapper = fv3core.GeosDycoreWrapper(
namelist=namelist,
comm=comm,
backend=backend,
bdt=namelist_dict["dt_atmos"],
)
nhalo = 3
shape_centered = (
namelist["nx_tile"] + 2 * nhalo,
Expand Down Expand Up @@ -191,31 +195,33 @@ def test_geos_wrapper():
)
diss_estd = np.ones(shape_centered)

output_dict = wrapper(
u,
v,
w,
delz,
pt,
delp,
q,
ps,
pe,
pk,
peln,
pkz,
phis,
q_con,
omga,
ua,
va,
uc,
vc,
mfxd,
mfyd,
cxd,
cyd,
diss_estd,
timings = {}
output_dict, timings = wrapper(
timings=timings,
u=u,
v=v,
w=w,
delz=delz,
pt=pt,
delp=delp,
q=q,
ps=ps,
pe=pe,
pk=pk,
peln=peln,
pkz=pkz,
phis=phis,
q_con=q_con,
omga=omga,
ua=ua,
va=va,
uc=uc,
vc=vc,
mfxd=mfxd,
mfyd=mfyd,
cxd=cxd,
cyd=cyd,
diss_estd=diss_estd,
)

assert isinstance(output_dict["u"], np.ndarray)
2 changes: 0 additions & 2 deletions tests/main/test_grid_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def test_grid_init_not_decomposition_dependent(rank: int):
assert allclose(metric_terms_1by1.area, metric_terms_3by3.area, partitioner, rank)
assert allclose(metric_terms_1by1.dx, metric_terms_3by3.dx, partitioner, rank)
assert allclose(metric_terms_1by1.dy, metric_terms_3by3.dy, partitioner, rank)
assert allclose(metric_terms_1by1.dxa, metric_terms_3by3.dxa, partitioner, rank)
assert allclose(metric_terms_1by1.dya, metric_terms_3by3.dya, partitioner, rank)
assert allclose(
metric_terms_1by1.cos_sg1, metric_terms_3by3.cos_sg1, partitioner, rank
)
Expand Down
1 change: 0 additions & 1 deletion util/pace/util/monitor/netcdf_monitor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import os
from pathlib import Path
from typing import Any, Dict, List, Optional, Set
Expand Down