lamindb 0.76.8__py3-none-any.whl → 0.76.10__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.
Files changed (62) hide show
  1. lamindb/__init__.py +114 -113
  2. lamindb/_artifact.py +1206 -1205
  3. lamindb/_can_validate.py +621 -579
  4. lamindb/_collection.py +390 -387
  5. lamindb/_curate.py +1603 -1601
  6. lamindb/_feature.py +155 -155
  7. lamindb/_feature_set.py +244 -242
  8. lamindb/_filter.py +23 -23
  9. lamindb/_finish.py +250 -256
  10. lamindb/_from_values.py +403 -382
  11. lamindb/_is_versioned.py +40 -40
  12. lamindb/_parents.py +476 -476
  13. lamindb/_query_manager.py +125 -125
  14. lamindb/_query_set.py +364 -362
  15. lamindb/_record.py +668 -649
  16. lamindb/_run.py +60 -57
  17. lamindb/_save.py +310 -308
  18. lamindb/_storage.py +14 -14
  19. lamindb/_transform.py +130 -127
  20. lamindb/_ulabel.py +56 -56
  21. lamindb/_utils.py +9 -9
  22. lamindb/_view.py +72 -72
  23. lamindb/core/__init__.py +94 -94
  24. lamindb/core/_context.py +590 -574
  25. lamindb/core/_data.py +510 -438
  26. lamindb/core/_django.py +209 -0
  27. lamindb/core/_feature_manager.py +994 -867
  28. lamindb/core/_label_manager.py +289 -253
  29. lamindb/core/_mapped_collection.py +631 -597
  30. lamindb/core/_settings.py +188 -187
  31. lamindb/core/_sync_git.py +138 -138
  32. lamindb/core/_track_environment.py +27 -27
  33. lamindb/core/datasets/__init__.py +59 -59
  34. lamindb/core/datasets/_core.py +581 -571
  35. lamindb/core/datasets/_fake.py +36 -36
  36. lamindb/core/exceptions.py +90 -90
  37. lamindb/core/fields.py +12 -12
  38. lamindb/core/loaders.py +164 -164
  39. lamindb/core/schema.py +56 -56
  40. lamindb/core/storage/__init__.py +25 -25
  41. lamindb/core/storage/_anndata_accessor.py +741 -740
  42. lamindb/core/storage/_anndata_sizes.py +41 -41
  43. lamindb/core/storage/_backed_access.py +98 -98
  44. lamindb/core/storage/_tiledbsoma.py +204 -204
  45. lamindb/core/storage/_valid_suffixes.py +21 -21
  46. lamindb/core/storage/_zarr.py +110 -110
  47. lamindb/core/storage/objects.py +62 -62
  48. lamindb/core/storage/paths.py +172 -172
  49. lamindb/core/subsettings/__init__.py +12 -12
  50. lamindb/core/subsettings/_creation_settings.py +38 -38
  51. lamindb/core/subsettings/_transform_settings.py +21 -21
  52. lamindb/core/types.py +19 -19
  53. lamindb/core/versioning.py +146 -158
  54. lamindb/integrations/__init__.py +12 -12
  55. lamindb/integrations/_vitessce.py +107 -107
  56. lamindb/setup/__init__.py +14 -14
  57. lamindb/setup/core/__init__.py +4 -4
  58. {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/LICENSE +201 -201
  59. {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/METADATA +8 -8
  60. lamindb-0.76.10.dist-info/RECORD +61 -0
  61. {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/WHEEL +1 -1
  62. lamindb-0.76.8.dist-info/RECORD +0 -60
lamindb/_is_versioned.py CHANGED
@@ -1,40 +1,40 @@
1
- from __future__ import annotations
2
-
3
- import lamindb_setup as ln_setup
4
- from lamin_utils import logger
5
- from lamindb_setup.core.upath import UPath
6
- from lnschema_core.models import IsVersioned
7
-
8
- from lamindb._utils import attach_func_to_class_method
9
-
10
- from .core.versioning import create_uid, get_new_path_from_uid
11
-
12
-
13
- # docstring handled through attach_func_to_class_method
14
- def _add_to_version_family(self, revises: IsVersioned, version: str | None = None):
15
- old_uid = self.uid
16
- new_uid, revises = create_uid(revises=revises, version=version)
17
- if self.__class__.__name__ == "Artifact" and self._key_is_virtual:
18
- old_path = self.path
19
- new_path = get_new_path_from_uid(
20
- old_path=old_path, old_uid=old_uid, new_uid=new_uid
21
- )
22
- new_path = UPath(old_path).rename(new_path)
23
- logger.success(f"updated path from {old_path} to {new_path}!")
24
- self.uid = new_uid
25
- self.version = version
26
- self.save()
27
- logger.success(f"updated uid from {old_uid} to {new_uid}!")
28
-
29
-
30
- METHOD_NAMES = [
31
- "_add_to_version_family",
32
- ]
33
-
34
- if ln_setup._TESTING: # type: ignore
35
- from inspect import signature
36
-
37
- SIGS = {name: signature(getattr(IsVersioned, name)) for name in METHOD_NAMES}
38
-
39
- for name in METHOD_NAMES:
40
- attach_func_to_class_method(name, IsVersioned, globals())
1
+ from __future__ import annotations
2
+
3
+ import lamindb_setup as ln_setup
4
+ from lamin_utils import logger
5
+ from lamindb_setup.core.upath import UPath
6
+ from lnschema_core.models import IsVersioned
7
+
8
+ from lamindb._utils import attach_func_to_class_method
9
+
10
+ from .core.versioning import create_uid, get_new_path_from_uid
11
+
12
+
13
+ # docstring handled through attach_func_to_class_method
14
+ def _add_to_version_family(self, revises: IsVersioned, version: str | None = None):
15
+ old_uid = self.uid
16
+ new_uid, revises = create_uid(revises=revises, version=version)
17
+ if self.__class__.__name__ == "Artifact" and self._key_is_virtual:
18
+ old_path = self.path
19
+ new_path = get_new_path_from_uid(
20
+ old_path=old_path, old_uid=old_uid, new_uid=new_uid
21
+ )
22
+ new_path = UPath(old_path).rename(new_path)
23
+ logger.success(f"updated path from {old_path} to {new_path}!")
24
+ self.uid = new_uid
25
+ self.version = version
26
+ self.save()
27
+ logger.success(f"updated uid from {old_uid} to {new_uid}!")
28
+
29
+
30
+ METHOD_NAMES = [
31
+ "_add_to_version_family",
32
+ ]
33
+
34
+ if ln_setup._TESTING: # type: ignore
35
+ from inspect import signature
36
+
37
+ SIGS = {name: signature(getattr(IsVersioned, name)) for name in METHOD_NAMES}
38
+
39
+ for name in METHOD_NAMES:
40
+ attach_func_to_class_method(name, IsVersioned, globals())