lamindb 1.3.2__py3-none-any.whl → 1.5.0__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 +52 -36
- lamindb/_finish.py +17 -10
- lamindb/_tracked.py +1 -1
- lamindb/base/__init__.py +3 -1
- lamindb/base/fields.py +40 -22
- lamindb/base/ids.py +1 -94
- lamindb/base/types.py +2 -0
- lamindb/base/uids.py +117 -0
- lamindb/core/_context.py +216 -133
- lamindb/core/_settings.py +38 -25
- lamindb/core/datasets/__init__.py +11 -4
- lamindb/core/datasets/_core.py +5 -5
- lamindb/core/datasets/_small.py +0 -93
- lamindb/core/datasets/mini_immuno.py +172 -0
- lamindb/core/loaders.py +1 -1
- lamindb/core/storage/_backed_access.py +100 -6
- lamindb/core/storage/_polars_lazy_df.py +51 -0
- lamindb/core/storage/_pyarrow_dataset.py +15 -30
- lamindb/core/storage/objects.py +6 -0
- lamindb/core/subsettings/__init__.py +2 -0
- lamindb/core/subsettings/_annotation_settings.py +11 -0
- lamindb/curators/__init__.py +7 -3559
- lamindb/curators/_legacy.py +2056 -0
- lamindb/curators/core.py +1546 -0
- lamindb/errors.py +11 -0
- lamindb/examples/__init__.py +27 -0
- lamindb/examples/schemas/__init__.py +12 -0
- lamindb/examples/schemas/_anndata.py +25 -0
- lamindb/examples/schemas/_simple.py +19 -0
- lamindb/integrations/_vitessce.py +8 -5
- lamindb/migrations/0091_alter_featurevalue_options_alter_space_options_and_more.py +24 -0
- lamindb/migrations/0092_alter_artifactfeaturevalue_artifact_and_more.py +75 -0
- lamindb/models/__init__.py +12 -2
- lamindb/models/_describe.py +21 -4
- lamindb/models/_feature_manager.py +384 -301
- lamindb/models/_from_values.py +1 -1
- lamindb/models/_is_versioned.py +5 -15
- lamindb/models/_label_manager.py +8 -2
- lamindb/models/artifact.py +354 -177
- lamindb/models/artifact_set.py +122 -0
- lamindb/models/can_curate.py +4 -1
- lamindb/models/collection.py +79 -56
- lamindb/models/core.py +1 -1
- lamindb/models/feature.py +78 -47
- lamindb/models/has_parents.py +24 -9
- lamindb/models/project.py +3 -3
- lamindb/models/query_manager.py +221 -22
- lamindb/models/query_set.py +251 -206
- lamindb/models/record.py +211 -344
- lamindb/models/run.py +59 -5
- lamindb/models/save.py +9 -5
- lamindb/models/schema.py +673 -196
- lamindb/models/transform.py +5 -14
- lamindb/models/ulabel.py +8 -5
- {lamindb-1.3.2.dist-info → lamindb-1.5.0.dist-info}/METADATA +8 -7
- lamindb-1.5.0.dist-info/RECORD +108 -0
- lamindb-1.3.2.dist-info/RECORD +0 -95
- {lamindb-1.3.2.dist-info → lamindb-1.5.0.dist-info}/LICENSE +0 -0
- {lamindb-1.3.2.dist-info → lamindb-1.5.0.dist-info}/WHEEL +0 -0
lamindb/models/_from_values.py
CHANGED
@@ -85,7 +85,7 @@ def _from_values(
|
|
85
85
|
print_values = colors.yellow(_format_values(unmapped_values))
|
86
86
|
n_nonval = colors.yellow(f"{len(unmapped_values)} non-validated")
|
87
87
|
if not mute:
|
88
|
-
logger.
|
88
|
+
logger.info(
|
89
89
|
f"{colors.red('did not create')} {registry.__name__} record{s} for "
|
90
90
|
f"{n_nonval} {colors.italic(f'{field.field.name}{s}')}: {print_values}" # type: ignore
|
91
91
|
)
|
lamindb/models/_is_versioned.py
CHANGED
@@ -73,11 +73,11 @@ class IsVersioned(models.Model):
|
|
73
73
|
>>> new_artifact = ln.Artifact(df2, revises=artifact).save()
|
74
74
|
>>> new_artifact.versions()
|
75
75
|
"""
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
return (
|
77
|
+
self.__class__.using(self._state.db)
|
78
|
+
.filter(uid__startswith=self.stem_uid)
|
79
|
+
.order_by("-created_at")
|
80
|
+
)
|
81
81
|
|
82
82
|
def _add_to_version_family(self, revises: IsVersioned, version: str | None = None):
|
83
83
|
"""Add current record to a version family.
|
@@ -101,16 +101,6 @@ class IsVersioned(models.Model):
|
|
101
101
|
logger.success(f"updated uid from {old_uid} to {new_uid}!")
|
102
102
|
|
103
103
|
|
104
|
-
def message_update_key_in_version_family(
|
105
|
-
*,
|
106
|
-
suid: str,
|
107
|
-
existing_key: str,
|
108
|
-
registry: str,
|
109
|
-
new_key: str,
|
110
|
-
) -> str:
|
111
|
-
return f'Or update key "{existing_key}" to "{new_key}" for all previous versions:\n\nln.{registry}.filter(uid__startswith="{suid}").update(key="{new_key}")\n'
|
112
|
-
|
113
|
-
|
114
104
|
def bump_version(
|
115
105
|
version: str,
|
116
106
|
bump_type: str = "minor",
|
lamindb/models/_label_manager.py
CHANGED
@@ -24,7 +24,7 @@ from ._describe import (
|
|
24
24
|
TYPE_WIDTH,
|
25
25
|
VALUES_WIDTH,
|
26
26
|
describe_header,
|
27
|
-
|
27
|
+
format_rich_tree,
|
28
28
|
)
|
29
29
|
from ._django import get_artifact_with_related, get_related_model
|
30
30
|
from ._relations import dict_related_model_to_related_name
|
@@ -182,8 +182,14 @@ class LabelManager:
|
|
182
182
|
self._host = host
|
183
183
|
|
184
184
|
def __repr__(self) -> str:
|
185
|
+
return self.describe(return_str=True)
|
186
|
+
|
187
|
+
def describe(self, return_str=True) -> str:
|
188
|
+
"""Describe the labels."""
|
185
189
|
tree = describe_labels(self._host)
|
186
|
-
return
|
190
|
+
return format_rich_tree(
|
191
|
+
tree, fallback="no linked labels", return_str=return_str
|
192
|
+
)
|
187
193
|
|
188
194
|
def add(
|
189
195
|
self,
|