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
1 change: 1 addition & 0 deletions examples/notebook/test_physics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
" layout=layout,\n",
" tile_partitioner=partitioner.tile,\n",
" tile_rank=cs_communicator.tile.rank,\n",
" backend=backend,\n",
")\n",
"\n",
"# useful for easily allocating distributed data storages (fields)\n",
Expand Down
4 changes: 3 additions & 1 deletion examples/notebook/test_rad.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"outputs": [],
"source": [
"rank = 0\n",
"backend = \"numpy\"\n",
"\n",
"comm = NullComm(rank, 1)\n",
"communicator = TileCommunicator.from_layout(comm=comm, layout=(1,1))\n",
Expand All @@ -101,8 +102,9 @@
" layout=(1,1),\n",
" tile_partitioner=communicator.partitioner.tile,\n",
" tile_rank=communicator.tile.rank,\n",
" backend=backend\n",
")\n",
"quantity_factory = QuantityFactory(sizer, backend=\"numpy\")"
"quantity_factory = QuantityFactory(sizer, backend=backend)"
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion examples/notebook/test_raddriver.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"outputs": [],
"source": [
"rank = 0\n",
"backend = \"numpy\"\n",
"\n",
"comm = NullComm(rank, 1)\n",
"communicator = TileCommunicator.from_layout(comm=comm, layout=(1,1))\n",
Expand All @@ -87,8 +88,9 @@
" layout=(1,1),\n",
" tile_partitioner=communicator.partitioner.tile,\n",
" tile_rank=communicator.tile.rank,\n",
" backend=backend\n",
")\n",
"quantity_factory = QuantityFactory(sizer, backend=\"numpy\")"
"quantity_factory = QuantityFactory(sizer, backend=backend)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extras = [
"pyshield[pyfv3]",
"pyshield[dev]"
]
ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@develop"]
ndsl = ["ndsl @ git+https://github.com/NOAA-GFDL/NDSL.git@2026.01.00"]
pyfv3 = ["pyfv3 @ git+https://github.com/NOAA-GFDL/PyFV3.git@develop"]
test = [
"pytest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def make_quantity2d(**kwargs):
self._convert_mm_day = 86400.0 * constants.RGRAV / self.config.dt_split

self._copy_stencil = stencil_factory.from_origin_domain(
basic.copy_defn,
basic.copy,
origin=self._idx.origin_compute(),
domain=self._idx.domain_compute(),
)
Expand Down
4 changes: 2 additions & 2 deletions pyshield/stencils/gfdl_cld_microphysics/terminal_fall.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ndsl.constants import X_DIM, Y_DIM, Z_DIM
from ndsl.dsl.gt4py import BACKWARD, FORWARD, PARALLEL, computation, interval
from ndsl.dsl.typing import FloatField, FloatFieldIJ, IntFieldIJ
from ndsl.stencils.basic_operations import copy_defn
from ndsl.stencils.basic_operations import copy
from pyfv3.stencils.remap_profile import RemapProfile
from pyshield.stencils.gfdl_cld_microphysics._config import GFDLCloudMPConfig

Expand Down Expand Up @@ -407,7 +407,7 @@ def __init__(
# compile stencils

self._copy_stencil = stencil_factory.from_dims_halo(
copy_defn,
copy,
compute_dims=dims,
)

Expand Down
4 changes: 2 additions & 2 deletions pyshield/stencils/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from ndsl.grid import GridData
from ndsl.logging import ndsl_log
from ndsl.stencils.basic_operations import copy_defn
from ndsl.stencils.basic_operations import copy
from pyshield._config import (
PHYSICS_PACKAGES,
TRACER_DIM,
Expand Down Expand Up @@ -1242,7 +1242,7 @@ def make_quantity_2d():
self._sfcvisdfd = make_quantity_2d()

self._copy_stencil = stencil_factory.from_origin_domain(
func=copy_defn,
func=copy,
origin=grid_indexing.origin_full(),
domain=grid_indexing.domain_full(add=(0, 0, 1)),
)
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/test_sfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def states_from_fortran_restarts(

def setup_infrastructure(nx: Int, ny: Int, nz: Int, nzsoil: Int, etafile: Path):
n_halo = 3

rank = 0
backend = "numpy"

comm = NullComm(rank, 1)
communicator = TileCommunicator.from_layout(comm=comm, layout=(1, 1))
Expand All @@ -127,8 +127,9 @@ def setup_infrastructure(nx: Int, ny: Int, nz: Int, nzsoil: Int, etafile: Path):
layout=(1, 1),
tile_partitioner=communicator.partitioner.tile,
tile_rank=communicator.tile.rank,
backend=backend,
)
quantity_factory = QuantityFactory(sizer, backend="numpy")
quantity_factory = QuantityFactory(sizer, backend=backend)

soil_sizer = SubtileGridSizer.from_tile_params(
nx_tile=nx,
Expand All @@ -139,6 +140,7 @@ def setup_infrastructure(nx: Int, ny: Int, nz: Int, nzsoil: Int, etafile: Path):
layout=(1, 1),
tile_partitioner=communicator.partitioner.tile,
tile_rank=communicator.tile.rank,
backend=backend,
)
qf_soil = QuantityFactory(soil_sizer, backend="numpy")

Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_atmos_phy_statein.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_cloud_frac.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
10 changes: 10 additions & 0 deletions tests/savepoint/translate/translate_cumulative_shalconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3403,6 +3403,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -3516,6 +3517,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -3621,6 +3623,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -3738,6 +3741,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -3851,6 +3855,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -4018,6 +4023,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -4183,6 +4189,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -4318,6 +4325,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -4379,6 +4387,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -4533,6 +4542,7 @@ def __init__(self, grid, config, stencil_factory):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
2 changes: 2 additions & 0 deletions tests/savepoint/translate/translate_final_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -1491,6 +1492,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_gfs_physics_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def compute(self, inputs):
nz=self.config.npz,
n_halo=3,
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

quantity_factory = QuantityFactory(sizer, backend=self.stencil_factory.backend)
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_mfpblt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def compute(self, inputs):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

quantity_factory = QuantityFactory(sizer, backend=self.stencil_factory.backend)
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_mfscu.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def compute(self, inputs):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

quantity_factory = QuantityFactory(sizer, backend=self.stencil_factory.backend)
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_microphysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def compute(self, inputs):
nz=self.config.npz,
n_halo=3,
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

quantity_factory = QuantityFactory(sizer, backend=self.stencil_factory.backend)
Expand Down
2 changes: 2 additions & 0 deletions tests/savepoint/translate/translate_mp_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down Expand Up @@ -695,6 +696,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_particle_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def __init__(
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

self.quantity_factory = QuantityFactory(
Expand Down
1 change: 1 addition & 0 deletions tests/savepoint/translate/translate_pbl.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def compute(self, inputs):
n_halo=3,
data_dimensions={},
layout=self.config.layout,
backend=self.stencil_factory.backend,
)

quantity_factory = QuantityFactory(sizer, backend=self.stencil_factory.backend)
Expand Down
Loading