lamindb 0.71.2__py3-none-any.whl → 0.72.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 +2 -2
- lamindb/_annotate.py +6 -10
- lamindb/_artifact.py +24 -10
- lamindb/_can_validate.py +9 -3
- lamindb/_collection.py +7 -7
- lamindb/_feature.py +53 -45
- lamindb/_feature_set.py +37 -74
- lamindb/_from_values.py +27 -8
- lamindb/_query_manager.py +6 -1
- lamindb/_registry.py +60 -100
- lamindb/_run.py +0 -2
- lamindb/_save.py +28 -11
- lamindb/core/__init__.py +4 -0
- lamindb/core/_data.py +56 -30
- lamindb/core/_feature_manager.py +159 -64
- lamindb/core/_label_manager.py +53 -38
- lamindb/core/_run_context.py +24 -1
- lamindb/core/datasets/_core.py +10 -18
- lamindb/core/schema.py +53 -0
- {lamindb-0.71.2.dist-info → lamindb-0.72.0.dist-info}/METADATA +7 -6
- {lamindb-0.71.2.dist-info → lamindb-0.72.0.dist-info}/RECORD +23 -22
- {lamindb-0.71.2.dist-info → lamindb-0.72.0.dist-info}/LICENSE +0 -0
- {lamindb-0.71.2.dist-info → lamindb-0.72.0.dist-info}/WHEEL +0 -0
lamindb/core/schema.py
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
from typing import Type
|
2
|
+
|
3
|
+
from lnschema_core.models import Feature, FeatureSet, LinkORM, Registry
|
4
|
+
|
5
|
+
|
6
|
+
def dict_schema_name_to_model_name(orm: Type[Registry]) -> dict[str, Registry]:
|
7
|
+
d: dict = {
|
8
|
+
i.related_model.__get_name_with_schema__(): i.related_model
|
9
|
+
for i in orm._meta.related_objects
|
10
|
+
if i.related_name is not None
|
11
|
+
}
|
12
|
+
d.update(
|
13
|
+
{
|
14
|
+
i.related_model.__get_name_with_schema__(): i.related_model
|
15
|
+
for i in orm._meta.many_to_many
|
16
|
+
if i.name is not None
|
17
|
+
}
|
18
|
+
)
|
19
|
+
return d
|
20
|
+
|
21
|
+
|
22
|
+
def dict_related_model_to_related_name(orm: Type[Registry]) -> dict[str, str]:
|
23
|
+
d: dict = {
|
24
|
+
i.related_model.__get_name_with_schema__(): i.related_name
|
25
|
+
for i in orm._meta.related_objects
|
26
|
+
if (i.name is not None and not issubclass(i.related_model, LinkORM))
|
27
|
+
}
|
28
|
+
d.update(
|
29
|
+
{
|
30
|
+
i.related_model.__get_name_with_schema__(): i.name
|
31
|
+
for i in orm._meta.many_to_many
|
32
|
+
if (i.name is not None and not issubclass(i.related_model, LinkORM))
|
33
|
+
}
|
34
|
+
)
|
35
|
+
|
36
|
+
return d
|
37
|
+
|
38
|
+
|
39
|
+
def get_related_name(features_type: type[Registry]) -> str:
|
40
|
+
candidates = [
|
41
|
+
field.related_name
|
42
|
+
for field in FeatureSet._meta.related_objects
|
43
|
+
if field.related_model == features_type
|
44
|
+
]
|
45
|
+
if not candidates:
|
46
|
+
raise ValueError(
|
47
|
+
f"Can't create feature sets from {features_type.__name__} because it's not"
|
48
|
+
" related to it!\nYou need to create a link model between FeatureSet and"
|
49
|
+
" your Registry in your custom schema.\nTo do so, add a"
|
50
|
+
" line:\nfeature_sets = models.ManyToMany(FeatureSet,"
|
51
|
+
" related_name='mythings')\n"
|
52
|
+
)
|
53
|
+
return candidates[0]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lamindb
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.72.0
|
4
4
|
Summary: A data framework for biology.
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
6
6
|
Requires-Python: >=3.8
|
@@ -9,10 +9,10 @@ Classifier: Programming Language :: Python :: 3.8
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.9
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
12
|
-
Requires-Dist: lnschema_core==0.
|
13
|
-
Requires-Dist: lamindb_setup==0.
|
12
|
+
Requires-Dist: lnschema_core==0.67.1
|
13
|
+
Requires-Dist: lamindb_setup==0.72.1
|
14
14
|
Requires-Dist: lamin_utils==0.13.2
|
15
|
-
Requires-Dist: lamin_cli==0.13.
|
15
|
+
Requires-Dist: lamin_cli==0.13.2
|
16
16
|
Requires-Dist: rapidfuzz
|
17
17
|
Requires-Dist: pyarrow
|
18
18
|
Requires-Dist: typing_extensions!=4.6.0
|
@@ -23,8 +23,9 @@ Requires-Dist: fsspec
|
|
23
23
|
Requires-Dist: pandas
|
24
24
|
Requires-Dist: graphviz
|
25
25
|
Requires-Dist: psycopg2-binary
|
26
|
+
Requires-Dist: psutil
|
26
27
|
Requires-Dist: lamindb_setup[aws] ; extra == "aws"
|
27
|
-
Requires-Dist: bionty==0.
|
28
|
+
Requires-Dist: bionty==0.43.0 ; extra == "bionty"
|
28
29
|
Requires-Dist: pandas<2 ; extra == "dev"
|
29
30
|
Requires-Dist: pre-commit ; extra == "dev"
|
30
31
|
Requires-Dist: nox ; extra == "dev"
|
@@ -37,7 +38,7 @@ Requires-Dist: faker-biology ; extra == "dev"
|
|
37
38
|
Requires-Dist: django-schema-graph ; extra == "erdiagram"
|
38
39
|
Requires-Dist: readfcs>=1.1.8 ; extra == "fcs"
|
39
40
|
Requires-Dist: lamindb_setup[gcp] ; extra == "gcp"
|
40
|
-
Requires-Dist: nbproject==0.10.
|
41
|
+
Requires-Dist: nbproject==0.10.3 ; extra == "jupyter"
|
41
42
|
Requires-Dist: nbstripout==0.6.1 ; extra == "jupyter"
|
42
43
|
Requires-Dist: nbconvert ; extra == "jupyter"
|
43
44
|
Requires-Dist: zarr>=2.16.0 ; extra == "zarr"
|
@@ -1,41 +1,42 @@
|
|
1
|
-
lamindb/__init__.py,sha256=
|
2
|
-
lamindb/_annotate.py,sha256=
|
3
|
-
lamindb/_artifact.py,sha256=
|
4
|
-
lamindb/_can_validate.py,sha256=
|
5
|
-
lamindb/_collection.py,sha256=
|
6
|
-
lamindb/_feature.py,sha256=
|
7
|
-
lamindb/_feature_set.py,sha256=
|
1
|
+
lamindb/__init__.py,sha256=BIkb2v3ZeJMt2gk9y1MbuzMNoXNRQAd9ZBDGQCii7Yc,2207
|
2
|
+
lamindb/_annotate.py,sha256=akN5xzOYy_1JytL-f9luxACII5rrktXNYT3LED3EvPQ,43887
|
3
|
+
lamindb/_artifact.py,sha256=tXgHgryFC23ATmuL66PoEoL6Ccbwm3gu0IT36xYDmGY,40630
|
4
|
+
lamindb/_can_validate.py,sha256=s1q0lxplqnhytrVgArBTm05XKMMmpreK0ZlVCsd2jjk,14849
|
5
|
+
lamindb/_collection.py,sha256=L1FMZitXuLfu3-INkDjhS2os42XXZ1tWrTW3rYPic50,14631
|
6
|
+
lamindb/_feature.py,sha256=Aawz4jCgjhuneZnmoty7JkZI3zjA_50vr_0dnFjSN3U,7348
|
7
|
+
lamindb/_feature_set.py,sha256=dbASQtmRNG3yIqXcGXQRx0hLQoKs1u6GZlWvz5U_cTM,8108
|
8
8
|
lamindb/_filter.py,sha256=xnjJzjF3Zj4dK_Kfymvhgczk27MhhXz5ZYc7XINbgHY,1331
|
9
9
|
lamindb/_finish.py,sha256=6GwhqrC-x-JdFd16i7-uyhCWeQgGKxr25aSsSXPZt4g,8598
|
10
|
-
lamindb/_from_values.py,sha256=
|
10
|
+
lamindb/_from_values.py,sha256=DiDGuql1PTSeiYF5amYgvZVFmE34DD2y4FirW9TYMFE,13416
|
11
11
|
lamindb/_is_versioned.py,sha256=0PgRCmxEmYDcAjllLSOYZm132B1lW6QgmBBERhRyFt0,1341
|
12
12
|
lamindb/_parents.py,sha256=N9T8jbd3eaoHDLE9TD1y1QgGcO81E6Brapy8LILzRCQ,14790
|
13
|
-
lamindb/_query_manager.py,sha256=
|
13
|
+
lamindb/_query_manager.py,sha256=DFlfcs6clZGM-qDvDWKvZm4SftHm_1V4nth4YZHEy68,4223
|
14
14
|
lamindb/_query_set.py,sha256=n0owd74cTzGz6-mIv8SlDz0wcyRz7Xw3Ke1LhE8UlIg,10784
|
15
|
-
lamindb/_registry.py,sha256=
|
16
|
-
lamindb/_run.py,sha256=
|
17
|
-
lamindb/_save.py,sha256=
|
15
|
+
lamindb/_registry.py,sha256=Mc74KGt5auJFWWtnG6iwZ-7EVLR89nM67UrC0QC11r4,18362
|
16
|
+
lamindb/_run.py,sha256=b7A52M1On3QzFgIYyfQoz5Kk7V3wcu9p_Prq5bzd8v8,1838
|
17
|
+
lamindb/_save.py,sha256=pksthZrL3SMjLoFGmRNnCO92iXHHHhRk9mpOlW7lXTU,11514
|
18
18
|
lamindb/_storage.py,sha256=VW8xq3VRv58-ciholvOdlcgvp_OIlLxx5GxLt-e2Irs,614
|
19
19
|
lamindb/_transform.py,sha256=E9C7psuOnsNrUQpWRuGgEUM8_pc7YhDn7n4ieHzB4X0,3169
|
20
20
|
lamindb/_ulabel.py,sha256=e5dw9h1tR0_u-DMn7Gzx0WhUhV5w7j4v3QbnLWQV7eI,1941
|
21
21
|
lamindb/_utils.py,sha256=LGdiW4k3GClLz65vKAVRkL6Tw-Gkx9DWAdez1jyA5bE,428
|
22
22
|
lamindb/_view.py,sha256=GV1FrqIMmdooEkA-5zvcTWgV1nqx1sehi6WdWEaFpxM,2171
|
23
|
-
lamindb/core/__init__.py,sha256=
|
24
|
-
lamindb/core/_data.py,sha256=
|
25
|
-
lamindb/core/_feature_manager.py,sha256=
|
26
|
-
lamindb/core/_label_manager.py,sha256=
|
23
|
+
lamindb/core/__init__.py,sha256=hqKb2BZ7llz4XYU-fhWxi-lFQ4yjkDz069GJOh68a6w,1277
|
24
|
+
lamindb/core/_data.py,sha256=fJgLb7fqdArO7HaV6uFW35h4v4-08RpFl85ke9U-2Cw,18759
|
25
|
+
lamindb/core/_feature_manager.py,sha256=HEqwJzBFMqd7RBYCcG4sg8NTdmIILjbUi0wHs5lhbxE,19816
|
26
|
+
lamindb/core/_label_manager.py,sha256=EDM7nLwGYbAN938eMGSRFOaUrUXxJ6ZMijGgheTIGxI,9730
|
27
27
|
lamindb/core/_mapped_collection.py,sha256=_OwFZh5SePDUD70XIK5kngv3we_Z5-YdGHNfpUSatSQ,19469
|
28
|
-
lamindb/core/_run_context.py,sha256=
|
28
|
+
lamindb/core/_run_context.py,sha256=x0nOCCBFiW_bJFwOUeSce66Ek6Y15mXaEoLt-hJNMVI,18000
|
29
29
|
lamindb/core/_settings.py,sha256=rW1KfEXfT56XErwcnSuQxaCytpOy1kJ-u7tVmkmNmxY,6131
|
30
30
|
lamindb/core/_sync_git.py,sha256=06Te35UZj2QBaHNcc59VSC9vJgcFct7Z2sK78NLkZBs,4119
|
31
31
|
lamindb/core/_track_environment.py,sha256=xLZ6kgzxWS6MWZ5LQ_wkbJX99vmYOT8iQ-Fz4OHCgWw,754
|
32
32
|
lamindb/core/_transform_settings.py,sha256=eV96QKX9jOojjzF-a0oo0wXQsMXN2F6QV7orE06oFC8,161
|
33
33
|
lamindb/core/exceptions.py,sha256=PHk5lyBdJPrrEQcid3ItfdNzz3fgiQsUmsEDdz063F0,197
|
34
34
|
lamindb/core/fields.py,sha256=Jgi_XI-iTe6cT7oD8FV_JqEpjN1Q9rZWwL8VLtj4jkA,164
|
35
|
+
lamindb/core/schema.py,sha256=seWCTDetuDpg7UH8UfMByDs4kLFTrLsGB5L2J2zgcoU,1737
|
35
36
|
lamindb/core/types.py,sha256=xeQF2x40p2pR9eIVQrXT74RrS810z2fbjmTRTSQUqPM,230
|
36
37
|
lamindb/core/versioning.py,sha256=T9d28erodCUmFlRA7InralbRoffdniPQxBE7qWqs2u8,3601
|
37
38
|
lamindb/core/datasets/__init__.py,sha256=zRP98oqUAaXhqWyKMiH0s_ImVIuNeziQQ2kQ_t0f-DI,1353
|
38
|
-
lamindb/core/datasets/_core.py,sha256=
|
39
|
+
lamindb/core/datasets/_core.py,sha256=b-Bmv9oQT_dfBq_leTcKiFuXml5tsaiaX5wuggyAqmQ,19869
|
39
40
|
lamindb/core/datasets/_fake.py,sha256=BZF9R_1iF0HDnvtZNqL2FtsjSMuqDIfuFxnw_LJYIh4,953
|
40
41
|
lamindb/core/storage/__init__.py,sha256=5LUFQKRr2BX24d-yWBezhTXBV83sShcOvPj5Y5u6qIg,441
|
41
42
|
lamindb/core/storage/_anndata_sizes.py,sha256=aXO3OB--tF5MChenSsigW6Q-RuE8YJJOUTVukkLrv9A,1029
|
@@ -48,7 +49,7 @@ lamindb/integrations/__init__.py,sha256=aH2PmO2m4-vwIifMYTB0Fyyr_gZWtVnV71jT0tVW
|
|
48
49
|
lamindb/integrations/_vitessce.py,sha256=b0FqTBsP-M6Q7xCYXVwFwM8DOIeeOBZEhYbryhtq4gk,2535
|
49
50
|
lamindb/setup/__init__.py,sha256=OwZpZzPDv5lPPGXZP7-zK6UdO4FHvvuBh439yZvIp3A,410
|
50
51
|
lamindb/setup/core/__init__.py,sha256=SevlVrc2AZWL3uALbE5sopxBnIZPWZ1IB0NBDudiAL8,167
|
51
|
-
lamindb-0.
|
52
|
-
lamindb-0.
|
53
|
-
lamindb-0.
|
54
|
-
lamindb-0.
|
52
|
+
lamindb-0.72.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
53
|
+
lamindb-0.72.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
54
|
+
lamindb-0.72.0.dist-info/METADATA,sha256=cNq8WjpNO8SxpKwpMb4Yc-vzY9VeYcuJ0hjA6ybiw5I,2696
|
55
|
+
lamindb-0.72.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|