lamindb 1.3.0__py3-none-any.whl → 1.3.2__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 +1 -1
- lamindb/_view.py +2 -2
- lamindb/base/types.py +50 -11
- lamindb/core/types.py +1 -1
- lamindb/curators/__init__.py +232 -222
- lamindb/curators/_cellxgene_schemas/__init__.py +1 -1
- lamindb/models/_feature_manager.py +21 -28
- lamindb/models/_from_values.py +53 -97
- lamindb/models/_label_manager.py +17 -10
- lamindb/models/artifact.py +30 -6
- lamindb/models/can_curate.py +20 -20
- lamindb/models/feature.py +47 -48
- lamindb/models/record.py +34 -28
- lamindb/models/run.py +4 -8
- lamindb/models/schema.py +7 -7
- {lamindb-1.3.0.dist-info → lamindb-1.3.2.dist-info}/METADATA +3 -3
- {lamindb-1.3.0.dist-info → lamindb-1.3.2.dist-info}/RECORD +19 -19
- {lamindb-1.3.0.dist-info → lamindb-1.3.2.dist-info}/LICENSE +0 -0
- {lamindb-1.3.0.dist-info → lamindb-1.3.2.dist-info}/WHEEL +0 -0
lamindb/__init__.py
CHANGED
lamindb/_view.py
CHANGED
@@ -11,7 +11,7 @@ from lamindb_setup._init_instance import get_schema_module_name
|
|
11
11
|
|
12
12
|
from lamindb.models import Feature, FeatureValue, ParamValue, Record
|
13
13
|
|
14
|
-
from .models.feature import
|
14
|
+
from .models.feature import serialize_pandas_dtype
|
15
15
|
|
16
16
|
if TYPE_CHECKING:
|
17
17
|
import pandas as pd
|
@@ -114,7 +114,7 @@ def view(
|
|
114
114
|
"""
|
115
115
|
if df is not None:
|
116
116
|
descriptions = {
|
117
|
-
col_name:
|
117
|
+
col_name: serialize_pandas_dtype(dtype)
|
118
118
|
for col_name, dtype in df.dtypes.to_dict().items()
|
119
119
|
}
|
120
120
|
feature_dtypes = dict(Feature.objects.values_list("name", "dtype"))
|
lamindb/base/types.py
CHANGED
@@ -7,7 +7,7 @@ Central object types.
|
|
7
7
|
|
8
8
|
ArtifactKind
|
9
9
|
TransformType
|
10
|
-
|
10
|
+
Dtype
|
11
11
|
|
12
12
|
Basic types.
|
13
13
|
|
@@ -38,14 +38,53 @@ TransformType = Literal[
|
|
38
38
|
"pipeline", "notebook", "upload", "script", "function", "linker"
|
39
39
|
]
|
40
40
|
ArtifactKind = Literal["dataset", "model"]
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
41
|
+
|
42
|
+
# below is used for Feature.dtype and Param.dtype
|
43
|
+
Dtype = Literal[
|
44
|
+
"cat", # categoricals
|
45
|
+
"num", # numericals
|
46
|
+
"str", # string
|
47
|
+
"int", # integer / numpy.integer
|
48
|
+
"float", # float
|
49
|
+
"bool", # boolean
|
50
|
+
"date", # date
|
51
|
+
"datetime", # datetime
|
52
|
+
"object", # this is a pandas input dtype, we're only using it for complicated types, not for strings
|
51
53
|
]
|
54
|
+
"""Data type.
|
55
|
+
|
56
|
+
Data types in lamindb are a string-serialized abstraction of common data types.
|
57
|
+
|
58
|
+
Overview
|
59
|
+
========
|
60
|
+
|
61
|
+
============ ============ =================================================
|
62
|
+
description lamindb pandas
|
63
|
+
============ ============ =================================================
|
64
|
+
categorical `"cat"` `category`
|
65
|
+
numerical `"num"` `int | float`
|
66
|
+
integer `"int"` `int64 | int32 | int16 | int8 | uint | ...`
|
67
|
+
float `"float"` `float64 | float32 | float16 | float8 | ...`
|
68
|
+
string `"str"` `object`
|
69
|
+
datetime `"datetime"` `datetime`
|
70
|
+
date `"date"` `date`
|
71
|
+
============ ============ =================================================
|
72
|
+
|
73
|
+
Categoricals
|
74
|
+
============
|
75
|
+
|
76
|
+
Beyond indicating that a feature is a categorical, `lamindb` allows you to define the registry to which values are restricted.
|
77
|
+
|
78
|
+
For example, `'cat[ULabel]'` or `'cat[bionty.CellType]'` indicate that permissible values are from the `ULabel` or `CellType` registry, respectively.
|
79
|
+
|
80
|
+
You can also reference multiple registries, e.g., `'cat[ULabel|bionty.CellType]'` indicates that values can be from either registry.
|
81
|
+
|
82
|
+
You can also restrict to sub-types defined in registries via the `type` column, e.g., `'cat[ULabel[CellMedium]]'` indicates that values must be of type `CellMedium` within the `ULabel` registry.
|
83
|
+
|
84
|
+
Literal
|
85
|
+
=======
|
86
|
+
|
87
|
+
A `Dtype` object in `lamindb` is a `Literal` up to further specification of `"cat"`.
|
88
|
+
|
89
|
+
"""
|
90
|
+
FeatureDtype = Dtype # backward compat
|