Skip to content

Commit

Permalink
Linting import orders
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianDeconinck committed Feb 1, 2024
1 parent 1739a34 commit c41b6e3
Show file tree
Hide file tree
Showing 133 changed files with 218 additions and 212 deletions.
4 changes: 2 additions & 2 deletions driver/examples/stencil_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import inspect
from typing import Optional, TextIO

import yaml

import ndsl.dsl
import ndsl.util
import yaml

import pace.driver


Expand Down
1 change: 0 additions & 1 deletion driver/pace/driver/configs/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions driver/pace/driver/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions driver/pace/driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion driver/pace/driver/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions driver/pace/driver/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion driver/pace/driver/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import click
import yaml

from ndsl.logging import AVAILABLE_LOG_LEVELS, ndsl_log

from .driver import Driver, DriverConfig
Expand Down
2 changes: 1 addition & 1 deletion driver/pace/driver/safety_checks.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
6 changes: 3 additions & 3 deletions driver/pace/driver/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion driver/tests/mpi/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions fv3core/examples/standalone/runfile/acoustics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fv3core/examples/standalone/runfile/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 5 additions & 4 deletions fv3core/examples/standalone/runfile/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion fv3core/pace/fv3core/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Optional, Tuple

import f90nml

from ndsl.namelist import Namelist, NamelistDefaults


Expand Down
3 changes: 1 addition & 2 deletions fv3core/pace/fv3core/dycore_state.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions fv3core/pace/fv3core/initialization/analytic_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions fv3core/pace/fv3core/initialization/init_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
@@ -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


Expand Down
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion fv3core/pace/fv3core/stencils/a2b_ord4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 0 additions & 1 deletion fv3core/pace/fv3core/stencils/basic_operations.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 1 addition & 1 deletion fv3core/pace/fv3core/stencils/c_sw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion fv3core/pace/fv3core/stencils/d2a2c_vect.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ
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


Expand Down
4 changes: 2 additions & 2 deletions fv3core/pace/fv3core/stencils/d_sw.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
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
from ndsl.dsl.typing import Float, FloatField, FloatFieldIJ, FloatFieldK
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
Expand Down
4 changes: 2 additions & 2 deletions fv3core/pace/fv3core/stencils/del2cubed.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
1 change: 0 additions & 1 deletion fv3core/pace/fv3core/stencils/delnflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit c41b6e3

Please sign in to comment.