lamindb 0.76.13__py3-none-any.whl → 0.76.14__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.
- lamindb/__init__.py +1 -1
- lamindb/_artifact.py +4 -6
- lamindb/_collection.py +12 -0
- lamindb/_curate.py +242 -137
- lamindb/_from_values.py +1 -5
- lamindb/_query_set.py +7 -3
- lamindb/_record.py +76 -2
- lamindb/core/__init__.py +2 -0
- lamindb/core/_data.py +19 -7
- lamindb/core/_feature_manager.py +76 -42
- lamindb/core/_label_manager.py +21 -0
- lamindb/core/exceptions.py +7 -0
- lamindb/core/types.py +1 -0
- {lamindb-0.76.13.dist-info → lamindb-0.76.14.dist-info}/METADATA +6 -6
- {lamindb-0.76.13.dist-info → lamindb-0.76.14.dist-info}/RECORD +17 -17
- {lamindb-0.76.13.dist-info → lamindb-0.76.14.dist-info}/LICENSE +0 -0
- {lamindb-0.76.13.dist-info → lamindb-0.76.14.dist-info}/WHEEL +0 -0
lamindb/__init__.py
CHANGED
lamindb/_artifact.py
CHANGED
@@ -925,7 +925,7 @@ def open(
|
|
925
925
|
filepath.name == "soma" or filepath.suffix == ".tiledbsoma"
|
926
926
|
) and mode == "w"
|
927
927
|
# consider the case where an object is already locally cached
|
928
|
-
localpath = setup_settings.
|
928
|
+
localpath = setup_settings.paths.cloud_to_local_no_update(
|
929
929
|
filepath, cache_key=cache_key
|
930
930
|
)
|
931
931
|
if not is_tiledbsoma_w and localpath.exists():
|
@@ -963,12 +963,12 @@ def _synchronize_cleanup_on_error(
|
|
963
963
|
filepath: UPath, cache_key: str | None = None
|
964
964
|
) -> UPath:
|
965
965
|
try:
|
966
|
-
cache_path = setup_settings.
|
966
|
+
cache_path = setup_settings.paths.cloud_to_local(
|
967
967
|
filepath, cache_key=cache_key, print_progress=True
|
968
968
|
)
|
969
969
|
except Exception as e:
|
970
970
|
if not isinstance(filepath, LocalPathClasses):
|
971
|
-
cache_path = setup_settings.
|
971
|
+
cache_path = setup_settings.paths.cloud_to_local_no_update(
|
972
972
|
filepath, cache_key=cache_key
|
973
973
|
)
|
974
974
|
if cache_path.is_file():
|
@@ -1156,9 +1156,7 @@ def _cache_path(self) -> UPath:
|
|
1156
1156
|
)
|
1157
1157
|
if isinstance(filepath, LocalPathClasses):
|
1158
1158
|
return filepath
|
1159
|
-
return setup_settings.
|
1160
|
-
filepath, cache_key=cache_key
|
1161
|
-
)
|
1159
|
+
return setup_settings.paths.cloud_to_local_no_update(filepath, cache_key=cache_key)
|
1162
1160
|
|
1163
1161
|
|
1164
1162
|
# docstring handled through attach_func_to_class_method
|
lamindb/_collection.py
CHANGED
@@ -187,6 +187,16 @@ def __init__(
|
|
187
187
|
_track_run_input(artifacts, run=run)
|
188
188
|
|
189
189
|
|
190
|
+
# docstring handled through attach_func_to_class_method
|
191
|
+
def append(self, artifact: Artifact, run: Run | None = None) -> Collection:
|
192
|
+
return Collection(
|
193
|
+
self.artifacts.all().list() + [artifact],
|
194
|
+
description=self.description,
|
195
|
+
revises=self,
|
196
|
+
run=run,
|
197
|
+
)
|
198
|
+
|
199
|
+
|
190
200
|
# internal function, not exposed to user
|
191
201
|
def from_artifacts(artifacts: Iterable[Artifact]) -> tuple[str, dict[str, str]]:
|
192
202
|
# assert all artifacts are already saved
|
@@ -353,6 +363,7 @@ def restore(self) -> None:
|
|
353
363
|
@doc_args(Collection.ordered_artifacts.__doc__)
|
354
364
|
def ordered_artifacts(self) -> QuerySet:
|
355
365
|
"""{}""" # noqa: D415
|
366
|
+
# tracking is done via QueryManager (_query_manager.py)
|
356
367
|
return self.artifacts.order_by("links_collection__id")
|
357
368
|
|
358
369
|
|
@@ -365,6 +376,7 @@ def data_artifact(self) -> Artifact | None:
|
|
365
376
|
|
366
377
|
METHOD_NAMES = [
|
367
378
|
"__init__",
|
379
|
+
"append",
|
368
380
|
"mapped",
|
369
381
|
"cache",
|
370
382
|
"load",
|