From c41b6e395d9f48c578776bda8dea071c3fddd384 Mon Sep 17 00:00:00 2001 From: Florian Deconinck Date: Thu, 1 Feb 2024 16:29:23 -0500 Subject: [PATCH] Linting import orders --- driver/examples/stencil_signatures.py | 4 ++-- driver/pace/driver/configs/comm.py | 1 - driver/pace/driver/diagnostics.py | 1 + driver/pace/driver/driver.py | 6 +++--- driver/pace/driver/grid.py | 1 - driver/pace/driver/initialization.py | 8 ++++---- driver/pace/driver/run.py | 1 - driver/pace/driver/safety_checks.py | 2 +- driver/pace/driver/state.py | 6 +++--- driver/tests/mpi/test_restart.py | 2 +- examples/notebooks/functions.py | 4 ++-- .../examples/standalone/runfile/acoustics.py | 8 ++++---- .../examples/standalone/runfile/compile.py | 2 +- .../examples/standalone/runfile/dynamics.py | 9 +++++---- fv3core/pace/fv3core/_config.py | 1 - fv3core/pace/fv3core/dycore_state.py | 3 +-- .../fv3core/initialization/analytic_init.py | 1 + .../pace/fv3core/initialization/init_utils.py | 4 ++-- .../test_cases/initialize_baroclinic.py | 6 +++--- .../test_cases/initialize_tc.py | 6 +++--- fv3core/pace/fv3core/stencils/a2b_ord4.py | 2 +- .../pace/fv3core/stencils/basic_operations.py | 1 - fv3core/pace/fv3core/stencils/c_sw.py | 2 +- fv3core/pace/fv3core/stencils/d2a2c_vect.py | 2 +- fv3core/pace/fv3core/stencils/d_sw.py | 4 ++-- fv3core/pace/fv3core/stencils/del2cubed.py | 4 ++-- fv3core/pace/fv3core/stencils/delnflux.py | 1 - .../fv3core/stencils/divergence_damping.py | 6 +++--- fv3core/pace/fv3core/stencils/dyn_core.py | 20 +++++++++---------- fv3core/pace/fv3core/stencils/fillz.py | 3 +-- fv3core/pace/fv3core/stencils/fv_dynamics.py | 6 +++--- fv3core/pace/fv3core/stencils/fv_subgridz.py | 4 ++-- fv3core/pace/fv3core/stencils/fvtp2d.py | 4 ++-- fv3core/pace/fv3core/stencils/fxadv.py | 2 +- fv3core/pace/fv3core/stencils/map_single.py | 2 +- fv3core/pace/fv3core/stencils/mapn_tracer.py | 1 + fv3core/pace/fv3core/stencils/moist_cv.py | 3 +-- fv3core/pace/fv3core/stencils/neg_adj3.py | 3 +-- fv3core/pace/fv3core/stencils/nh_p_grad.py | 2 +- fv3core/pace/fv3core/stencils/pe_halo.py | 1 - fv3core/pace/fv3core/stencils/pk3_halo.py | 1 - fv3core/pace/fv3core/stencils/ppm.py | 1 - fv3core/pace/fv3core/stencils/ray_fast.py | 3 +-- .../pace/fv3core/stencils/remap_profile.py | 1 - fv3core/pace/fv3core/stencils/remapping.py | 4 ++-- fv3core/pace/fv3core/stencils/riem_solver3.py | 4 ++-- .../pace/fv3core/stencils/riem_solver_c.py | 4 ++-- .../fv3core/stencils/saturation_adjustment.py | 4 ++-- fv3core/pace/fv3core/stencils/sim1_solver.py | 3 +-- .../fv3core/stencils/temperature_adjust.py | 4 ++-- fv3core/pace/fv3core/stencils/tracer_2d_1l.py | 2 +- fv3core/pace/fv3core/stencils/updatedzc.py | 3 +-- fv3core/pace/fv3core/stencils/updatedzd.py | 4 ++-- fv3core/pace/fv3core/stencils/xppm.py | 2 +- fv3core/pace/fv3core/stencils/xtp_u.py | 2 +- fv3core/pace/fv3core/stencils/yppm.py | 2 +- fv3core/pace/fv3core/stencils/ytp_v.py | 2 +- fv3core/pace/fv3core/testing/map_single.py | 1 + .../pace/fv3core/testing/translate_dyncore.py | 3 ++- .../fv3core/testing/translate_fvdynamics.py | 6 +++--- fv3core/pace/fv3core/testing/validation.py | 4 ++-- .../fv3core/utils/functional_validation.py | 1 - fv3core/pace/fv3core/wrappers/geos_wrapper.py | 2 +- fv3core/tests/mpi/test_doubly_periodic.py | 7 ++++--- .../savepoint/translate/translate_a2b_ord4.py | 1 + .../savepoint/translate/translate_c_sw.py | 1 + .../savepoint/translate/translate_corners.py | 1 + .../translate/translate_d2a2c_vect.py | 1 + .../savepoint/translate/translate_d_sw.py | 4 ++-- .../translate/translate_del2cubed.py | 1 + .../translate/translate_del6vtflux.py | 3 ++- .../savepoint/translate/translate_delnflux.py | 3 ++- .../translate/translate_divergencedamping.py | 1 + .../savepoint/translate/translate_fillz.py | 6 +++--- .../translate/translate_fvsubgridz.py | 3 ++- .../savepoint/translate/translate_fvtp2d.py | 1 + .../savepoint/translate/translate_fxadv.py | 2 +- .../savepoint/translate/translate_grid.py | 3 +-- .../translate/translate_init_case.py | 12 +++++------ .../translate/translate_last_step.py | 3 ++- .../translate/translate_moistcvpluspkz_2d.py | 3 ++- .../translate/translate_moistcvpluspt_2d.py | 4 ++-- .../savepoint/translate/translate_neg_adj3.py | 1 + .../translate/translate_nh_p_grad.py | 3 ++- .../savepoint/translate/translate_pe_halo.py | 1 + .../savepoint/translate/translate_pk3_halo.py | 1 + ...ssureadjustedtemperature_nonhydrostatic.py | 3 ++- .../savepoint/translate/translate_qsinit.py | 6 +++--- .../savepoint/translate/translate_ray_fast.py | 1 + .../translate/translate_remapping.py | 1 + .../translate/translate_riem_solver3.py | 1 + .../translate/translate_riem_solver_c.py | 1 + .../translate/translate_satadjust3d.py | 3 ++- .../translate/translate_tracer2d1l.py | 8 ++++---- .../translate/translate_updatedzc.py | 4 ++-- .../translate/translate_updatedzd.py | 6 +++--- .../savepoint/translate/translate_xppm.py | 1 + .../savepoint/translate/translate_xtp_u.py | 4 ++-- .../savepoint/translate/translate_yppm.py | 1 + .../savepoint/translate/translate_ytp_v.py | 6 +++--- physics/pace/physics/_config.py | 1 - .../physics/functions/microphysics_funcs.py | 3 +-- physics/pace/physics/physics_state.py | 4 ++-- physics/pace/physics/stencils/get_phi_fv3.py | 1 - physics/pace/physics/stencils/get_prs_fv3.py | 1 - physics/pace/physics/stencils/microphysics.py | 6 +++--- physics/pace/physics/stencils/physics.py | 4 ++-- physics/pace/physics/update/fv_update_phys.py | 4 ++-- .../pace/physics/update/update_atmos_state.py | 4 ++-- .../pace/physics/update/update_dwind_phys.py | 1 - .../translate/translate_atmos_phy_statein.py | 4 ++-- .../savepoint/translate/translate_fillgfs.py | 4 ++-- .../translate/translate_fv_update_phys.py | 12 +++++------ .../translate/translate_gfs_physics_driver.py | 4 ++-- .../translate/translate_microphysics.py | 6 +++--- .../savepoint/translate/translate_physics.py | 4 ++-- .../translate/translate_update_dwind_phys.py | 4 ++-- ...ranslate_update_pressure_sfc_winds_phys.py | 2 +- tests/main/driver/test_diagnostics_config.py | 4 ++-- tests/main/driver/test_driver.py | 2 +- tests/main/driver/test_restart_fortran.py | 4 ++-- tests/main/driver/test_restart_serial.py | 4 ++-- tests/main/driver/test_safety_checks.py | 2 +- tests/main/fv3core/test_cartesian_grid.py | 1 - tests/main/fv3core/test_dycore_call.py | 3 ++- tests/main/fv3core/test_grid.py | 1 - tests/main/fv3core/test_init_from_geos.py | 2 +- tests/main/physics/test_integration.py | 4 ++-- tests/main/test_grid_init.py | 1 - .../test_ext_grid/test_external_grid.py | 2 +- tests/mpi_54rank/test_grid_init.py | 4 ++-- tests/savepoint/test_checkpoints.py | 2 +- tests/savepoint/translate/translate_driver.py | 1 + 133 files changed, 218 insertions(+), 212 deletions(-) diff --git a/driver/examples/stencil_signatures.py b/driver/examples/stencil_signatures.py index b23cef99..90712b94 100644 --- a/driver/examples/stencil_signatures.py +++ b/driver/examples/stencil_signatures.py @@ -2,10 +2,10 @@ import inspect from typing import Optional, TextIO -import yaml - import ndsl.dsl import ndsl.util +import yaml + import pace.driver diff --git a/driver/pace/driver/configs/comm.py b/driver/pace/driver/configs/comm.py index bf9c00b7..502f19be 100644 --- a/driver/pace/driver/configs/comm.py +++ b/driver/pace/driver/configs/comm.py @@ -4,7 +4,6 @@ from typing import Any, ClassVar, List import dacite - from ndsl.comm.caching_comm import CachingCommReader, CachingCommWriter from ndsl.comm.mpi import MPIComm from ndsl.comm.null_comm import NullComm diff --git a/driver/pace/driver/diagnostics.py b/driver/pace/driver/diagnostics.py index 5c20a077..6843a6e7 100644 --- a/driver/pace/driver/diagnostics.py +++ b/driver/pace/driver/diagnostics.py @@ -11,6 +11,7 @@ from ndsl.grid import GridData from ndsl.monitor import Monitor, NetCDFMonitor, ZarrMonitor from ndsl.quantity import Quantity + from pace.fv3core.dycore_state import DycoreState from .state import DriverState diff --git a/driver/pace/driver/driver.py b/driver/pace/driver/driver.py index ff295bdb..bd350a4d 100644 --- a/driver/pace/driver/driver.py +++ b/driver/pace/driver/driver.py @@ -8,9 +8,6 @@ import dace import dacite import yaml - -import pace.driver -import pace.physics from ndsl.comm.comm_abc import Comm from ndsl.comm.communicator import ( Communicator, @@ -31,6 +28,9 @@ from ndsl.performance import PerformanceConfig from ndsl.performance.collector import PerformanceCollector from ndsl.performance.timer import Timer + +import pace.driver +import pace.physics from pace import fv3core from pace.driver.safety_checks import SafetyChecker diff --git a/driver/pace/driver/grid.py b/driver/pace/driver/grid.py index 98eaf567..a93e3820 100644 --- a/driver/pace/driver/grid.py +++ b/driver/pace/driver/grid.py @@ -4,7 +4,6 @@ import f90nml import xarray as xr - from ndsl.comm.communicator import Communicator from ndsl.comm.partitioner import get_tile_index from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM diff --git a/driver/pace/driver/initialization.py b/driver/pace/driver/initialization.py index e0322a39..1e6e9b87 100644 --- a/driver/pace/driver/initialization.py +++ b/driver/pace/driver/initialization.py @@ -6,10 +6,6 @@ from typing import Callable, ClassVar, List, Type, TypeVar import f90nml - -import pace.driver -import pace.fv3core.initialization.analytic_init as analytic_init -import pace.physics from ndsl.comm.communicator import Communicator from ndsl.constants import X_DIM, Y_DIM from ndsl.dsl.dace.orchestration import DaceConfig @@ -19,6 +15,10 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.namelist import Namelist from ndsl.stencils.testing import TranslateGrid, grid + +import pace.driver +import pace.fv3core.initialization.analytic_init as analytic_init +import pace.physics from pace import fv3core from pace.fv3core.testing import TranslateFVDynamics diff --git a/driver/pace/driver/run.py b/driver/pace/driver/run.py index a78a14ef..62806fc5 100644 --- a/driver/pace/driver/run.py +++ b/driver/pace/driver/run.py @@ -4,7 +4,6 @@ import click import yaml - from ndsl.logging import AVAILABLE_LOG_LEVELS, ndsl_log from .driver import Driver, DriverConfig diff --git a/driver/pace/driver/safety_checks.py b/driver/pace/driver/safety_checks.py index bac1e996..6c2911ec 100644 --- a/driver/pace/driver/safety_checks.py +++ b/driver/pace/driver/safety_checks.py @@ -1,8 +1,8 @@ from typing import ClassVar, Dict, Optional import numpy as np - from ndsl.quantity import Quantity + from pace.fv3core.dycore_state import DycoreState diff --git a/driver/pace/driver/state.py b/driver/pace/driver/state.py index 7ce65058..136f1f98 100644 --- a/driver/pace/driver/state.py +++ b/driver/pace/driver/state.py @@ -2,10 +2,8 @@ from dataclasses import fields from typing import List -import xarray as xr - import ndsl.dsl.gt4py_utils as gt_utils -import pace.physics +import xarray as xr from ndsl.comm.communicator import Communicator from ndsl.constants import N_HALO_DEFAULT, X_DIM, Y_DIM, Z_DIM from ndsl.dsl.typing import Float @@ -14,6 +12,8 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer from ndsl.quantity import Quantity + +import pace.physics from pace import fv3core diff --git a/driver/tests/mpi/test_restart.py b/driver/tests/mpi/test_restart.py index 58dcda85..99c8e3b1 100644 --- a/driver/tests/mpi/test_restart.py +++ b/driver/tests/mpi/test_restart.py @@ -6,11 +6,11 @@ import yaml import zarr from mpi4py import MPI - from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner from ndsl.quantity import Quantity + from pace.driver import DriverConfig from pace.driver.state import DriverState from pace.physics import PHYSICS_PACKAGES diff --git a/examples/notebooks/functions.py b/examples/notebooks/functions.py index e8ffbb9d..2a797a66 100644 --- a/examples/notebooks/functions.py +++ b/examples/notebooks/functions.py @@ -8,8 +8,6 @@ from fv3viz import pcolormesh_cube from IPython.display import HTML, display from matplotlib import animation -from units_config import units - from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner from ndsl.constants import RADIUS @@ -29,6 +27,8 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer from ndsl.quantity import Quantity +from units_config import units + from pace.fv3core.stencils.fvtp2d import FiniteVolumeTransport from pace.fv3core.stencils.fxadv import FiniteVolumeFluxPrep from pace.fv3core.stencils.tracer_2d_1l import TracerAdvection diff --git a/fv3core/examples/standalone/runfile/acoustics.py b/fv3core/examples/standalone/runfile/acoustics.py index 88e9b7f0..7c673e5b 100755 --- a/fv3core/examples/standalone/runfile/acoustics.py +++ b/fv3core/examples/standalone/runfile/acoustics.py @@ -5,16 +5,16 @@ import click import f90nml -import serialbox -import yaml -from timing import collect_data_and_write_to_file - import ndsl.dsl import ndsl.util as util +import serialbox +import yaml from ndsl.comm.null_comm import NullComm from ndsl.dsl.dace.orchestration import DaceConfig from ndsl.dsl.stencil import CompilationConfig from ndsl.stencils.testing.grid import Grid +from timing import collect_data_and_write_to_file + from pace.fv3core._config import DynamicalCoreConfig from pace.fv3core.stencils.dyn_core import AcousticDynamics from pace.fv3core.testing import TranslateDynCore diff --git a/fv3core/examples/standalone/runfile/compile.py b/fv3core/examples/standalone/runfile/compile.py index 073f8ce1..ce72a88c 100755 --- a/fv3core/examples/standalone/runfile/compile.py +++ b/fv3core/examples/standalone/runfile/compile.py @@ -7,9 +7,9 @@ import f90nml import gt4py.cartesian.config - import ndsl.dsl.stencil # noqa: F401 from ndsl.comm.null_comm import NullComm + from pace.fv3core._config import DynamicalCoreConfig diff --git a/fv3core/examples/standalone/runfile/dynamics.py b/fv3core/examples/standalone/runfile/dynamics.py index 1f28cd2d..b23a3fc4 100755 --- a/fv3core/examples/standalone/runfile/dynamics.py +++ b/fv3core/examples/standalone/runfile/dynamics.py @@ -9,22 +9,23 @@ from typing import Any, Dict, List, Tuple import f90nml -import numpy as np -import xarray as xr -import yaml -from mpi4py import MPI # NOTE: we need to import dsl.stencil prior to # ndsl.util, otherwise xarray precedes gt4py, causing # very strange errors on some systems (e.g. daint) import ndsl.dsl.stencil import ndsl.util as util +import numpy as np +import xarray as xr +import yaml +from mpi4py import MPI from ndsl.comm.null_comm import NullComm from ndsl.dsl import StencilFactory from ndsl.dsl.dace.orchestration import DaceConfig from ndsl.grid import DampingCoefficients, GridData, MetricTerms from ndsl.stencils.testing import dataset_to_dict from ndsl.stencils.testing.grid import Grid + from pace.fv3core import DynamicalCore, DynamicalCoreConfig from pace.fv3core.dycore_state import DycoreState from pace.fv3core.initialization.baroclinic import init_baroclinic_state diff --git a/fv3core/pace/fv3core/_config.py b/fv3core/pace/fv3core/_config.py index 1fb5476a..127ce3d8 100644 --- a/fv3core/pace/fv3core/_config.py +++ b/fv3core/pace/fv3core/_config.py @@ -2,7 +2,6 @@ from typing import Optional, Tuple import f90nml - from ndsl.namelist import Namelist, NamelistDefaults diff --git a/fv3core/pace/fv3core/dycore_state.py b/fv3core/pace/fv3core/dycore_state.py index bcce7197..f90a3d88 100644 --- a/fv3core/pace/fv3core/dycore_state.py +++ b/fv3core/pace/fv3core/dycore_state.py @@ -1,9 +1,8 @@ from dataclasses import asdict, dataclass, field, fields from typing import Any, Dict, Mapping, Union -import xarray as xr - import ndsl.dsl.gt4py_utils as gt_utils +import xarray as xr from ndsl.comm.communicator import Communicator from ndsl.constants import ( X_DIM, diff --git a/fv3core/pace/fv3core/initialization/analytic_init.py b/fv3core/pace/fv3core/initialization/analytic_init.py index 12b3bade..f2c2bb98 100644 --- a/fv3core/pace/fv3core/initialization/analytic_init.py +++ b/fv3core/pace/fv3core/initialization/analytic_init.py @@ -4,6 +4,7 @@ from ndsl.grid import GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.utils import MetaEnumStr + from pace.fv3core.dycore_state import DycoreState diff --git a/fv3core/pace/fv3core/initialization/init_utils.py b/fv3core/pace/fv3core/initialization/init_utils.py index 163bd0ce..1032fa7b 100644 --- a/fv3core/pace/fv3core/initialization/init_utils.py +++ b/fv3core/pace/fv3core/initialization/init_utils.py @@ -2,12 +2,12 @@ from dataclasses import fields from types import SimpleNamespace -import numpy as np - import ndsl.constants as constants +import numpy as np from ndsl.dsl.typing import Float from ndsl.grid import lon_lat_midpoint from ndsl.grid.gnomonic import get_lonlat_vect, get_unit_vector_direction + from pace.fv3core.dycore_state import DycoreState diff --git a/fv3core/pace/fv3core/initialization/test_cases/initialize_baroclinic.py b/fv3core/pace/fv3core/initialization/test_cases/initialize_baroclinic.py index c99ea99e..ab98c23b 100644 --- a/fv3core/pace/fv3core/initialization/test_cases/initialize_baroclinic.py +++ b/fv3core/pace/fv3core/initialization/test_cases/initialize_baroclinic.py @@ -1,13 +1,13 @@ import math -import numpy as np - import ndsl.constants as constants import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.initialization.init_utils as init_utils +import numpy as np from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.grid import GridData, great_circle_distance_lon_lat, lon_lat_midpoint from ndsl.initialization.allocator import QuantityFactory + +import pace.fv3core.initialization.init_utils as init_utils from pace.fv3core.dycore_state import DycoreState diff --git a/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py b/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py index cf51d32a..3ffa2abe 100644 --- a/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py +++ b/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py @@ -1,10 +1,10 @@ -import numpy as np - import ndsl.constants as constants -import pace.fv3core.initialization.init_utils as init_utils +import numpy as np from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.grid import GridData, great_circle_distance_lon_lat from ndsl.initialization.allocator import QuantityFactory + +import pace.fv3core.initialization.init_utils as init_utils from pace.fv3core.dycore_state import DycoreState diff --git a/fv3core/pace/fv3core/stencils/a2b_ord4.py b/fv3core/pace/fv3core/stencils/a2b_ord4.py index 45bed4eb..82f8896c 100644 --- a/fv3core/pace/fv3core/stencils/a2b_ord4.py +++ b/fv3core/pace/fv3core/stencils/a2b_ord4.py @@ -10,13 +10,13 @@ sin, sqrt, ) - from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import GridIndexing, StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldI, FloatFieldIJ from ndsl.grid import GridData from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.basic_operations import copy_defn diff --git a/fv3core/pace/fv3core/stencils/basic_operations.py b/fv3core/pace/fv3core/stencils/basic_operations.py index 55307c5c..88376330 100644 --- a/fv3core/pace/fv3core/stencils/basic_operations.py +++ b/fv3core/pace/fv3core/stencils/basic_operations.py @@ -1,6 +1,5 @@ import gt4py.cartesian.gtscript as gtscript from gt4py.cartesian.gtscript import PARALLEL, computation, interval - from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ diff --git a/fv3core/pace/fv3core/stencils/c_sw.py b/fv3core/pace/fv3core/stencils/c_sw.py index 873fea38..3c1a3cb1 100644 --- a/fv3core/pace/fv3core/stencils/c_sw.py +++ b/fv3core/pace/fv3core/stencils/c_sw.py @@ -6,7 +6,6 @@ interval, region, ) - from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory @@ -15,6 +14,7 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity from ndsl.stencils import corners + from pace.fv3core.stencils.d2a2c_vect import DGrid2AGrid2CGridVectors diff --git a/fv3core/pace/fv3core/stencils/d2a2c_vect.py b/fv3core/pace/fv3core/stencils/d2a2c_vect.py index 288a786a..5754919f 100644 --- a/fv3core/pace/fv3core/stencils/d2a2c_vect.py +++ b/fv3core/pace/fv3core/stencils/d2a2c_vect.py @@ -1,6 +1,5 @@ import gt4py.cartesian.gtscript as gtscript from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region - from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory @@ -8,6 +7,7 @@ from ndsl.grid import GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.stencils import corners + from pace.fv3core.stencils.a2b_ord4 import a1, a2, lagrange_x_func, lagrange_y_func diff --git a/fv3core/pace/fv3core/stencils/d_sw.py b/fv3core/pace/fv3core/stencils/d_sw.py index c4fe61fc..a1542f24 100644 --- a/fv3core/pace/fv3core/stencils/d_sw.py +++ b/fv3core/pace/fv3core/stencils/d_sw.py @@ -9,8 +9,6 @@ interval, region, ) - -import pace.fv3core.stencils.delnflux as delnflux from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory @@ -18,6 +16,8 @@ from ndsl.grid import DampingCoefficients, GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + +import pace.fv3core.stencils.delnflux as delnflux from pace.fv3core._config import DGridShallowWaterLagrangianDynamicsConfig from pace.fv3core.stencils.d2a2c_vect import contravariant from pace.fv3core.stencils.delnflux import DelnFluxNoSG diff --git a/fv3core/pace/fv3core/stencils/del2cubed.py b/fv3core/pace/fv3core/stencils/del2cubed.py index 40af5746..55fde9b9 100644 --- a/fv3core/pace/fv3core/stencils/del2cubed.py +++ b/fv3core/pace/fv3core/stencils/del2cubed.py @@ -1,12 +1,12 @@ -from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region - import ndsl.stencils.corners as corners +from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory, get_stencils_with_varied_bounds from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ, cast_to_index3d from ndsl.grid import DampingCoefficients from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.basic_operations import copy_defn diff --git a/fv3core/pace/fv3core/stencils/delnflux.py b/fv3core/pace/fv3core/stencils/delnflux.py index ed975c53..ba617208 100644 --- a/fv3core/pace/fv3core/stencils/delnflux.py +++ b/fv3core/pace/fv3core/stencils/delnflux.py @@ -9,7 +9,6 @@ interval, region, ) - from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory, get_stencils_with_varied_bounds diff --git a/fv3core/pace/fv3core/stencils/divergence_damping.py b/fv3core/pace/fv3core/stencils/divergence_damping.py index 73537f2d..fb28a046 100644 --- a/fv3core/pace/fv3core/stencils/divergence_damping.py +++ b/fv3core/pace/fv3core/stencils/divergence_damping.py @@ -1,4 +1,5 @@ import gt4py.cartesian.gtscript as gtscript +import ndsl.stencils.corners as corners from gt4py.cartesian.gtscript import ( __INLINED, PARALLEL, @@ -8,9 +9,6 @@ region, sqrt, ) - -import ndsl.stencils.corners as corners -import pace.fv3core.stencils.basic_operations as basic from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import dace_inhibitor, orchestrate from ndsl.dsl.stencil import StencilFactory, get_stencils_with_varied_bounds @@ -18,6 +16,8 @@ from ndsl.grid import DampingCoefficients, GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + +import pace.fv3core.stencils.basic_operations as basic from pace.fv3core.stencils.a2b_ord4 import ( AGrid2BGridFourthOrder, doubly_periodic_a2b_ord4, diff --git a/fv3core/pace/fv3core/stencils/dyn_core.py b/fv3core/pace/fv3core/stencils/dyn_core.py index a50e5393..f3de801d 100644 --- a/fv3core/pace/fv3core/stencils/dyn_core.py +++ b/fv3core/pace/fv3core/stencils/dyn_core.py @@ -1,5 +1,6 @@ from typing import Dict, Mapping, Optional +import ndsl.constants as constants from dace.frontend.python.interface import nounroll as dace_nounroll from gt4py.cartesian.gtscript import ( __INLINED, @@ -11,16 +12,6 @@ interval, region, ) - -import ndsl.constants as constants -import pace.fv3core.stencils.basic_operations as basic -import pace.fv3core.stencils.d_sw as d_sw -import pace.fv3core.stencils.nh_p_grad as nh_p_grad -import pace.fv3core.stencils.pe_halo as pe_halo -import pace.fv3core.stencils.ray_fast as ray_fast -import pace.fv3core.stencils.temperature_adjust as temperature_adjust -import pace.fv3core.stencils.updatedzc as updatedzc -import pace.fv3core.stencils.updatedzd as updatedzd from ndsl.checkpointer import Checkpointer, NullCheckpointer from ndsl.comm.communicator import Communicator from ndsl.constants import ( @@ -38,6 +29,15 @@ from ndsl.grid import DampingCoefficients, GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + +import pace.fv3core.stencils.basic_operations as basic +import pace.fv3core.stencils.d_sw as d_sw +import pace.fv3core.stencils.nh_p_grad as nh_p_grad +import pace.fv3core.stencils.pe_halo as pe_halo +import pace.fv3core.stencils.ray_fast as ray_fast +import pace.fv3core.stencils.temperature_adjust as temperature_adjust +import pace.fv3core.stencils.updatedzc as updatedzc +import pace.fv3core.stencils.updatedzd as updatedzd from pace.fv3core._config import AcousticDynamicsConfig from pace.fv3core.dycore_state import DycoreState from pace.fv3core.stencils.c_sw import CGridShallowWaterDynamics diff --git a/fv3core/pace/fv3core/stencils/fillz.py b/fv3core/pace/fv3core/stencils/fillz.py index a736a3e3..0a119047 100644 --- a/fv3core/pace/fv3core/stencils/fillz.py +++ b/fv3core/pace/fv3core/stencils/fillz.py @@ -1,9 +1,8 @@ import typing from typing import Dict -from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval - import ndsl.dsl.gt4py_utils as utils +from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace import orchestrate from ndsl.dsl.stencil import StencilFactory diff --git a/fv3core/pace/fv3core/stencils/fv_dynamics.py b/fv3core/pace/fv3core/stencils/fv_dynamics.py index c9954dd9..26e83d67 100644 --- a/fv3core/pace/fv3core/stencils/fv_dynamics.py +++ b/fv3core/pace/fv3core/stencils/fv_dynamics.py @@ -1,11 +1,9 @@ from datetime import timedelta from typing import Mapping, Optional +import ndsl.dsl.gt4py_utils as utils from dace.frontend.python.interface import nounroll as dace_no_unroll from gt4py.cartesian.gtscript import PARALLEL, computation, interval - -import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.moist_cv as moist_cv from ndsl.checkpointer import Checkpointer, NullCheckpointer from ndsl.comm.communicator import Communicator from ndsl.comm.mpi import MPI @@ -20,6 +18,8 @@ from ndsl.performance.timer import NullTimer, Timer from ndsl.quantity import Quantity from ndsl.stencils.c2l_ord import CubedToLatLon + +import pace.fv3core.stencils.moist_cv as moist_cv from pace.fv3core._config import DynamicalCoreConfig from pace.fv3core.dycore_state import DycoreState from pace.fv3core.stencils import fvtp2d, tracer_2d_1l diff --git a/fv3core/pace/fv3core/stencils/fv_subgridz.py b/fv3core/pace/fv3core/stencils/fv_subgridz.py index 8090608b..aa7a3080 100644 --- a/fv3core/pace/fv3core/stencils/fv_subgridz.py +++ b/fv3core/pace/fv3core/stencils/fv_subgridz.py @@ -2,6 +2,7 @@ import collections import gt4py.cartesian.gtscript as gtscript +import ndsl.dsl.gt4py_utils as utils from gt4py.cartesian.gtscript import ( __INLINED, BACKWARD, @@ -9,8 +10,6 @@ computation, interval, ) - -import ndsl.dsl.gt4py_utils as utils from ndsl.constants import ( C_ICE, C_LIQ, @@ -29,6 +28,7 @@ from ndsl.dsl.typing import Float, FloatField from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + from pace.fv3core.dycore_state import DycoreState from pace.fv3core.stencils.basic_operations import dim diff --git a/fv3core/pace/fv3core/stencils/fvtp2d.py b/fv3core/pace/fv3core/stencils/fvtp2d.py index 75dd2b56..f038c05d 100644 --- a/fv3core/pace/fv3core/stencils/fvtp2d.py +++ b/fv3core/pace/fv3core/stencils/fvtp2d.py @@ -1,15 +1,15 @@ from typing import Optional import gt4py.cartesian.gtscript as gtscript -from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region - import ndsl.stencils.corners as corners +from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.grid import DampingCoefficients, GridData from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.delnflux import DelnFlux from pace.fv3core.stencils.xppm import XPiecewiseParabolic from pace.fv3core.stencils.yppm import YPiecewiseParabolic diff --git a/fv3core/pace/fv3core/stencils/fxadv.py b/fv3core/pace/fv3core/stencils/fxadv.py index f027ebaf..83e7ab6b 100644 --- a/fv3core/pace/fv3core/stencils/fxadv.py +++ b/fv3core/pace/fv3core/stencils/fxadv.py @@ -6,11 +6,11 @@ interval, region, ) - from ndsl.dsl.dace import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.grid import GridData + from pace.fv3core.stencils.d2a2c_vect import contravariant diff --git a/fv3core/pace/fv3core/stencils/map_single.py b/fv3core/pace/fv3core/stencils/map_single.py index 0baca80f..a6dd875e 100644 --- a/fv3core/pace/fv3core/stencils/map_single.py +++ b/fv3core/pace/fv3core/stencils/map_single.py @@ -1,12 +1,12 @@ from typing import Optional, Sequence from gt4py.cartesian.gtscript import FORWARD, PARALLEL, computation, interval - from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ, IntFieldIJ # noqa: F401 from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.basic_operations import copy_defn from pace.fv3core.stencils.remap_profile import RemapProfile diff --git a/fv3core/pace/fv3core/stencils/mapn_tracer.py b/fv3core/pace/fv3core/stencils/mapn_tracer.py index 5a95bbcf..a55f875e 100644 --- a/fv3core/pace/fv3core/stencils/mapn_tracer.py +++ b/fv3core/pace/fv3core/stencils/mapn_tracer.py @@ -7,6 +7,7 @@ from ndsl.dsl.typing import Float, FloatField from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + from pace.fv3core.stencils.fillz import FillNegativeTracerValues from pace.fv3core.stencils.map_single import MapSingle diff --git a/fv3core/pace/fv3core/stencils/moist_cv.py b/fv3core/pace/fv3core/stencils/moist_cv.py index c571a24e..a467d781 100644 --- a/fv3core/pace/fv3core/stencils/moist_cv.py +++ b/fv3core/pace/fv3core/stencils/moist_cv.py @@ -1,4 +1,5 @@ import gt4py.cartesian.gtscript as gtscript +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( __INLINED, PARALLEL, @@ -7,8 +8,6 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.dsl.typing import Float, FloatField diff --git a/fv3core/pace/fv3core/stencils/neg_adj3.py b/fv3core/pace/fv3core/stencils/neg_adj3.py index 484cdfab..36761756 100644 --- a/fv3core/pace/fv3core/stencils/neg_adj3.py +++ b/fv3core/pace/fv3core/stencils/neg_adj3.py @@ -1,7 +1,6 @@ import gt4py.cartesian.gtscript as gtscript -from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval - import ndsl.constants as constants +from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval from ndsl.constants import X_DIM, Y_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ diff --git a/fv3core/pace/fv3core/stencils/nh_p_grad.py b/fv3core/pace/fv3core/stencils/nh_p_grad.py index 70576950..145d986e 100644 --- a/fv3core/pace/fv3core/stencils/nh_p_grad.py +++ b/fv3core/pace/fv3core/stencils/nh_p_grad.py @@ -1,11 +1,11 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - from ndsl.constants import X_DIM, Y_DIM, Z_INTERFACE_DIM from ndsl.dsl.dace import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.grid import GridData from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.a2b_ord4 import AGrid2BGridFourthOrder diff --git a/fv3core/pace/fv3core/stencils/pe_halo.py b/fv3core/pace/fv3core/stencils/pe_halo.py index f728b7f1..48a5bb85 100644 --- a/fv3core/pace/fv3core/stencils/pe_halo.py +++ b/fv3core/pace/fv3core/stencils/pe_halo.py @@ -1,5 +1,4 @@ from gt4py.cartesian.gtscript import FORWARD, computation, horizontal, interval, region - from ndsl.dsl.typing import Float, FloatField diff --git a/fv3core/pace/fv3core/stencils/pk3_halo.py b/fv3core/pace/fv3core/stencils/pk3_halo.py index a1874bc0..16e1ddd7 100644 --- a/fv3core/pace/fv3core/stencils/pk3_halo.py +++ b/fv3core/pace/fv3core/stencils/pk3_halo.py @@ -1,5 +1,4 @@ from gt4py.cartesian.gtscript import FORWARD, computation, horizontal, interval, region - from ndsl.constants import X_DIM, Y_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ diff --git a/fv3core/pace/fv3core/stencils/ppm.py b/fv3core/pace/fv3core/stencils/ppm.py index e1e1fd2c..c6d0a2c0 100644 --- a/fv3core/pace/fv3core/stencils/ppm.py +++ b/fv3core/pace/fv3core/stencils/ppm.py @@ -1,5 +1,4 @@ from gt4py.cartesian import gtscript - from ndsl.dsl.typing import FloatField diff --git a/fv3core/pace/fv3core/stencils/ray_fast.py b/fv3core/pace/fv3core/stencils/ray_fast.py index 13210386..6f857d37 100644 --- a/fv3core/pace/fv3core/stencils/ray_fast.py +++ b/fv3core/pace/fv3core/stencils/ray_fast.py @@ -1,4 +1,5 @@ import gt4py.cartesian.gtscript as gtscript +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( __INLINED, BACKWARD, @@ -11,8 +12,6 @@ region, sin, ) - -import ndsl.constants as constants from ndsl.constants import X_INTERFACE_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory diff --git a/fv3core/pace/fv3core/stencils/remap_profile.py b/fv3core/pace/fv3core/stencils/remap_profile.py index 3b670293..ea60f775 100644 --- a/fv3core/pace/fv3core/stencils/remap_profile.py +++ b/fv3core/pace/fv3core/stencils/remap_profile.py @@ -9,7 +9,6 @@ computation, interval, ) - from ndsl.constants import X_DIM, Y_DIM, Z_DIM, Z_INTERFACE_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory diff --git a/fv3core/pace/fv3core/stencils/remapping.py b/fv3core/pace/fv3core/stencils/remapping.py index 4a3de003..51fa41d1 100644 --- a/fv3core/pace/fv3core/stencils/remapping.py +++ b/fv3core/pace/fv3core/stencils/remapping.py @@ -12,8 +12,6 @@ log, region, ) - -import pace.fv3core.stencils.moist_cv as moist_cv from ndsl.checkpointer import Checkpointer from ndsl.constants import ( X_DIM, @@ -28,6 +26,8 @@ from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ, FloatFieldK from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + +import pace.fv3core.stencils.moist_cv as moist_cv from pace.fv3core._config import RemappingConfig from pace.fv3core.stencils.basic_operations import adjust_divide_stencil from pace.fv3core.stencils.map_single import MapSingle diff --git a/fv3core/pace/fv3core/stencils/riem_solver3.py b/fv3core/pace/fv3core/stencils/riem_solver3.py index a19f420a..faf0ff0e 100644 --- a/fv3core/pace/fv3core/stencils/riem_solver3.py +++ b/fv3core/pace/fv3core/stencils/riem_solver3.py @@ -1,6 +1,7 @@ import math import typing +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( __INLINED, BACKWARD, @@ -11,13 +12,12 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.constants import X_DIM, Y_DIM, Z_DIM, Z_INTERFACE_DIM from ndsl.dsl.dace import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core._config import RiemannConfig from pace.fv3core.stencils.sim1_solver import Sim1Solver diff --git a/fv3core/pace/fv3core/stencils/riem_solver_c.py b/fv3core/pace/fv3core/stencils/riem_solver_c.py index b9aec731..2873255e 100644 --- a/fv3core/pace/fv3core/stencils/riem_solver_c.py +++ b/fv3core/pace/fv3core/stencils/riem_solver_c.py @@ -1,5 +1,6 @@ import typing +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( BACKWARD, FORWARD, @@ -8,12 +9,11 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.constants import X_DIM, Y_DIM, Z_DIM, Z_INTERFACE_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.sim1_solver import Sim1Solver diff --git a/fv3core/pace/fv3core/stencils/saturation_adjustment.py b/fv3core/pace/fv3core/stencils/saturation_adjustment.py index 7f49e374..98239f3b 100644 --- a/fv3core/pace/fv3core/stencils/saturation_adjustment.py +++ b/fv3core/pace/fv3core/stencils/saturation_adjustment.py @@ -1,6 +1,7 @@ import math import gt4py.cartesian.gtscript as gtscript +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( __INLINED, PARALLEL, @@ -10,10 +11,9 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ + from pace.fv3core._config import SatAdjustConfig from pace.fv3core.stencils.basic_operations import dim from pace.fv3core.stencils.moist_cv import compute_pkz_func diff --git a/fv3core/pace/fv3core/stencils/sim1_solver.py b/fv3core/pace/fv3core/stencils/sim1_solver.py index 3d249ea5..d183d6e9 100644 --- a/fv3core/pace/fv3core/stencils/sim1_solver.py +++ b/fv3core/pace/fv3core/stencils/sim1_solver.py @@ -1,5 +1,6 @@ import typing +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( BACKWARD, FORWARD, @@ -9,8 +10,6 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.constants import X_DIM, Y_DIM, Z_INTERFACE_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ diff --git a/fv3core/pace/fv3core/stencils/temperature_adjust.py b/fv3core/pace/fv3core/stencils/temperature_adjust.py index 131434c9..9e8c7819 100644 --- a/fv3core/pace/fv3core/stencils/temperature_adjust.py +++ b/fv3core/pace/fv3core/stencils/temperature_adjust.py @@ -1,7 +1,7 @@ -from gt4py.cartesian.gtscript import PARALLEL, computation, exp, interval, log - import ndsl.constants as constants +from gt4py.cartesian.gtscript import PARALLEL, computation, exp, interval, log from ndsl.dsl.typing import Float, FloatField + from pace.fv3core.stencils.basic_operations import sign diff --git a/fv3core/pace/fv3core/stencils/tracer_2d_1l.py b/fv3core/pace/fv3core/stencils/tracer_2d_1l.py index 9a5140af..b287fd86 100644 --- a/fv3core/pace/fv3core/stencils/tracer_2d_1l.py +++ b/fv3core/pace/fv3core/stencils/tracer_2d_1l.py @@ -3,7 +3,6 @@ import gt4py.cartesian.gtscript as gtscript from gt4py.cartesian.gtscript import PARALLEL, computation, horizontal, interval, region - from ndsl.comm.communicator import Communicator from ndsl.constants import ( N_HALO_DEFAULT, @@ -19,6 +18,7 @@ from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + from pace.fv3core.stencils.fvtp2d import FiniteVolumeTransport diff --git a/fv3core/pace/fv3core/stencils/updatedzc.py b/fv3core/pace/fv3core/stencils/updatedzc.py index f327ce07..ad610c0a 100644 --- a/fv3core/pace/fv3core/stencils/updatedzc.py +++ b/fv3core/pace/fv3core/stencils/updatedzc.py @@ -1,7 +1,6 @@ import gt4py.cartesian.gtscript as gtscript -from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval - import ndsl.constants as constants +from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ, FloatFieldK diff --git a/fv3core/pace/fv3core/stencils/updatedzd.py b/fv3core/pace/fv3core/stencils/updatedzd.py index faaebf29..c84cf5e5 100644 --- a/fv3core/pace/fv3core/stencils/updatedzd.py +++ b/fv3core/pace/fv3core/stencils/updatedzd.py @@ -1,9 +1,8 @@ from typing import Tuple import gt4py.cartesian.gtscript as gtscript -from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval - import ndsl.constants as constants +from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval from ndsl.constants import ( X_DIM, X_INTERFACE_DIM, @@ -18,6 +17,7 @@ from ndsl.grid import DampingCoefficients, GridData from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity + from pace.fv3core.stencils.delnflux import DelnFluxNoSG from pace.fv3core.stencils.fvtp2d import FiniteVolumeTransport diff --git a/fv3core/pace/fv3core/stencils/xppm.py b/fv3core/pace/fv3core/stencils/xppm.py index 5d900346..4fba0dc4 100644 --- a/fv3core/pace/fv3core/stencils/xppm.py +++ b/fv3core/pace/fv3core/stencils/xppm.py @@ -8,9 +8,9 @@ interval, region, ) - from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ, Index3D + from pace.fv3core.stencils import ppm from pace.fv3core.stencils.basic_operations import sign diff --git a/fv3core/pace/fv3core/stencils/xtp_u.py b/fv3core/pace/fv3core/stencils/xtp_u.py index 3e6f8095..0d5e43f9 100644 --- a/fv3core/pace/fv3core/stencils/xtp_u.py +++ b/fv3core/pace/fv3core/stencils/xtp_u.py @@ -1,7 +1,7 @@ from gt4py.cartesian import gtscript from gt4py.cartesian.gtscript import __INLINED, compile_assert, horizontal, region - from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ + from pace.fv3core.stencils import ppm, xppm diff --git a/fv3core/pace/fv3core/stencils/yppm.py b/fv3core/pace/fv3core/stencils/yppm.py index 79b1499a..59f1dd39 100644 --- a/fv3core/pace/fv3core/stencils/yppm.py +++ b/fv3core/pace/fv3core/stencils/yppm.py @@ -8,10 +8,10 @@ interval, region, ) - from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ, Index3D + from pace.fv3core.stencils import ppm from pace.fv3core.stencils.basic_operations import sign diff --git a/fv3core/pace/fv3core/stencils/ytp_v.py b/fv3core/pace/fv3core/stencils/ytp_v.py index 24e02dd3..8e729f02 100644 --- a/fv3core/pace/fv3core/stencils/ytp_v.py +++ b/fv3core/pace/fv3core/stencils/ytp_v.py @@ -1,7 +1,7 @@ from gt4py.cartesian import gtscript from gt4py.cartesian.gtscript import __INLINED, compile_assert, horizontal, region - from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ + from pace.fv3core.stencils import ppm, yppm diff --git a/fv3core/pace/fv3core/testing/map_single.py b/fv3core/pace/fv3core/testing/map_single.py index 575f6ad3..8cf1fd8a 100644 --- a/fv3core/pace/fv3core/testing/map_single.py +++ b/fv3core/pace/fv3core/testing/map_single.py @@ -3,6 +3,7 @@ from ndsl.constants import X_INTERFACE_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.initialization.allocator import QuantityFactory + from pace.fv3core.stencils.map_single import MapSingle diff --git a/fv3core/pace/fv3core/testing/translate_dyncore.py b/fv3core/pace/fv3core/testing/translate_dyncore.py index 153914f6..e0530814 100644 --- a/fv3core/pace/fv3core/testing/translate_dyncore.py +++ b/fv3core/pace/fv3core/testing/translate_dyncore.py @@ -1,10 +1,11 @@ import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.dyn_core as dyn_core from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.quantity import Quantity from ndsl.stencils.testing import ParallelTranslate2PyState + +import pace.fv3core.stencils.dyn_core as dyn_core from pace.fv3core import DycoreState, DynamicalCoreConfig diff --git a/fv3core/pace/fv3core/testing/translate_fvdynamics.py b/fv3core/pace/fv3core/testing/translate_fvdynamics.py index f77266a4..afd26d5e 100644 --- a/fv3core/pace/fv3core/testing/translate_fvdynamics.py +++ b/fv3core/pace/fv3core/testing/translate_fvdynamics.py @@ -2,10 +2,8 @@ from datetime import timedelta from typing import Any, Dict, Optional, Tuple -import pytest - import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.fv_dynamics as fv_dynamics +import pytest from ndsl.constants import ( X_DIM, X_INTERFACE_DIM, @@ -21,6 +19,8 @@ from ndsl.quantity import Quantity from ndsl.stencils.testing import ParallelTranslateBaseSlicing from ndsl.stencils.testing.translate import TranslateFortranData2Py + +import pace.fv3core.stencils.fv_dynamics as fv_dynamics from pace.fv3core._config import DynamicalCoreConfig from pace.fv3core.dycore_state import DycoreState diff --git a/fv3core/pace/fv3core/testing/validation.py b/fv3core/pace/fv3core/testing/validation.py index d76030c0..d8e8d6be 100644 --- a/fv3core/pace/fv3core/testing/validation.py +++ b/fv3core/pace/fv3core/testing/validation.py @@ -2,11 +2,11 @@ from typing import Callable, Mapping, Tuple import numpy as np +from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM +from ndsl.quantity import Quantity import pace.fv3core.stencils.divergence_damping import pace.fv3core.stencils.updatedzd -from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM -from ndsl.quantity import Quantity def get_selective_class( diff --git a/fv3core/pace/fv3core/utils/functional_validation.py b/fv3core/pace/fv3core/utils/functional_validation.py index 728e937e..cfbe1782 100644 --- a/fv3core/pace/fv3core/utils/functional_validation.py +++ b/fv3core/pace/fv3core/utils/functional_validation.py @@ -2,7 +2,6 @@ from typing import Callable, Sequence, Tuple import numpy as np - from ndsl.dsl.stencil import GridIndexing diff --git a/fv3core/pace/fv3core/wrappers/geos_wrapper.py b/fv3core/pace/fv3core/wrappers/geos_wrapper.py index 51281c72..1a5fbe9c 100644 --- a/fv3core/pace/fv3core/wrappers/geos_wrapper.py +++ b/fv3core/pace/fv3core/wrappers/geos_wrapper.py @@ -8,7 +8,6 @@ import numpy as np from gt4py.cartesian.config import build_settings as gt_build_settings from mpi4py import MPI - from ndsl.comm.comm_abc import Comm from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm @@ -29,6 +28,7 @@ from ndsl.optional_imports import cupy as cp from ndsl.performance.collector import PerformanceCollector from ndsl.utils import safe_assign_array + from pace import fv3core diff --git a/fv3core/tests/mpi/test_doubly_periodic.py b/fv3core/tests/mpi/test_doubly_periodic.py index b314efad..9b9cdff6 100644 --- a/fv3core/tests/mpi/test_doubly_periodic.py +++ b/fv3core/tests/mpi/test_doubly_periodic.py @@ -3,9 +3,6 @@ import ndsl.dsl.stencil import ndsl.stencils.testing -import pace.fv3core -import pace.fv3core._config -import pace.fv3core.initialization.baroclinic as baroclinic_init from ndsl.comm.communicator import CubedSphereCommunicator, TileCommunicator from ndsl.comm.mpi import MPIComm from ndsl.comm.partitioner import TilePartitioner @@ -14,6 +11,10 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer +import pace.fv3core +import pace.fv3core._config +import pace.fv3core.initialization.baroclinic as baroclinic_init + def setup_dycore() -> Tuple[pace.fv3core.DynamicalCore, List[Any]]: backend = "numpy" diff --git a/fv3core/tests/savepoint/translate/translate_a2b_ord4.py b/fv3core/tests/savepoint/translate/translate_a2b_ord4.py index 61f77963..8c6d5074 100644 --- a/fv3core/tests/savepoint/translate/translate_a2b_ord4.py +++ b/fv3core/tests/savepoint/translate/translate_a2b_ord4.py @@ -4,6 +4,7 @@ from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.divergence_damping import DivergenceDamping from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_c_sw.py b/fv3core/tests/savepoint/translate/translate_c_sw.py index c39fd47b..a6aa731c 100644 --- a/fv3core/tests/savepoint/translate/translate_c_sw.py +++ b/fv3core/tests/savepoint/translate/translate_c_sw.py @@ -1,6 +1,7 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.initialization.allocator import QuantityFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.c_sw import CGridShallowWaterDynamics from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_corners.py b/fv3core/tests/savepoint/translate/translate_corners.py index e3e3d77f..a426b2e3 100644 --- a/fv3core/tests/savepoint/translate/translate_corners.py +++ b/fv3core/tests/savepoint/translate/translate_corners.py @@ -4,6 +4,7 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.stencils import corners + from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_d2a2c_vect.py b/fv3core/tests/savepoint/translate/translate_d2a2c_vect.py index b206ded9..c35721c3 100644 --- a/fv3core/tests/savepoint/translate/translate_d2a2c_vect.py +++ b/fv3core/tests/savepoint/translate/translate_d2a2c_vect.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.d2a2c_vect import DGrid2AGrid2CGridVectors from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_d_sw.py b/fv3core/tests/savepoint/translate/translate_d_sw.py index 08290e33..3e19e61f 100644 --- a/fv3core/tests/savepoint/translate/translate_d_sw.py +++ b/fv3core/tests/savepoint/translate/translate_d_sw.py @@ -1,9 +1,9 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - -import pace.fv3core.stencils.d_sw as d_sw from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ from ndsl.namelist import Namelist + +import pace.fv3core.stencils.d_sw as d_sw from pace import fv3core from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_del2cubed.py b/fv3core/tests/savepoint/translate/translate_del2cubed.py index 6576b44e..b50c677f 100644 --- a/fv3core/tests/savepoint/translate/translate_del2cubed.py +++ b/fv3core/tests/savepoint/translate/translate_del2cubed.py @@ -2,6 +2,7 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.del2cubed import HyperdiffusionDamping from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_del6vtflux.py b/fv3core/tests/savepoint/translate/translate_del6vtflux.py index 4533dacd..31fc42a1 100644 --- a/fv3core/tests/savepoint/translate/translate_del6vtflux.py +++ b/fv3core/tests/savepoint/translate/translate_del6vtflux.py @@ -1,7 +1,8 @@ -import pace.fv3core.stencils.delnflux as delnflux from ndsl.constants import Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.delnflux as delnflux from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_delnflux.py b/fv3core/tests/savepoint/translate/translate_delnflux.py index acd119fc..3442e5af 100644 --- a/fv3core/tests/savepoint/translate/translate_delnflux.py +++ b/fv3core/tests/savepoint/translate/translate_delnflux.py @@ -1,7 +1,8 @@ -import pace.fv3core.stencils.delnflux as delnflux from ndsl.constants import Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.delnflux as delnflux from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_divergencedamping.py b/fv3core/tests/savepoint/translate/translate_divergencedamping.py index 122ff64c..0d4cb80f 100644 --- a/fv3core/tests/savepoint/translate/translate_divergencedamping.py +++ b/fv3core/tests/savepoint/translate/translate_divergencedamping.py @@ -3,6 +3,7 @@ from ndsl.constants import Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.divergence_damping import DivergenceDamping from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_fillz.py b/fv3core/tests/savepoint/translate/translate_fillz.py index 671cbd87..489e388f 100644 --- a/fv3core/tests/savepoint/translate/translate_fillz.py +++ b/fv3core/tests/savepoint/translate/translate_fillz.py @@ -1,11 +1,11 @@ -import numpy as np - import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.fillz as fillz +import numpy as np from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.stencils.testing import pad_field_in_j from ndsl.utils import safe_assign_array + +import pace.fv3core.stencils.fillz as fillz from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_fvsubgridz.py b/fv3core/tests/savepoint/translate/translate_fvsubgridz.py index b32a2d28..e7f297a6 100644 --- a/fv3core/tests/savepoint/translate/translate_fvsubgridz.py +++ b/fv3core/tests/savepoint/translate/translate_fvsubgridz.py @@ -1,12 +1,13 @@ from types import SimpleNamespace import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.fv_subgridz as fv_subgridz from ndsl.constants import X_DIM, Y_DIM, Z_DIM, Z_INTERFACE_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.stencils.testing import ParallelTranslateBaseSlicing +import pace.fv3core.stencils.fv_subgridz as fv_subgridz + # NOTE, does no halo updates, does not need to be a Parallel test, # but doing so here to make the interface match fv_dynamics. diff --git a/fv3core/tests/savepoint/translate/translate_fvtp2d.py b/fv3core/tests/savepoint/translate/translate_fvtp2d.py index 079e0285..1dab6e64 100644 --- a/fv3core/tests/savepoint/translate/translate_fvtp2d.py +++ b/fv3core/tests/savepoint/translate/translate_fvtp2d.py @@ -3,6 +3,7 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float from ndsl.namelist import Namelist + from pace.fv3core.stencils.fvtp2d import FiniteVolumeTransport from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_fxadv.py b/fv3core/tests/savepoint/translate/translate_fxadv.py index b550278c..d28a01cc 100644 --- a/fv3core/tests/savepoint/translate/translate_fxadv.py +++ b/fv3core/tests/savepoint/translate/translate_fxadv.py @@ -1,8 +1,8 @@ import numpy as np - from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.fxadv import FiniteVolumeFluxPrep from pace.fv3core.testing import TranslateDycoreFortranData2Py from pace.fv3core.utils.functional_validation import get_subset_func diff --git a/fv3core/tests/savepoint/translate/translate_grid.py b/fv3core/tests/savepoint/translate/translate_grid.py index 4b397d47..a4f56811 100644 --- a/fv3core/tests/savepoint/translate/translate_grid.py +++ b/fv3core/tests/savepoint/translate/translate_grid.py @@ -1,9 +1,8 @@ from typing import Any, Dict +import ndsl.dsl.gt4py_utils as utils import numpy as np import pytest - -import ndsl.dsl.gt4py_utils as utils from ndsl.constants import ( X_DIM, X_INTERFACE_DIM, diff --git a/fv3core/tests/savepoint/translate/translate_init_case.py b/fv3core/tests/savepoint/translate/translate_init_case.py index 6aa37fcf..db0aa398 100644 --- a/fv3core/tests/savepoint/translate/translate_init_case.py +++ b/fv3core/tests/savepoint/translate/translate_init_case.py @@ -1,13 +1,9 @@ from typing import Any, Dict -import numpy as np -import pytest - import ndsl.constants as constants import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.initialization.analytic_init as analytic_init -import pace.fv3core.initialization.init_utils as init_utils -import pace.fv3core.initialization.test_cases.initialize_baroclinic as baroclinic_init +import numpy as np +import pytest from ndsl.constants import ( N_HALO_DEFAULT, X_DIM, @@ -25,6 +21,10 @@ from ndsl.quantity import Quantity from ndsl.stencils.testing import ParallelTranslateBaseSlicing from ndsl.stencils.testing.grid import TRACER_DIM # type: ignore + +import pace.fv3core.initialization.analytic_init as analytic_init +import pace.fv3core.initialization.init_utils as init_utils +import pace.fv3core.initialization.test_cases.initialize_baroclinic as baroclinic_init from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_last_step.py b/fv3core/tests/savepoint/translate/translate_last_step.py index f0f37111..934dbb19 100644 --- a/fv3core/tests/savepoint/translate/translate_last_step.py +++ b/fv3core/tests/savepoint/translate/translate_last_step.py @@ -1,6 +1,7 @@ -import pace.fv3core.stencils.moist_cv as moist_cv from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.moist_cv as moist_cv from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_moistcvpluspkz_2d.py b/fv3core/tests/savepoint/translate/translate_moistcvpluspkz_2d.py index b1ee15b4..cc60fc0c 100644 --- a/fv3core/tests/savepoint/translate/translate_moistcvpluspkz_2d.py +++ b/fv3core/tests/savepoint/translate/translate_moistcvpluspkz_2d.py @@ -1,8 +1,9 @@ -import pace.fv3core.stencils.moist_cv as moist_cv from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField from ndsl.namelist import Namelist from ndsl.stencils.testing import pad_field_in_j + +import pace.fv3core.stencils.moist_cv as moist_cv from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_moistcvpluspt_2d.py b/fv3core/tests/savepoint/translate/translate_moistcvpluspt_2d.py index bb678cdd..2edb43ee 100644 --- a/fv3core/tests/savepoint/translate/translate_moistcvpluspt_2d.py +++ b/fv3core/tests/savepoint/translate/translate_moistcvpluspt_2d.py @@ -1,10 +1,10 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - -import pace.fv3core.stencils.moist_cv as moist_cv from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField from ndsl.stencils.testing import TranslateFortranData2Py, pad_field_in_j +import pace.fv3core.stencils.moist_cv as moist_cv + def moist_pt( qvapor: FloatField, diff --git a/fv3core/tests/savepoint/translate/translate_neg_adj3.py b/fv3core/tests/savepoint/translate/translate_neg_adj3.py index aa65bfa1..775ad529 100644 --- a/fv3core/tests/savepoint/translate/translate_neg_adj3.py +++ b/fv3core/tests/savepoint/translate/translate_neg_adj3.py @@ -3,6 +3,7 @@ import ndsl.dsl.gt4py_utils as utils from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.neg_adj3 import AdjustNegativeTracerMixingRatio from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_nh_p_grad.py b/fv3core/tests/savepoint/translate/translate_nh_p_grad.py index ec162ee5..e07b36b3 100644 --- a/fv3core/tests/savepoint/translate/translate_nh_p_grad.py +++ b/fv3core/tests/savepoint/translate/translate_nh_p_grad.py @@ -1,6 +1,7 @@ -import pace.fv3core.stencils.nh_p_grad as NH_P_Grad from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.nh_p_grad as NH_P_Grad from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_pe_halo.py b/fv3core/tests/savepoint/translate/translate_pe_halo.py index 272cc5c2..49ebd1eb 100644 --- a/fv3core/tests/savepoint/translate/translate_pe_halo.py +++ b/fv3core/tests/savepoint/translate/translate_pe_halo.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils import pe_halo from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_pk3_halo.py b/fv3core/tests/savepoint/translate/translate_pk3_halo.py index 1a5851dd..0c78bea3 100644 --- a/fv3core/tests/savepoint/translate/translate_pk3_halo.py +++ b/fv3core/tests/savepoint/translate/translate_pk3_halo.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.pk3_halo import PK3Halo from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_pressureadjustedtemperature_nonhydrostatic.py b/fv3core/tests/savepoint/translate/translate_pressureadjustedtemperature_nonhydrostatic.py index f5f903d1..d402ce0d 100644 --- a/fv3core/tests/savepoint/translate/translate_pressureadjustedtemperature_nonhydrostatic.py +++ b/fv3core/tests/savepoint/translate/translate_pressureadjustedtemperature_nonhydrostatic.py @@ -1,8 +1,9 @@ from typing import Any, Dict -import pace.fv3core from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core from pace.fv3core.stencils import temperature_adjust from pace.fv3core.stencils.dyn_core import get_nk_heat_dissipation from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_qsinit.py b/fv3core/tests/savepoint/translate/translate_qsinit.py index fa8eae54..3095f715 100644 --- a/fv3core/tests/savepoint/translate/translate_qsinit.py +++ b/fv3core/tests/savepoint/translate/translate_qsinit.py @@ -1,9 +1,9 @@ -import numpy as np - import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.saturation_adjustment as satadjust +import numpy as np from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.saturation_adjustment as satadjust from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_ray_fast.py b/fv3core/tests/savepoint/translate/translate_ray_fast.py index 225e07be..56a40494 100644 --- a/fv3core/tests/savepoint/translate/translate_ray_fast.py +++ b/fv3core/tests/savepoint/translate/translate_ray_fast.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.ray_fast import RayleighDamping from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_remapping.py b/fv3core/tests/savepoint/translate/translate_remapping.py index 0e5c69d6..5845d880 100644 --- a/fv3core/tests/savepoint/translate/translate_remapping.py +++ b/fv3core/tests/savepoint/translate/translate_remapping.py @@ -2,6 +2,7 @@ from ndsl.constants import Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core import DynamicalCoreConfig from pace.fv3core.stencils.remapping import LagrangianToEulerian from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_riem_solver3.py b/fv3core/tests/savepoint/translate/translate_riem_solver3.py index 22a1286b..3328a5f2 100644 --- a/fv3core/tests/savepoint/translate/translate_riem_solver3.py +++ b/fv3core/tests/savepoint/translate/translate_riem_solver3.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core import _config as spec from pace.fv3core.stencils.riem_solver3 import NonhydrostaticVerticalSolver from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_riem_solver_c.py b/fv3core/tests/savepoint/translate/translate_riem_solver_c.py index cd9949bf..30351b91 100644 --- a/fv3core/tests/savepoint/translate/translate_riem_solver_c.py +++ b/fv3core/tests/savepoint/translate/translate_riem_solver_c.py @@ -1,5 +1,6 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + from pace.fv3core.stencils.riem_solver_c import NonhydrostaticVerticalSolverCGrid from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_satadjust3d.py b/fv3core/tests/savepoint/translate/translate_satadjust3d.py index acc9833a..b358d74b 100644 --- a/fv3core/tests/savepoint/translate/translate_satadjust3d.py +++ b/fv3core/tests/savepoint/translate/translate_satadjust3d.py @@ -1,6 +1,7 @@ -import pace.fv3core from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core from pace.fv3core import DynamicalCoreConfig from pace.fv3core.stencils.saturation_adjustment import SatAdjust3d from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_tracer2d1l.py b/fv3core/tests/savepoint/translate/translate_tracer2d1l.py index a2600f86..0313c14c 100644 --- a/fv3core/tests/savepoint/translate/translate_tracer2d1l.py +++ b/fv3core/tests/savepoint/translate/translate_tracer2d1l.py @@ -1,12 +1,12 @@ -import pytest - import ndsl.dsl.gt4py_utils as utils -import pace.fv3core.stencils.fvtp2d -import pace.fv3core.stencils.tracer_2d_1l +import pytest from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.stencils.testing import ParallelTranslate + +import pace.fv3core.stencils.fvtp2d +import pace.fv3core.stencils.tracer_2d_1l from pace.fv3core.utils.functional_validation import get_subset_func diff --git a/fv3core/tests/savepoint/translate/translate_updatedzc.py b/fv3core/tests/savepoint/translate/translate_updatedzc.py index abad8268..7d0fee1e 100644 --- a/fv3core/tests/savepoint/translate/translate_updatedzc.py +++ b/fv3core/tests/savepoint/translate/translate_updatedzc.py @@ -1,9 +1,9 @@ import numpy as np - -import pace.fv3core.stencils.updatedzc as updatedzc from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core.stencils.updatedzc as updatedzc from pace.fv3core.testing import TranslateDycoreFortranData2Py from pace.fv3core.utils.functional_validation import get_subset_func diff --git a/fv3core/tests/savepoint/translate/translate_updatedzd.py b/fv3core/tests/savepoint/translate/translate_updatedzd.py index f208beb9..e65b7c5e 100644 --- a/fv3core/tests/savepoint/translate/translate_updatedzd.py +++ b/fv3core/tests/savepoint/translate/translate_updatedzd.py @@ -1,10 +1,10 @@ import numpy as np - -import pace.fv3core -import pace.fv3core.stencils.updatedzd from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist + +import pace.fv3core +import pace.fv3core.stencils.updatedzd from pace.fv3core.stencils import d_sw from pace.fv3core.testing import TranslateDycoreFortranData2Py from pace.fv3core.utils.functional_validation import get_subset_func diff --git a/fv3core/tests/savepoint/translate/translate_xppm.py b/fv3core/tests/savepoint/translate/translate_xppm.py index f440ce7d..94ccc090 100644 --- a/fv3core/tests/savepoint/translate/translate_xppm.py +++ b/fv3core/tests/savepoint/translate/translate_xppm.py @@ -2,6 +2,7 @@ from ndsl.dsl.stencil import StencilFactory from ndsl.namelist import Namelist from ndsl.stencils.testing import TranslateGrid + from pace.fv3core.stencils import xppm from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_xtp_u.py b/fv3core/tests/savepoint/translate/translate_xtp_u.py index 694a2b4f..66b17640 100644 --- a/fv3core/tests/savepoint/translate/translate_xtp_u.py +++ b/fv3core/tests/savepoint/translate/translate_xtp_u.py @@ -1,11 +1,11 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - -import pace.fv3core.stencils.xtp_u as xtp_u from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ from ndsl.grid import GridData from ndsl.namelist import Namelist +import pace.fv3core.stencils.xtp_u as xtp_u + from .translate_ytp_v import TranslateYTP_V diff --git a/fv3core/tests/savepoint/translate/translate_yppm.py b/fv3core/tests/savepoint/translate/translate_yppm.py index 18c4f46d..a80e8510 100644 --- a/fv3core/tests/savepoint/translate/translate_yppm.py +++ b/fv3core/tests/savepoint/translate/translate_yppm.py @@ -3,6 +3,7 @@ from ndsl.dsl.typing import Float from ndsl.namelist import Namelist from ndsl.stencils.testing import TranslateGrid + from pace.fv3core.stencils import yppm from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/fv3core/tests/savepoint/translate/translate_ytp_v.py b/fv3core/tests/savepoint/translate/translate_ytp_v.py index cc9d0aa0..733af946 100644 --- a/fv3core/tests/savepoint/translate/translate_ytp_v.py +++ b/fv3core/tests/savepoint/translate/translate_ytp_v.py @@ -1,11 +1,11 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - -import pace.fv3core -import pace.fv3core.stencils.ytp_v as ytp_v from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ from ndsl.grid import GridData from ndsl.namelist import Namelist + +import pace.fv3core +import pace.fv3core.stencils.ytp_v as ytp_v from pace.fv3core.testing import TranslateDycoreFortranData2Py diff --git a/physics/pace/physics/_config.py b/physics/pace/physics/_config.py index 850483ba..91963bca 100644 --- a/physics/pace/physics/_config.py +++ b/physics/pace/physics/_config.py @@ -3,7 +3,6 @@ from typing import List, Optional, Tuple import f90nml - from ndsl.namelist import Namelist, NamelistDefaults from ndsl.utils import MetaEnumStr diff --git a/physics/pace/physics/functions/microphysics_funcs.py b/physics/pace/physics/functions/microphysics_funcs.py index 02ad2e9f..7fdf45c2 100644 --- a/physics/pace/physics/functions/microphysics_funcs.py +++ b/physics/pace/physics/functions/microphysics_funcs.py @@ -1,8 +1,7 @@ +import ndsl.constants as constants from gt4py.cartesian import gtscript from gt4py.cartesian.gtscript import exp, log, sqrt -import ndsl.constants as constants - # Marshall-Palmer constants ### VCONS = 6.6280504 diff --git a/physics/pace/physics/physics_state.py b/physics/pace/physics/physics_state.py index d6f407d3..261736d1 100644 --- a/physics/pace/physics/physics_state.py +++ b/physics/pace/physics/physics_state.py @@ -1,14 +1,14 @@ from dataclasses import InitVar, dataclass, field, fields from typing import Any, Dict, List, Mapping, Optional -import xarray as xr - import ndsl.dsl.gt4py_utils as gt_utils +import xarray as xr from ndsl.constants import X_DIM, Y_DIM, Z_DIM, Z_INTERFACE_DIM from ndsl.dsl.typing import Float from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import GridSizer from ndsl.quantity import Quantity + from pace.physics.stencils.microphysics import MicrophysicsState from ._config import PHYSICS_PACKAGES diff --git a/physics/pace/physics/stencils/get_phi_fv3.py b/physics/pace/physics/stencils/get_phi_fv3.py index 64f3acc6..93e67f93 100644 --- a/physics/pace/physics/stencils/get_phi_fv3.py +++ b/physics/pace/physics/stencils/get_phi_fv3.py @@ -1,5 +1,4 @@ from gt4py.cartesian.gtscript import BACKWARD, PARALLEL, computation, interval - from ndsl.constants import ZVIR from ndsl.dsl.typing import FloatField diff --git a/physics/pace/physics/stencils/get_prs_fv3.py b/physics/pace/physics/stencils/get_prs_fv3.py index 1a5e3806..8c355444 100644 --- a/physics/pace/physics/stencils/get_prs_fv3.py +++ b/physics/pace/physics/stencils/get_prs_fv3.py @@ -1,5 +1,4 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - from ndsl.constants import ZVIR from ndsl.dsl.typing import FloatField diff --git a/physics/pace/physics/stencils/microphysics.py b/physics/pace/physics/stencils/microphysics.py index b042d3d2..50a9613b 100644 --- a/physics/pace/physics/stencils/microphysics.py +++ b/physics/pace/physics/stencils/microphysics.py @@ -1,6 +1,7 @@ import copy import typing +import ndsl.constants as constants import numpy as np from gt4py.cartesian.gtscript import ( BACKWARD, @@ -10,9 +11,6 @@ interval, sqrt, ) - -import ndsl.constants as constants -import pace.physics.functions.microphysics_funcs as functions from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory @@ -21,6 +19,8 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity +import pace.physics.functions.microphysics_funcs as functions + from .._config import PhysicsConfig diff --git a/physics/pace/physics/stencils/physics.py b/physics/pace/physics/stencils/physics.py index d4a90eec..b9b7f623 100644 --- a/physics/pace/physics/stencils/physics.py +++ b/physics/pace/physics/stencils/physics.py @@ -1,4 +1,5 @@ import gt4py.cartesian.gtscript as gtscript +import ndsl.constants as constants from gt4py.cartesian.gtscript import ( BACKWARD, FORWARD, @@ -8,14 +9,13 @@ interval, log, ) - -import ndsl.constants as constants from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import Float, FloatField from ndsl.grid import GridData from ndsl.initialization.allocator import QuantityFactory + from pace.physics import PHYSICS_PACKAGES, PhysicsConfig from pace.physics.physics_state import PhysicsState from pace.physics.stencils.get_phi_fv3 import get_phi_fv3 diff --git a/physics/pace/physics/update/fv_update_phys.py b/physics/pace/physics/update/fv_update_phys.py index 06864de3..bc1c1e8b 100644 --- a/physics/pace/physics/update/fv_update_phys.py +++ b/physics/pace/physics/update/fv_update_phys.py @@ -1,7 +1,6 @@ import gt4py.cartesian.gtscript as gtscript -from gt4py.cartesian.gtscript import FORWARD, PARALLEL, computation, exp, interval, log - import ndsl.constants as constants +from gt4py.cartesian.gtscript import FORWARD, PARALLEL, computation, exp, interval, log from ndsl.comm.communicator import Communicator from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace.orchestration import orchestrate @@ -12,6 +11,7 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.quantity import Quantity from ndsl.stencils.c2l_ord import CubedToLatLon + from pace import fv3core from pace.physics.update.update_dwind_phys import AGrid2DGridPhysics diff --git a/physics/pace/physics/update/update_atmos_state.py b/physics/pace/physics/update/update_atmos_state.py index cbe9b8f4..472eb31d 100644 --- a/physics/pace/physics/update/update_atmos_state.py +++ b/physics/pace/physics/update/update_atmos_state.py @@ -1,8 +1,6 @@ from typing import Optional from gt4py.cartesian.gtscript import BACKWARD, FORWARD, PARALLEL, computation, interval - -import pace.fv3core.stencils.fv_subgridz as fv_subgridz from ndsl.comm.communicator import Communicator from ndsl.constants import X_INTERFACE_DIM, Y_INTERFACE_DIM, Z_INTERFACE_DIM from ndsl.dsl.dace.orchestration import orchestrate @@ -10,6 +8,8 @@ from ndsl.dsl.typing import Float, FloatField from ndsl.grid import DriverGridData, GridData from ndsl.initialization.allocator import QuantityFactory + +import pace.fv3core.stencils.fv_subgridz as fv_subgridz from pace import fv3core from pace.physics.update.fv_update_phys import ApplyPhysicsToDycore diff --git a/physics/pace/physics/update/update_dwind_phys.py b/physics/pace/physics/update/update_dwind_phys.py index bed5edb6..2d671eaa 100644 --- a/physics/pace/physics/update/update_dwind_phys.py +++ b/physics/pace/physics/update/update_dwind_phys.py @@ -1,5 +1,4 @@ from gt4py.cartesian.gtscript import PARALLEL, computation, interval - from ndsl.comm.partitioner import TilePartitioner from ndsl.constants import X_DIM, Y_DIM, Z_DIM from ndsl.dsl.dace import orchestrate diff --git a/physics/tests/savepoint/translate/translate_atmos_phy_statein.py b/physics/tests/savepoint/translate/translate_atmos_phy_statein.py index 91589d28..ed5f5e79 100644 --- a/physics/tests/savepoint/translate/translate_atmos_phy_statein.py +++ b/physics/tests/savepoint/translate/translate_atmos_phy_statein.py @@ -1,8 +1,8 @@ +import ndsl.dsl.gt4py_utils as utils import numpy as np +from ndsl.constants import KAPPA from translate_physics import TranslatePhysicsFortranData2Py -import ndsl.dsl.gt4py_utils as utils -from ndsl.constants import KAPPA from pace.physics.stencils.physics import atmos_phys_driver_statein diff --git a/physics/tests/savepoint/translate/translate_fillgfs.py b/physics/tests/savepoint/translate/translate_fillgfs.py index 7e171901..479a9ca8 100644 --- a/physics/tests/savepoint/translate/translate_fillgfs.py +++ b/physics/tests/savepoint/translate/translate_fillgfs.py @@ -1,8 +1,8 @@ +import ndsl.dsl.gt4py_utils as utils import numpy as np +from ndsl.utils import safe_assign_array from translate_physics import TranslatePhysicsFortranData2Py -import ndsl.dsl.gt4py_utils as utils -from ndsl.utils import safe_assign_array from pace.physics.update.update_atmos_state import fill_gfs_delp diff --git a/physics/tests/savepoint/translate/translate_fv_update_phys.py b/physics/tests/savepoint/translate/translate_fv_update_phys.py index 1e65b829..c57ed2ce 100644 --- a/physics/tests/savepoint/translate/translate_fv_update_phys.py +++ b/physics/tests/savepoint/translate/translate_fv_update_phys.py @@ -1,18 +1,18 @@ import dataclasses -import numpy as np -from translate_physics import ( - ParallelPhysicsTranslate2Py, - transform_dwind_serialized_data, -) - import ndsl.dsl.gt4py_utils as utils +import numpy as np from ndsl.constants import X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM, Z_DIM from ndsl.dsl.stencil import StencilFactory from ndsl.dsl.typing import FloatField, FloatFieldIJ from ndsl.namelist import Namelist from ndsl.quantity import Quantity from ndsl.utils import safe_assign_array +from translate_physics import ( + ParallelPhysicsTranslate2Py, + transform_dwind_serialized_data, +) + from pace.physics.update.fv_update_phys import ApplyPhysicsToDycore diff --git a/physics/tests/savepoint/translate/translate_gfs_physics_driver.py b/physics/tests/savepoint/translate/translate_gfs_physics_driver.py index e2e1a6b8..6e9b5ac4 100644 --- a/physics/tests/savepoint/translate/translate_gfs_physics_driver.py +++ b/physics/tests/savepoint/translate/translate_gfs_physics_driver.py @@ -1,9 +1,9 @@ import copy -from translate_physics import TranslatePhysicsFortranData2Py - import ndsl.dsl.gt4py_utils as utils import ndsl.util as util +from translate_physics import TranslatePhysicsFortranData2Py + from pace.physics import PHYSICS_PACKAGES from pace.physics.stencils.physics import Physics, PhysicsState from pace.physics.update import update_atmos_state diff --git a/physics/tests/savepoint/translate/translate_microphysics.py b/physics/tests/savepoint/translate/translate_microphysics.py index 5a40e852..afee50af 100644 --- a/physics/tests/savepoint/translate/translate_microphysics.py +++ b/physics/tests/savepoint/translate/translate_microphysics.py @@ -1,12 +1,12 @@ import copy -import numpy as np -from translate_physics import TranslatePhysicsFortranData2Py - import ndsl.dsl.gt4py_utils as utils +import numpy as np from ndsl.dsl.typing import Float from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer +from translate_physics import TranslatePhysicsFortranData2Py + from pace.physics import PHYSICS_PACKAGES from pace.physics.stencils.microphysics import Microphysics from pace.physics.stencils.physics import PhysicsState diff --git a/physics/tests/savepoint/translate/translate_physics.py b/physics/tests/savepoint/translate/translate_physics.py index f09f7a32..1ddd9d24 100644 --- a/physics/tests/savepoint/translate/translate_physics.py +++ b/physics/tests/savepoint/translate/translate_physics.py @@ -1,9 +1,9 @@ -import numpy as np - import ndsl.dsl.gt4py_utils as utils +import numpy as np from ndsl.dsl.stencil import GridIndexing from ndsl.stencils.testing.parallel_translate import ParallelTranslate2Py from ndsl.stencils.testing.translate import TranslateFortranData2Py, as_numpy + from pace.physics import PhysicsConfig diff --git a/physics/tests/savepoint/translate/translate_update_dwind_phys.py b/physics/tests/savepoint/translate/translate_update_dwind_phys.py index 481e04f9..d166c3be 100644 --- a/physics/tests/savepoint/translate/translate_update_dwind_phys.py +++ b/physics/tests/savepoint/translate/translate_update_dwind_phys.py @@ -1,8 +1,8 @@ import numpy as np -from translate_physics import TranslatePhysicsFortranData2Py - from ndsl.comm.partitioner import TilePartitioner from ndsl.utils import safe_assign_array +from translate_physics import TranslatePhysicsFortranData2Py + from pace.physics.update.update_dwind_phys import AGrid2DGridPhysics diff --git a/physics/tests/savepoint/translate/translate_update_pressure_sfc_winds_phys.py b/physics/tests/savepoint/translate/translate_update_pressure_sfc_winds_phys.py index c70b5bcf..583127c6 100644 --- a/physics/tests/savepoint/translate/translate_update_pressure_sfc_winds_phys.py +++ b/physics/tests/savepoint/translate/translate_update_pressure_sfc_winds_phys.py @@ -1,6 +1,6 @@ +from ndsl.constants import KAPPA from translate_physics import TranslatePhysicsFortranData2Py -from ndsl.constants import KAPPA from pace.physics.update.fv_update_phys import update_pressure_and_surface_winds diff --git a/tests/main/driver/test_diagnostics_config.py b/tests/main/driver/test_diagnostics_config.py index e6064a2d..0355c30e 100644 --- a/tests/main/driver/test_diagnostics_config.py +++ b/tests/main/driver/test_diagnostics_config.py @@ -1,11 +1,11 @@ import unittest.mock import pytest +from ndsl.initialization.allocator import QuantityFactory +from ndsl.initialization.sizer import SubtileGridSizer import pace.driver import pace.driver.diagnostics -from ndsl.initialization.allocator import QuantityFactory -from ndsl.initialization.sizer import SubtileGridSizer from pace.fv3core.dycore_state import DycoreState diff --git a/tests/main/driver/test_driver.py b/tests/main/driver/test_driver.py index 602624cf..57c90657 100644 --- a/tests/main/driver/test_driver.py +++ b/tests/main/driver/test_driver.py @@ -3,7 +3,6 @@ from typing import Literal, Tuple import pytest - from ndsl.comm.null_comm import NullComm from ndsl.dsl.stencil import StencilConfig from ndsl.performance.report import ( @@ -12,6 +11,7 @@ gather_timing_data, get_sypd, ) + from pace.driver import CreatesCommSelector, DriverConfig, NullCommConfig diff --git a/tests/main/driver/test_restart_fortran.py b/tests/main/driver/test_restart_fortran.py index bf5f9104..52670c48 100644 --- a/tests/main/driver/test_restart_fortran.py +++ b/tests/main/driver/test_restart_fortran.py @@ -2,14 +2,14 @@ import numpy as np import xarray as xr - -import pace.driver from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.local_comm import LocalComm from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer + +import pace.driver from pace.driver.initialization import FortranRestartInit from pace.physics import PHYSICS_PACKAGES diff --git a/tests/main/driver/test_restart_serial.py b/tests/main/driver/test_restart_serial.py index f058d4ad..1e36cde0 100644 --- a/tests/main/driver/test_restart_serial.py +++ b/tests/main/driver/test_restart_serial.py @@ -5,14 +5,14 @@ import numpy as np import xarray as xr import yaml - -import pace.driver from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer from ndsl.quantity import Quantity + +import pace.driver from pace.driver import CreatesComm, DriverConfig from pace.driver.driver import RestartConfig from pace.driver.initialization import AnalyticInit diff --git a/tests/main/driver/test_safety_checks.py b/tests/main/driver/test_safety_checks.py index 5f528c55..ef7e733c 100644 --- a/tests/main/driver/test_safety_checks.py +++ b/tests/main/driver/test_safety_checks.py @@ -2,8 +2,8 @@ import numpy as np import pytest - from ndsl.quantity import Quantity + from pace.driver.safety_checks import SafetyChecker diff --git a/tests/main/fv3core/test_cartesian_grid.py b/tests/main/fv3core/test_cartesian_grid.py index 528735c1..8155b1be 100644 --- a/tests/main/fv3core/test_cartesian_grid.py +++ b/tests/main/fv3core/test_cartesian_grid.py @@ -1,6 +1,5 @@ import numpy as np import pytest - from ndsl.comm.communicator import TileCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import TilePartitioner diff --git a/tests/main/fv3core/test_dycore_call.py b/tests/main/fv3core/test_dycore_call.py index cb0bb7ba..baf67b48 100644 --- a/tests/main/fv3core/test_dycore_call.py +++ b/tests/main/fv3core/test_dycore_call.py @@ -6,7 +6,6 @@ import ndsl.dsl.stencil import ndsl.stencils.testing -import pace.fv3core.initialization.analytic_init as ai from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner @@ -18,6 +17,8 @@ from ndsl.performance.timer import NullTimer, Timer from ndsl.quantity import Quantity from ndsl.stencils.testing import assert_same_temporaries, copy_temporaries + +import pace.fv3core.initialization.analytic_init as ai from pace import fv3core from pace.fv3core.dycore_state import DycoreState diff --git a/tests/main/fv3core/test_grid.py b/tests/main/fv3core/test_grid.py index 2286ea03..108af13c 100644 --- a/tests/main/fv3core/test_grid.py +++ b/tests/main/fv3core/test_grid.py @@ -3,7 +3,6 @@ import numpy as np import pytest from gt4py.cartesian import gtscript - from ndsl.constants import ( X_DIM, X_INTERFACE_DIM, diff --git a/tests/main/fv3core/test_init_from_geos.py b/tests/main/fv3core/test_init_from_geos.py index 4563b11b..67d340b8 100644 --- a/tests/main/fv3core/test_init_from_geos.py +++ b/tests/main/fv3core/test_init_from_geos.py @@ -1,8 +1,8 @@ import f90nml import numpy as np import pytest # noqa - from ndsl.comm.null_comm import NullComm + from pace import fv3core diff --git a/tests/main/physics/test_integration.py b/tests/main/physics/test_integration.py index 9c91ee8d..eb954e24 100644 --- a/tests/main/physics/test_integration.py +++ b/tests/main/physics/test_integration.py @@ -2,8 +2,6 @@ from datetime import timedelta import numpy as np - -import pace.physics from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner @@ -16,6 +14,8 @@ from ndsl.initialization.sizer import SubtileGridSizer from ndsl.stencils.testing import assert_same_temporaries, copy_temporaries +import pace.physics + try: import cupy as cp diff --git a/tests/main/test_grid_init.py b/tests/main/test_grid_init.py index d9fb6b5d..f34f0569 100644 --- a/tests/main/test_grid_init.py +++ b/tests/main/test_grid_init.py @@ -1,6 +1,5 @@ import numpy as np import pytest - from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.null_comm import NullComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner diff --git a/tests/mpi_54rank/test_ext_grid/test_external_grid.py b/tests/mpi_54rank/test_ext_grid/test_external_grid.py index c5b52014..67ae54f3 100644 --- a/tests/mpi_54rank/test_ext_grid/test_external_grid.py +++ b/tests/mpi_54rank/test_ext_grid/test_external_grid.py @@ -5,7 +5,6 @@ import pytest import xarray as xr import yaml - from ndsl.comm.communicator import CubedSphereCommunicator from ndsl.comm.mpi import MPIComm from ndsl.comm.partitioner import ( @@ -14,6 +13,7 @@ get_tile_number, ) from ndsl.constants import PI, RADIUS, X_DIM, X_INTERFACE_DIM, Y_DIM, Y_INTERFACE_DIM + from pace.driver import Driver, DriverConfig diff --git a/tests/mpi_54rank/test_grid_init.py b/tests/mpi_54rank/test_grid_init.py index 9ab0bfa9..237b146f 100644 --- a/tests/mpi_54rank/test_grid_init.py +++ b/tests/mpi_54rank/test_grid_init.py @@ -1,8 +1,6 @@ from typing import Dict import numpy as np - -import pace.fv3core from ndsl.comm.communicator import CubedSphereCommunicator, TileCommunicator from ndsl.comm.mpi import MPIComm from ndsl.comm.partitioner import CubedSpherePartitioner, TilePartitioner @@ -11,6 +9,8 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer from ndsl.quantity import Quantity + +import pace.fv3core from pace.fv3core.initialization.test_cases.initialize_baroclinic import ( init_baroclinic_state, ) diff --git a/tests/savepoint/test_checkpoints.py b/tests/savepoint/test_checkpoints.py index f606f23b..bf52a8a8 100644 --- a/tests/savepoint/test_checkpoints.py +++ b/tests/savepoint/test_checkpoints.py @@ -7,7 +7,6 @@ import f90nml import xarray as xr import yaml - from ndsl.checkpointer import ValidationCheckpointer from ndsl.checkpointer.thresholds import ( SavepointThresholds, @@ -31,6 +30,7 @@ from ndsl.stencils.testing import TranslateGrid, dataset_to_dict from ndsl.stencils.testing.grid import Grid from ndsl.testing import perturb + from pace import fv3core from pace.fv3core.initialization.dycore_state import DycoreState from pace.fv3core.testing.translate_fvdynamics import TranslateFVDynamics diff --git a/tests/savepoint/translate/translate_driver.py b/tests/savepoint/translate/translate_driver.py index 28ba3ca0..7aab8f71 100644 --- a/tests/savepoint/translate/translate_driver.py +++ b/tests/savepoint/translate/translate_driver.py @@ -2,6 +2,7 @@ from ndsl.initialization.allocator import QuantityFactory from ndsl.initialization.sizer import SubtileGridSizer from ndsl.namelist import Namelist + from pace.driver.run import Driver, DriverConfig from pace.driver.state import TendencyState from pace.fv3core._config import DynamicalCoreConfig