deriva-ml 1.13.3__tar.gz → 1.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deriva_ml-1.13.3/src/deriva_ml.egg-info → deriva_ml-1.14.0}/PKG-INFO +1 -1
- deriva_ml-1.14.0/docs/code-docs/deriva_definitions.md +2 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/mkdocs.yml +1 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/dataset.py +16 -1
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/deriva_definitions.py +20 -1
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/history.py +2 -1
- {deriva_ml-1.13.3 → deriva_ml-1.14.0/src/deriva_ml.egg-info}/PKG-INFO +1 -1
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml.egg-info/SOURCES.txt +1 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/.github/workflows/publish-docs.yml +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/.gitignore +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/LICENSE +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/README.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/.DS_Store +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Create Notes.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Dataset.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Execution.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Features.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Ingest.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/Notebooks/DerivaML Vocabulary.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/ERD.png +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/Launcher.png +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/copy_minid.png +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/deriva-logo.png +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/deriva-ml.pdf +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/assets/sharing-at-home.pdf +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/dataset.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/dataset_aux_classes.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/dataset_bag.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/deriva_ml_base.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/deriva_model.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/execution.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/execution_configuration.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/feature.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/code-docs/upload.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/index.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/release-notes.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/datasets.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/deriva_ml_structure.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/execution-configuration.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/file-assets.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/identifiers.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/install.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/notebooks.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/docs/user-guide/overview.md +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/pyproject.toml +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/release.sh +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/setup.cfg +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/__init__.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/database_model.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/dataset_aux_classes.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/dataset_bag.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/demo_catalog.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/deriva_ml_base.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/deriva_model.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/execution.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/execution_configuration.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/execution_environment.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/feature.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/run_notebook.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/schema_setup/__init__.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/schema_setup/annotations.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/schema_setup/create_schema.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/schema_setup/policy.json +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/schema_setup/table_comments_utils.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/test-files/execution-parameters.json +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/test-files/notebook-parameters.json +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/test_functions.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/test_notebook.ipynb +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml/upload.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml.egg-info/dependency_links.txt +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml.egg-info/entry_points.txt +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml.egg-info/requires.txt +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/src/deriva_ml.egg-info/top_level.txt +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/__init__.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/derivaml_test.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/runner.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_basic_tables.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_dataset.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_download.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_execution.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_features.py +0 -0
- {deriva_ml-1.13.3 → deriva_ml-1.14.0}/tests/test_upload.py +0 -0
|
@@ -57,6 +57,7 @@ nav:
|
|
|
57
57
|
- Datasets: code-docs/dataset.md
|
|
58
58
|
- DatasetBag Auxiliary Classes: code-docs/dataset_aux_classes.md
|
|
59
59
|
- DatasetBag: code-docs/dataset_bag.md
|
|
60
|
+
- Helper Classes: code-docs/deriva_definitions.md
|
|
60
61
|
- DerivaModel: code-docs/deriva_model.md
|
|
61
62
|
- Execution: code-docs/execution.md
|
|
62
63
|
- ExecutionConfiguration: code-docs/execution_configuration.md
|
|
@@ -21,7 +21,7 @@ import requests
|
|
|
21
21
|
from tempfile import TemporaryDirectory
|
|
22
22
|
from typing import Any, Callable, Optional, Iterable, Iterator, TYPE_CHECKING
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
from .history import iso_to_snap
|
|
25
25
|
from deriva.core.ermrest_model import Table
|
|
26
26
|
from deriva.core.utils.core_utils import tag as deriva_tags, format_exception
|
|
27
27
|
import deriva.core.utils.hash_utils as hash_utils
|
|
@@ -168,6 +168,21 @@ class Dataset:
|
|
|
168
168
|
]
|
|
169
169
|
)
|
|
170
170
|
|
|
171
|
+
def _set_version_snapshot(self):
|
|
172
|
+
dataset_version_path = (
|
|
173
|
+
self._model.catalog.getPathBuilder()
|
|
174
|
+
.schemas[self._ml_schema]
|
|
175
|
+
.tables["Dataset_Version"]
|
|
176
|
+
)
|
|
177
|
+
versions = dataset_version_path.entities().fetch()
|
|
178
|
+
dataset_version_path.update(
|
|
179
|
+
[
|
|
180
|
+
{"RID": h["RID"], "Snapshot": iso_to_snap(h["RCT"])}
|
|
181
|
+
for h in versions
|
|
182
|
+
if not h["Snapshot"]
|
|
183
|
+
]
|
|
184
|
+
)
|
|
185
|
+
|
|
171
186
|
def dataset_history(self, dataset_rid: RID) -> list[DatasetHistory]:
|
|
172
187
|
"""Return a list of DatasetHistory objects representing the dataset
|
|
173
188
|
|
|
@@ -8,10 +8,11 @@ import warnings
|
|
|
8
8
|
from datetime import date
|
|
9
9
|
from enum import Enum
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Any, Iterable, Optional, Annotated, Generator
|
|
11
|
+
from typing import Any, Iterable, Optional, Annotated, Generator, Iterator
|
|
12
12
|
|
|
13
13
|
import deriva.core.ermrest_model as em
|
|
14
14
|
import deriva.core.utils.hash_utils as hash_utils
|
|
15
|
+
import json
|
|
15
16
|
from urllib.parse import urlparse
|
|
16
17
|
from deriva.core.ermrest_model import builtin_types
|
|
17
18
|
from pydantic import (
|
|
@@ -192,6 +193,24 @@ class FileSpec(BaseModel):
|
|
|
192
193
|
|
|
193
194
|
return (create_spec(file, description) for file in list_all_files(path))
|
|
194
195
|
|
|
196
|
+
@staticmethod
|
|
197
|
+
def read_filespec(path: Path | str) -> Iterator[FileSpec]:
|
|
198
|
+
"""Get FileSpecs from a JSON lines file.
|
|
199
|
+
|
|
200
|
+
Arguments:
|
|
201
|
+
path: Path to the .jsonl file (string or Path).
|
|
202
|
+
|
|
203
|
+
Yields:
|
|
204
|
+
A FileSpec object.
|
|
205
|
+
"""
|
|
206
|
+
path = Path(path)
|
|
207
|
+
with path.open("r", encoding="utf-8") as f:
|
|
208
|
+
for line in f:
|
|
209
|
+
line = line.strip()
|
|
210
|
+
if not line:
|
|
211
|
+
continue
|
|
212
|
+
yield FileSpec(**json.loads(line))
|
|
213
|
+
|
|
195
214
|
|
|
196
215
|
class VocabularyTerm(BaseModel):
|
|
197
216
|
"""An entry in a vocabulary table.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from dateutil.parser import isoparse
|
|
2
3
|
from deriva.core import urlquote
|
|
3
4
|
|
|
4
5
|
|
|
@@ -57,7 +58,7 @@ def datetime_epoch_us(dt):
|
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
def iso_to_snap(iso_datetime):
|
|
60
|
-
rmt = datetime.fromisoformat(iso_datetime)
|
|
61
|
+
rmt = isoparse(iso_datetime) # datetime.fromisoformat(iso_datetime)
|
|
61
62
|
return urlb32_encode(datetime_epoch_us(rmt))
|
|
62
63
|
|
|
63
64
|
|
|
@@ -23,6 +23,7 @@ docs/assets/sharing-at-home.pdf
|
|
|
23
23
|
docs/code-docs/dataset.md
|
|
24
24
|
docs/code-docs/dataset_aux_classes.md
|
|
25
25
|
docs/code-docs/dataset_bag.md
|
|
26
|
+
docs/code-docs/deriva_definitions.md
|
|
26
27
|
docs/code-docs/deriva_ml_base.md
|
|
27
28
|
docs/code-docs/deriva_model.md
|
|
28
29
|
docs/code-docs/execution.md
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|