Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding and updating __init__ files for modules #14

Merged
merged 15 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ndsl/__init__.py
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
from .constants import ConstantVersions
from .exceptions import OutOfBoundsError
from .logging import ndsl_log
from .optional_imports import RaiseWhenAccessed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RaiseWhenAccessed doesn't need to be here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide away

from .types import Allocator, AsyncRequest, NumpyModule
from .units import UnitsError
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these need to be exposed here either

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those can be really useful for typing, especially NumpyModule. Move NumpyModule, AsyncRequest, UnitsError in typing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poke

from .utils import MetaEnumStr
3 changes: 2 additions & 1 deletion ndsl/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
from numpy.lib.index_tricks import IndexExpression

from ndsl.performance.timer import NullTimer, Timer
from ndsl.types import Allocator
from ndsl.utils import (
device_synchronize,
Expand All @@ -13,6 +12,8 @@
safe_mpi_allocate,
)

from .performance.timer import NullTimer, Timer


BufferKey = Tuple[Callable, Iterable[int], type]
BUFFER_CACHE: Dict[BufferKey, List["Buffer"]] = {}
Expand Down
15 changes: 15 additions & 0 deletions ndsl/comm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from .boundary import SimpleBoundary
from .caching_comm import (
CachingCommData,
CachingCommReader,
CachingCommWriter,
CachingRequestReader,
CachingRequestWriter,
NullRequest,
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
)
from .comm_abc import Comm, Request
from .communicator import CubedSphereCommunicator, TileCommunicator
from .local_comm import AsyncResult, ConcurrencyError, LocalComm
from .mpi import MPIComm
from .null_comm import NullAsyncResult, NullComm
from .partitioner import CubedSpherePartitioner, TilePartitioner
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 3 additions & 2 deletions ndsl/dsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
from .dace.dace_config import DaceConfig, DaCeOrchestration
from .dace.orchestration import orchestrate, orchestrate_function
from .stencil import (
CompilationConfig,
CompareToNumpyStencil,
FrozenStencil,
GridIndexing,
StencilConfig,
StencilFactory,
TimingCollector,
)
from .stencil_config import CompilationConfig, RunMode, StencilConfig

FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved

if MPI is not None:
Expand Down
1 change: 1 addition & 0 deletions ndsl/dsl/caches/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .codepath import FV3CodePath
4 changes: 2 additions & 2 deletions ndsl/dsl/dace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ndsl.dsl.dace.dace_config import DaceConfig
from ndsl.dsl.dace.orchestration import orchestrate
from .dace_config import DaceConfig
from .orchestration import orchestrate
6 changes: 6 additions & 0 deletions ndsl/halo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .data_transformer import (
HaloDataTransformerCPU,
HaloDataTransformerGPU,
HaloExchangeSpec,
)
from .updater import HaloUpdater, HaloUpdateRequest, VectorInterfaceHaloUpdater
7 changes: 7 additions & 0 deletions ndsl/performance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
from .collector import (
AbstractPerformanceCollector,
NullPerformanceCollector,
PerformanceCollector,
)
from .config import PerformanceConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also leave this in as well

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poke

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leave in PerformanceConfig or/and NullTimer, Timer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the tree are useful here either for us or typing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left all three in.

from .profiler import NullProfiler, Profiler
from .report import Experiment, Report, TimeReport
from .timer import NullTimer, Timer
4 changes: 4 additions & 0 deletions ndsl/stencils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from .c2l_ord import CubedToLatLon
from .corners import CopyCorners, CopyCornersXY, FillCornersBGrid


FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
__version__ = "0.2.0"
1 change: 1 addition & 0 deletions ndsl/stencils/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ParallelTranslate2Py,
ParallelTranslate2PyState,
ParallelTranslateBaseSlicing,
ParallelTranslateGrid,
)
from .savepoint import SavepointCase, Translate, dataset_to_dict
from .temporaries import assert_same_temporaries, copy_temporaries
Expand Down
Empty file added tests/checkpointer/__init__.py
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
2 changes: 2 additions & 0 deletions tests/dsl/__init__.py
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .test_stencil_wrapper import MockFieldInfo
from .test_caches import OrchestratedProgam
Empty file added tests/mpi/__init__.py
Empty file.
3 changes: 2 additions & 1 deletion tests/mpi/test_mpi_halo_update.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import copy

import pytest
from mpi_comm import MPI

from ndsl.comm._boundary_utils import get_boundary_slice
from ndsl.comm.communicator import CubedSphereCommunicator
Expand All @@ -25,6 +24,8 @@
)
from ndsl.quantity import Quantity

from .mpi_comm import MPI


@pytest.fixture
def dtype(numpy):
Expand Down
3 changes: 2 additions & 1 deletion tests/mpi/test_mpi_mock.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import numpy as np
import pytest
from mpi_comm import MPI

from ndsl.comm.communicator import recv_buffer
from ndsl.testing import ConcurrencyError, DummyComm

from .mpi_comm import MPI


worker_function_list = []

Expand Down
Empty file added tests/quantity/__init__.py
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
FlorianDeconinck marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Loading