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 CHANGED
@@ -43,7 +43,7 @@ Modules and settings.
43
43
  """
44
44
 
45
45
  # denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
46
- __version__ = "0.76.13"
46
+ __version__ = "0.76.14"
47
47
 
48
48
  import os as _os
49
49
 
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.instance.storage.cloud_to_local_no_update(
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.instance.storage.cloud_to_local(
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.instance.storage.cloud_to_local_no_update(
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.instance.storage.cloud_to_local_no_update(
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",