deriva-ml 1.13.2__py3-none-any.whl → 1.13.3__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.
@@ -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