lamindb 0.77.2__py3-none-any.whl → 1.0rc1__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 +39 -32
- lamindb/_artifact.py +95 -64
- lamindb/_can_curate.py +19 -10
- lamindb/_collection.py +51 -49
- lamindb/_feature.py +9 -9
- lamindb/_finish.py +99 -86
- lamindb/_from_values.py +20 -17
- lamindb/_is_versioned.py +2 -1
- lamindb/_parents.py +23 -16
- lamindb/_query_manager.py +3 -3
- lamindb/_query_set.py +85 -18
- lamindb/_record.py +121 -46
- lamindb/_run.py +3 -3
- lamindb/_save.py +14 -8
- lamindb/{_feature_set.py → _schema.py} +34 -31
- lamindb/_storage.py +2 -1
- lamindb/_transform.py +51 -23
- lamindb/_ulabel.py +17 -8
- lamindb/_view.py +15 -14
- lamindb/base/__init__.py +24 -0
- lamindb/base/fields.py +281 -0
- lamindb/base/ids.py +103 -0
- lamindb/base/types.py +51 -0
- lamindb/base/users.py +30 -0
- lamindb/base/validation.py +67 -0
- lamindb/core/__init__.py +19 -14
- lamindb/core/_context.py +297 -228
- lamindb/core/_data.py +44 -49
- lamindb/core/_describe.py +41 -31
- lamindb/core/_django.py +59 -44
- lamindb/core/_feature_manager.py +192 -168
- lamindb/core/_label_manager.py +22 -22
- lamindb/core/_mapped_collection.py +17 -14
- lamindb/core/_settings.py +1 -12
- lamindb/core/_sync_git.py +56 -9
- lamindb/core/_track_environment.py +1 -1
- lamindb/core/datasets/_core.py +5 -6
- lamindb/core/exceptions.py +0 -7
- lamindb/core/fields.py +1 -1
- lamindb/core/loaders.py +18 -2
- lamindb/core/{schema.py → relations.py} +22 -19
- lamindb/core/storage/_anndata_accessor.py +1 -2
- lamindb/core/storage/_backed_access.py +2 -1
- lamindb/core/storage/_tiledbsoma.py +40 -13
- lamindb/core/storage/objects.py +1 -1
- lamindb/core/storage/paths.py +13 -8
- lamindb/core/subsettings/__init__.py +0 -2
- lamindb/core/types.py +2 -23
- lamindb/core/versioning.py +11 -7
- lamindb/{_curate.py → curators/__init__.py} +700 -57
- lamindb/curators/_spatial.py +528 -0
- lamindb/integrations/_vitessce.py +1 -3
- lamindb/migrations/0052_squashed.py +1261 -0
- lamindb/migrations/0053_alter_featureset_hash_alter_paramvalue_created_by_and_more.py +57 -0
- lamindb/migrations/0054_alter_feature_previous_runs_and_more.py +35 -0
- lamindb/migrations/0055_artifact_type_artifactparamvalue_and_more.py +61 -0
- lamindb/migrations/0056_rename_ulabel_ref_is_name_artifactulabel_label_ref_is_name_and_more.py +22 -0
- lamindb/migrations/0057_link_models_latest_report_and_others.py +356 -0
- lamindb/migrations/0058_artifact__actions_collection__actions.py +22 -0
- lamindb/migrations/0059_alter_artifact__accessor_alter_artifact__hash_type_and_more.py +31 -0
- lamindb/migrations/0060_alter_artifact__actions.py +22 -0
- lamindb/migrations/0061_alter_collection_meta_artifact_alter_run_environment_and_more.py +45 -0
- lamindb/migrations/0062_add_is_latest_field.py +32 -0
- lamindb/migrations/0063_populate_latest_field.py +45 -0
- lamindb/migrations/0064_alter_artifact_version_alter_collection_version_and_more.py +33 -0
- lamindb/migrations/0065_remove_collection_feature_sets_and_more.py +22 -0
- lamindb/migrations/0066_alter_artifact__feature_values_and_more.py +352 -0
- lamindb/migrations/0067_alter_featurevalue_unique_together_and_more.py +20 -0
- lamindb/migrations/0068_alter_artifactulabel_unique_together_and_more.py +20 -0
- lamindb/migrations/0069_alter_artifact__accessor_alter_artifact__hash_type_and_more.py +1294 -0
- lamindb/migrations/0069_squashed.py +1770 -0
- lamindb/migrations/0070_lamindbv1_migrate_data.py +78 -0
- lamindb/migrations/0071_lamindbv1_migrate_schema.py +741 -0
- lamindb/migrations/0072_remove_user__branch_code_remove_user_aux_and_more.py +148 -0
- lamindb/migrations/0073_merge_ourprojects.py +945 -0
- lamindb/migrations/0074_lamindbv1_part4.py +374 -0
- lamindb/migrations/0075_lamindbv1_part5.py +276 -0
- lamindb/migrations/0076_lamindbv1_part6.py +621 -0
- lamindb/migrations/0077_lamindbv1_part6b.py +228 -0
- lamindb/migrations/0078_lamindbv1_part6c.py +468 -0
- lamindb/migrations/0079_alter_rundata_value_json_and_more.py +36 -0
- lamindb/migrations/__init__.py +0 -0
- lamindb/models.py +4064 -0
- {lamindb-0.77.2.dist-info → lamindb-1.0rc1.dist-info}/METADATA +15 -20
- lamindb-1.0rc1.dist-info/RECORD +100 -0
- {lamindb-0.77.2.dist-info → lamindb-1.0rc1.dist-info}/WHEEL +1 -1
- lamindb/core/subsettings/_transform_settings.py +0 -21
- lamindb-0.77.2.dist-info/RECORD +0 -63
- {lamindb-0.77.2.dist-info → lamindb-1.0rc1.dist-info}/LICENSE +0 -0
lamindb/core/storage/paths.py
CHANGED
@@ -3,20 +3,16 @@ from __future__ import annotations
|
|
3
3
|
import shutil
|
4
4
|
from typing import TYPE_CHECKING
|
5
5
|
|
6
|
-
import anndata as ad
|
7
6
|
import fsspec
|
8
|
-
import pandas as pd
|
9
7
|
from lamin_utils import logger
|
10
8
|
from lamindb_setup.core import StorageSettings
|
11
9
|
from lamindb_setup.core.upath import (
|
12
10
|
LocalPathClasses,
|
13
11
|
UPath,
|
14
|
-
create_path,
|
15
|
-
infer_filesystem,
|
16
12
|
)
|
17
|
-
from lnschema_core.models import Artifact, Storage
|
18
13
|
|
19
14
|
from lamindb.core._settings import settings
|
15
|
+
from lamindb.models import Artifact, Storage
|
20
16
|
|
21
17
|
if TYPE_CHECKING:
|
22
18
|
from pathlib import Path
|
@@ -30,7 +26,7 @@ AUTO_KEY_PREFIX = ".lamindb/"
|
|
30
26
|
# add type annotations back asap when re-organizing the module
|
31
27
|
def auto_storage_key_from_artifact(artifact: Artifact):
|
32
28
|
if artifact.key is None or artifact._key_is_virtual:
|
33
|
-
is_dir = artifact.
|
29
|
+
is_dir = artifact.n_files is not None
|
34
30
|
return auto_storage_key_from_artifact_uid(artifact.uid, artifact.suffix, is_dir)
|
35
31
|
else:
|
36
32
|
return artifact.key
|
@@ -52,10 +48,19 @@ def check_path_is_child_of_root(path: UPathStr, root: UPathStr) -> bool:
|
|
52
48
|
# and for fsspec.utils.get_protocol
|
53
49
|
path_str = str(path)
|
54
50
|
root_str = str(root)
|
51
|
+
root_protocol = fsspec.utils.get_protocol(root_str)
|
55
52
|
# check that the protocols are the same first
|
56
|
-
if fsspec.utils.get_protocol(path_str) !=
|
53
|
+
if fsspec.utils.get_protocol(path_str) != root_protocol:
|
57
54
|
return False
|
58
|
-
|
55
|
+
if root_protocol in {"http", "https"}:
|
56
|
+
# in this case it is a base url, not a file
|
57
|
+
# so formally does not exist
|
58
|
+
resolve_kwargs = {"follow_redirects": False}
|
59
|
+
else:
|
60
|
+
resolve_kwargs = {}
|
61
|
+
return (
|
62
|
+
UPath(root_str).resolve(**resolve_kwargs) in UPath(path_str).resolve().parents
|
63
|
+
)
|
59
64
|
|
60
65
|
|
61
66
|
# returns filepath and root of the storage
|
lamindb/core/types.py
CHANGED
@@ -1,27 +1,6 @@
|
|
1
|
-
"""Types.
|
2
|
-
|
3
|
-
Central object types.
|
4
|
-
|
5
|
-
.. autosummary::
|
6
|
-
:toctree: .
|
7
|
-
|
8
|
-
ArtifactType
|
9
|
-
TransformType
|
10
|
-
FeatureDtype
|
11
|
-
|
12
|
-
Basic types.
|
13
|
-
|
14
|
-
.. autosummary::
|
15
|
-
:toctree: .
|
16
|
-
|
17
|
-
UPathStr
|
18
|
-
StrField
|
19
|
-
ListLike
|
20
|
-
"""
|
21
|
-
|
22
1
|
from lamindb_setup.core.types import UPathStr
|
23
|
-
|
24
|
-
|
2
|
+
|
3
|
+
from lamindb.base.types import (
|
25
4
|
FeatureDtype,
|
26
5
|
FieldAttr,
|
27
6
|
ListLike,
|
lamindb/core/versioning.py
CHANGED
@@ -5,10 +5,11 @@ from typing import TYPE_CHECKING, Literal
|
|
5
5
|
from lamin_utils import logger
|
6
6
|
from lamin_utils._base62 import increment_base62
|
7
7
|
from lamindb_setup.core.upath import LocalPathClasses, UPath
|
8
|
-
|
8
|
+
|
9
|
+
from lamindb.base import ids
|
9
10
|
|
10
11
|
if TYPE_CHECKING:
|
11
|
-
from
|
12
|
+
from lamindb.models import IsVersioned
|
12
13
|
|
13
14
|
|
14
15
|
def message_update_key_in_version_family(
|
@@ -132,15 +133,18 @@ def get_new_path_from_uid(old_path: UPath, old_uid: str, new_uid: str):
|
|
132
133
|
def process_revises(
|
133
134
|
revises: IsVersioned | None,
|
134
135
|
version: str | None,
|
135
|
-
|
136
|
+
key: str | None,
|
137
|
+
description: str | None,
|
136
138
|
type: type[IsVersioned],
|
137
|
-
) -> tuple[str, str, str, IsVersioned | None]:
|
139
|
+
) -> tuple[str, str, str, str, IsVersioned | None]:
|
138
140
|
if revises is not None and not isinstance(revises, type):
|
139
141
|
raise TypeError(f"`revises` has to be of type `{type.__name__}`")
|
140
142
|
uid, revises = create_uid(
|
141
143
|
revises=revises, version=version, n_full_id=type._len_full_uid
|
142
144
|
)
|
143
145
|
if revises is not None:
|
144
|
-
if
|
145
|
-
|
146
|
-
|
146
|
+
if description is None:
|
147
|
+
description = revises.description
|
148
|
+
if key is None:
|
149
|
+
key = revises.key
|
150
|
+
return uid, version, key, description, revises
|