Skip to content

Commit

Permalink
renamed data_handers.factory to data_handlers.base, after removal of …
Browse files Browse the repository at this point in the history
…explicit factory class. Clarified which class were inherited and composed in doc strings.
  • Loading branch information
bnb32 committed Jan 15, 2025
1 parent 7101749 commit dcb50cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions sup3r/preprocessing/data_handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Composite objects built from loaders, rasterizers, and derivers."""

from .exo import ExoData, ExoDataHandler, SingleExoDataStep
from .factory import (
from .base import (
DailyDataHandler,
DataHandler,
DataHandlerH5SolarCC,
DataHandlerH5WindCC,
)
from .exo import ExoData, ExoDataHandler, SingleExoDataStep
from .nc_cc import DataHandlerNCforCC, DataHandlerNCforCCwithPowerLaw
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""DataHandler objects, which are built through composition of
"""DataHandler objects, which inherit from the
:class:`~sup3r.preprocessing.derivers.Deriver` class and compose
:class:`~sup3r.preprocessing.rasterizers.Rasterizer`,
:class:`~sup3r.preprocessing.loaders.Loader`,
:class:`~sup3r.preprocessing.derivers.Deriver`, and
:class:`~sup3r.preprocessing.cachers.Cacher` classes.
TODO: If ``.data`` is a ``Sup3rDataset`` with more than one member only the
Expand Down Expand Up @@ -38,8 +38,7 @@
class DataHandler(Deriver):
"""Base DataHandler. Composes
:class:`~sup3r.preprocessing.rasterizers.Rasterizer`,
:class:`~sup3r.preprocessing.loaders.Loader`,
:class:`~sup3r.preprocessing.derivers.Deriver`, and
:class:`~sup3r.preprocessing.loaders.Loader`, and
:class:`~sup3r.preprocessing.cachers.Cacher` classes."""

@log_args
Expand Down Expand Up @@ -197,7 +196,7 @@ def __init__(
)

if cache_kwargs is not None and 'cache_pattern' in cache_kwargs:
_ = Cacher(data=self.data, cache_kwargs=cache_kwargs)
self.cacher = Cacher(data=self.data, cache_kwargs=cache_kwargs)
self._deriver_hook()

def _rasterizer_hook(self):
Expand Down
2 changes: 1 addition & 1 deletion sup3r/preprocessing/data_handlers/nc_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sup3r.preprocessing.names import Dimension
from sup3r.preprocessing.utilities import log_args

from .factory import DataHandler
from .base import DataHandler

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/training/test_train_exo_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from sup3r.models import Sup3rGan
from sup3r.preprocessing.batch_handlers.factory import BatchHandlerCC
from sup3r.preprocessing.data_handlers.factory import DataHandlerH5WindCC
from sup3r.preprocessing.data_handlers.base import DataHandlerH5WindCC
from sup3r.preprocessing.utilities import lowered
from sup3r.utilities.utilities import RANDOM_GENERATOR

Expand Down

0 comments on commit dcb50cf

Please sign in to comment.