Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Nov 15, 2023
1 parent 5bc2f07 commit 0205451
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ecml_tools/create/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialise(
raise Exception(f"{path} already exists. Use --force to overwrite.")

with cache_context(cache_dir):
obj = cls.from_config(partial=True, path=path, config=config, print=print)
obj = cls.from_config(path=path, config=config, print=print)
obj.initialise(check_name=not no_check_name)

@classmethod
Expand Down
3 changes: 0 additions & 3 deletions ecml_tools/create/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def normalise(self):
# TODO: consider 2D grid points
self.statistics_axis = statistics_axis

def input_handler(self, partial=False):
return InputHandler(self, partial=partial)

@classmethod
def _get_first_key_if_dict(cls, x):
if isinstance(x, str):
Expand Down
8 changes: 6 additions & 2 deletions ecml_tools/create/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
from .config import loader_config
from .utils import bytes, compute_directory_sizes, normalize_and_check_dates
from .writer import DataWriter
from .input import InputHandler

LOG = logging.getLogger(__name__)

VERSION = "0.13"


class Creator:
def __init__(self, *, path, config, print=print, partial=False, **kwargs):
partial = False
def __init__(self, *, path, config, print=print, **kwargs):
# Catch all floating point errors, including overflow, sqrt(<0), etc
np.seterr(all="raise")

Expand All @@ -34,7 +36,8 @@ def __init__(self, *, path, config, print=print, partial=False, **kwargs):
assert isinstance(path, str), path

self.main_config = loader_config(config)
self.input_handler = self.main_config.input_handler(partial)
self.input_handler = InputHandler(self.main_config, partial=self.partial)

self.path = path
self.kwargs = kwargs
self.print = print
Expand Down Expand Up @@ -102,6 +105,7 @@ def _add_dataset(self, mode="r+", **kwargs):


class InitialiseCreator(Creator):
partial = True
def initialise(self, check_name=True):
"""Create empty dataset"""

Expand Down

0 comments on commit 0205451

Please sign in to comment.