deriva-ml 1.13.2__py3-none-any.whl → 1.14.0__py3-none-any.whl
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/database_model.py +5 -11
- deriva_ml/dataset.py +294 -295
- deriva_ml/dataset_aux_classes.py +10 -10
- deriva_ml/demo_catalog.py +90 -67
- deriva_ml/deriva_definitions.py +62 -4
- deriva_ml/deriva_ml_base.py +24 -29
- deriva_ml/deriva_model.py +17 -5
- deriva_ml/execution.py +23 -3
- deriva_ml/history.py +4 -1
- deriva_ml/schema_setup/annotations.py +341 -126
- deriva_ml/schema_setup/create_schema.py +33 -65
- deriva_ml/schema_setup/policy.json +7 -3
- deriva_ml/upload.py +3 -3
- {deriva_ml-1.13.2.dist-info → deriva_ml-1.14.0.dist-info}/METADATA +2 -2
- deriva_ml-1.14.0.dist-info/RECORD +31 -0
- {deriva_ml-1.13.2.dist-info → deriva_ml-1.14.0.dist-info}/WHEEL +1 -1
- deriva_ml-1.13.2.dist-info/RECORD +0 -31
- {deriva_ml-1.13.2.dist-info → deriva_ml-1.14.0.dist-info}/entry_points.txt +0 -0
- {deriva_ml-1.13.2.dist-info → deriva_ml-1.14.0.dist-info}/licenses/LICENSE +0 -0
- {deriva_ml-1.13.2.dist-info → deriva_ml-1.14.0.dist-info}/top_level.txt +0 -0
deriva_ml/database_model.py
CHANGED
|
@@ -19,6 +19,11 @@ from .dataset_aux_classes import DatasetVersion, DatasetMinid
|
|
|
19
19
|
from .deriva_model import DerivaModel
|
|
20
20
|
from .dataset_bag import DatasetBag
|
|
21
21
|
|
|
22
|
+
try:
|
|
23
|
+
from icecream import ic
|
|
24
|
+
except ImportError: # Graceful fallback if IceCream isn't installed.
|
|
25
|
+
ic = lambda *a: None if not a else (a[0] if len(a) == 1 else a) # noqa
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
class DatabaseModelMeta(type):
|
|
24
29
|
"""Use metaclass to ensure that there is onl one instance per path"""
|
|
@@ -103,7 +108,6 @@ class DatabaseModel(DerivaModel, metaclass=DatabaseModelMeta):
|
|
|
103
108
|
)
|
|
104
109
|
|
|
105
110
|
self._logger = logging.getLogger("deriva_ml")
|
|
106
|
-
self.domain_schema = self._guess_domain_schema()
|
|
107
111
|
self._load_model()
|
|
108
112
|
self.ml_schema = ML_SCHEMA
|
|
109
113
|
self._load_sqlite()
|
|
@@ -210,16 +214,6 @@ class DatabaseModel(DerivaModel, metaclass=DatabaseModelMeta):
|
|
|
210
214
|
logging.info(f"No downloaded assets in bag {dataset_rid}")
|
|
211
215
|
return fetch_map
|
|
212
216
|
|
|
213
|
-
def _guess_domain_schema(self) -> str:
|
|
214
|
-
"""Guess the domain schema name by eliminating all the "builtin" schema.
|
|
215
|
-
|
|
216
|
-
Returns:
|
|
217
|
-
String for domain schema name.
|
|
218
|
-
"""
|
|
219
|
-
return [
|
|
220
|
-
s for s in self.model.schemas if s not in ["deriva-ml", "public", "www"]
|
|
221
|
-
][0]
|
|
222
|
-
|
|
223
217
|
def _is_asset(self, table_name: str) -> bool:
|
|
224
218
|
"""
|
|
225
219
|
|