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.
- lamindb/__init__.py +114 -113
- lamindb/_artifact.py +1206 -1205
- lamindb/_can_validate.py +621 -579
- lamindb/_collection.py +390 -387
- lamindb/_curate.py +1603 -1601
- lamindb/_feature.py +155 -155
- lamindb/_feature_set.py +244 -242
- lamindb/_filter.py +23 -23
- lamindb/_finish.py +250 -256
- lamindb/_from_values.py +403 -382
- lamindb/_is_versioned.py +40 -40
- lamindb/_parents.py +476 -476
- lamindb/_query_manager.py +125 -125
- lamindb/_query_set.py +364 -362
- lamindb/_record.py +668 -649
- lamindb/_run.py +60 -57
- lamindb/_save.py +310 -308
- lamindb/_storage.py +14 -14
- lamindb/_transform.py +130 -127
- lamindb/_ulabel.py +56 -56
- lamindb/_utils.py +9 -9
- lamindb/_view.py +72 -72
- lamindb/core/__init__.py +94 -94
- lamindb/core/_context.py +590 -574
- lamindb/core/_data.py +510 -438
- lamindb/core/_django.py +209 -0
- lamindb/core/_feature_manager.py +994 -867
- lamindb/core/_label_manager.py +289 -253
- lamindb/core/_mapped_collection.py +631 -597
- lamindb/core/_settings.py +188 -187
- lamindb/core/_sync_git.py +138 -138
- lamindb/core/_track_environment.py +27 -27
- lamindb/core/datasets/__init__.py +59 -59
- lamindb/core/datasets/_core.py +581 -571
- lamindb/core/datasets/_fake.py +36 -36
- lamindb/core/exceptions.py +90 -90
- lamindb/core/fields.py +12 -12
- lamindb/core/loaders.py +164 -164
- lamindb/core/schema.py +56 -56
- lamindb/core/storage/__init__.py +25 -25
- lamindb/core/storage/_anndata_accessor.py +741 -740
- lamindb/core/storage/_anndata_sizes.py +41 -41
- lamindb/core/storage/_backed_access.py +98 -98
- lamindb/core/storage/_tiledbsoma.py +204 -204
- lamindb/core/storage/_valid_suffixes.py +21 -21
- lamindb/core/storage/_zarr.py +110 -110
- lamindb/core/storage/objects.py +62 -62
- lamindb/core/storage/paths.py +172 -172
- lamindb/core/subsettings/__init__.py +12 -12
- lamindb/core/subsettings/_creation_settings.py +38 -38
- lamindb/core/subsettings/_transform_settings.py +21 -21
- lamindb/core/types.py +19 -19
- lamindb/core/versioning.py +146 -158
- lamindb/integrations/__init__.py +12 -12
- lamindb/integrations/_vitessce.py +107 -107
- lamindb/setup/__init__.py +14 -14
- lamindb/setup/core/__init__.py +4 -4
- {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/LICENSE +201 -201
- {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/METADATA +8 -8
- lamindb-0.76.10.dist-info/RECORD +61 -0
- {lamindb-0.76.8.dist-info → lamindb-0.76.10.dist-info}/WHEEL +1 -1
- lamindb-0.76.8.dist-info/RECORD +0 -60
lamindb/_run.py
CHANGED
@@ -1,57 +1,60 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from lnschema_core.models import ParamManager, Run, Transform
|
4
|
-
|
5
|
-
|
6
|
-
def __init__(run: Run, *args, **kwargs):
|
7
|
-
run.params = ParamManager(run)
|
8
|
-
if len(args) == len(run._meta.concrete_fields):
|
9
|
-
super(Run, run).__init__(*args, **kwargs)
|
10
|
-
return None
|
11
|
-
# now we proceed with the user-facing constructor
|
12
|
-
if len(args) > 1:
|
13
|
-
raise ValueError("Only one non-keyword arg allowed: transform")
|
14
|
-
transform: Transform = None
|
15
|
-
if "transform" in kwargs or len(args) == 1:
|
16
|
-
transform = kwargs.pop("transform") if len(args) == 0 else args[0]
|
17
|
-
reference: str | None = kwargs.pop("reference") if "reference" in kwargs else None
|
18
|
-
reference_type: str | None = (
|
19
|
-
kwargs.pop("reference_type") if "reference_type" in kwargs else None
|
20
|
-
)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
if
|
42
|
-
run.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
Run.
|
57
|
-
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from lnschema_core.models import ParamManager, Run, Transform
|
4
|
+
|
5
|
+
|
6
|
+
def __init__(run: Run, *args, **kwargs):
|
7
|
+
run.params = ParamManager(run)
|
8
|
+
if len(args) == len(run._meta.concrete_fields):
|
9
|
+
super(Run, run).__init__(*args, **kwargs)
|
10
|
+
return None
|
11
|
+
# now we proceed with the user-facing constructor
|
12
|
+
if len(args) > 1:
|
13
|
+
raise ValueError("Only one non-keyword arg allowed: transform")
|
14
|
+
transform: Transform = None
|
15
|
+
if "transform" in kwargs or len(args) == 1:
|
16
|
+
transform = kwargs.pop("transform") if len(args) == 0 else args[0]
|
17
|
+
reference: str | None = kwargs.pop("reference") if "reference" in kwargs else None
|
18
|
+
reference_type: str | None = (
|
19
|
+
kwargs.pop("reference_type") if "reference_type" in kwargs else None
|
20
|
+
)
|
21
|
+
parent: Run | None = kwargs.pop("parent", None)
|
22
|
+
if transform is None:
|
23
|
+
raise TypeError("Pass transform parameter")
|
24
|
+
if transform._state.adding:
|
25
|
+
raise ValueError("Please save transform record before creating a run")
|
26
|
+
|
27
|
+
super(Run, run).__init__(
|
28
|
+
transform=transform,
|
29
|
+
reference=reference,
|
30
|
+
parent=parent,
|
31
|
+
reference_type=reference_type,
|
32
|
+
)
|
33
|
+
|
34
|
+
|
35
|
+
def delete_run_artifacts(run: Run) -> None:
|
36
|
+
environment = None
|
37
|
+
if run.environment is not None:
|
38
|
+
environment = run.environment
|
39
|
+
run.environment = None
|
40
|
+
report = None
|
41
|
+
if run.report is not None:
|
42
|
+
report = run.report
|
43
|
+
run.report = None
|
44
|
+
if environment is not None or report is not None:
|
45
|
+
run.save()
|
46
|
+
if environment is not None:
|
47
|
+
# only delete if there are no other runs attached to this environment
|
48
|
+
if environment._environment_of.count() == 0:
|
49
|
+
environment.delete(permanent=True)
|
50
|
+
if report is not None:
|
51
|
+
report.delete(permanent=True)
|
52
|
+
|
53
|
+
|
54
|
+
def delete(self) -> None:
|
55
|
+
delete_run_artifacts(self)
|
56
|
+
super(Run, self).delete()
|
57
|
+
|
58
|
+
|
59
|
+
Run.__init__ = __init__
|
60
|
+
Run.delete = delete
|