diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-01 11:01:41 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-01 11:01:41 +0200 |
commit | 03bef0eb089de161b33d2f92783d1be5b06aa307 (patch) | |
tree | bc4322d9413a4c1d94f16fc395b7e47b7f0c2ec8 /src | |
parent | 4896b414e70b7c537825ea3375915e1f46d1b9cd (diff) | |
download | ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.gz ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.bz2 ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.tar.xz ee-python-03bef0eb089de161b33d2f92783d1be5b06aa307.zip |
o Updating demo project, reorganizing the demo a bit.
o DataSetManager: renaming `add_ds` to `register_ds`.
Diffstat (limited to 'src')
-rw-r--r-- | src/ee/doit.py | 4 | ||||
-rw-r--r-- | src/ee/ds/__init__.py | 2 | ||||
-rw-r--r-- | src/ee/ds/doit.py | 14 |
3 files changed, 5 insertions, 15 deletions
diff --git a/src/ee/doit.py b/src/ee/doit.py index c0a01ea..a89fdf7 100644 --- a/src/ee/doit.py +++ b/src/ee/doit.py @@ -50,3 +50,7 @@ class DoItConfig(object): def change_data_sets_for_task(self, task, _callable): ds = self._data_sets[task] ds[1] = _callable(ds[1]) + + def append_in_data_set_for_task(self, task, *data_sets: str): + ds = self._data_sets[task] + ds[1] = ds[1] + list(data_sets) diff --git a/src/ee/ds/__init__.py b/src/ee/ds/__init__.py index adf741f..5b4da4d 100644 --- a/src/ee/ds/__init__.py +++ b/src/ee/ds/__init__.py @@ -277,7 +277,7 @@ class DataSetManager(object): return ds - def add_ds(self, ds_type: str, name: str, object_type: str, path: str = None): + def register_ds(self, ds_type: str, name: str, object_type: str, path: str = None): if ds_type == "csv": if name in self._csv: raise Exception("Data source already exists: {}".format(name)) diff --git a/src/ee/ds/doit.py b/src/ee/ds/doit.py deleted file mode 100644 index f922cf1..0000000 --- a/src/ee/ds/doit.py +++ /dev/null @@ -1,14 +0,0 @@ - - -def uptodate_if_isdir(path): - def do_check(): - return os.path.isdir(path) - return do_check - -def uptodate_if_older_than(dependency, *targets): - def do_check(): - dep_mtime = os.stat(dependency).st_mtime - mtimes = [os.stat(t).st_mtime for t in targets if os.path.isfile(t)] - target_mtime = max(mtimes) if mtimes else 0 - return dep_mtime < target_mtime - return do_check |