lamindb-core 2.3a1__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 +239 -0
- lamindb/_finish.py +512 -0
- lamindb/_view.py +166 -0
- lamindb/base/__init__.py +22 -0
- lamindb/base/dtypes.py +98 -0
- lamindb/base/fields.py +296 -0
- lamindb/base/ids.py +1 -0
- lamindb/base/types.py +138 -0
- lamindb/base/uids.py +112 -0
- lamindb/base/users.py +61 -0
- lamindb/base/utils.py +55 -0
- lamindb/core/__init__.py +65 -0
- lamindb/core/_compat.py +60 -0
- lamindb/core/_context.py +1200 -0
- lamindb/core/_functions.py +182 -0
- lamindb/core/_mapped_collection.py +649 -0
- lamindb/core/_settings.py +296 -0
- lamindb/core/_sync_git.py +296 -0
- lamindb/core/_track_environment.py +31 -0
- lamindb/core/exceptions.py +1 -0
- lamindb/core/loaders.py +207 -0
- lamindb/core/storage/__init__.py +20 -0
- lamindb/core/storage/_anndata_accessor.py +898 -0
- lamindb/core/storage/_backed_access.py +224 -0
- lamindb/core/storage/_polars_lazy_df.py +119 -0
- lamindb/core/storage/_pyarrow_dataset.py +41 -0
- lamindb/core/storage/_spatialdata_accessor.py +63 -0
- lamindb/core/storage/_tiledbsoma.py +356 -0
- lamindb/core/storage/_valid_suffixes.py +21 -0
- lamindb/core/storage/_zarr.py +124 -0
- lamindb/core/storage/objects.py +108 -0
- lamindb/core/storage/paths.py +214 -0
- lamindb/core/storage/types.py +15 -0
- lamindb/core/subsettings/__init__.py +9 -0
- lamindb/core/subsettings/_annotation_settings.py +11 -0
- lamindb/core/subsettings/_creation_settings.py +26 -0
- lamindb/curators/__init__.py +52 -0
- lamindb/curators/core.py +2165 -0
- lamindb/errors.py +156 -0
- lamindb/examples/__init__.py +16 -0
- lamindb/examples/cellxgene/__init__.py +11 -0
- lamindb/examples/cellxgene/_cellxgene.py +312 -0
- lamindb/examples/croissant/__init__.py +69 -0
- lamindb/examples/croissant/mini_immuno.anndata.zarr_metadata.json +73 -0
- lamindb/examples/datasets/__init__.py +197 -0
- lamindb/examples/datasets/_core.py +627 -0
- lamindb/examples/datasets/_fake.py +36 -0
- lamindb/examples/datasets/_small.py +141 -0
- lamindb/examples/datasets/define_mini_immuno_features_labels.py +20 -0
- lamindb/examples/datasets/define_mini_immuno_schema_flexible.py +14 -0
- lamindb/examples/datasets/mini_immuno.py +189 -0
- lamindb/examples/datasets/save_mini_immuno_datasets.py +48 -0
- lamindb/examples/fixtures/__init__.py +0 -0
- lamindb/examples/fixtures/sheets.py +291 -0
- lamindb/examples/mlflow/__init__.py +35 -0
- lamindb/examples/schemas/__init__.py +9 -0
- lamindb/examples/schemas/_anndata.py +29 -0
- lamindb/examples/schemas/_simple.py +27 -0
- lamindb/examples/schemas/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py +13 -0
- lamindb/examples/schemas/define_valid_features.py +3 -0
- lamindb/examples/wandb/__init__.py +37 -0
- lamindb/integrations/__init__.py +36 -0
- lamindb/integrations/_croissant.py +145 -0
- lamindb/integrations/_vitessce.py +104 -0
- lamindb/integrations/lightning.py +575 -0
- lamindb/migrations/0177_squashed.py +6148 -0
- lamindb/migrations/0178_v2_2.py +599 -0
- lamindb/migrations/0179_v2_2_part_2.py +60 -0
- lamindb/migrations/0180_v2_2_part_3.py +35 -0
- lamindb/migrations/0181_v2_2_part_4.py +28 -0
- lamindb/migrations/0182_v2_2_part_5.py +311 -0
- lamindb/migrations/0183_squashed.py +6570 -0
- lamindb/migrations/0183_v2_2_part_6.py +19 -0
- lamindb/migrations/README.md +3 -0
- lamindb/migrations/__init__.py +0 -0
- lamindb/models/__init__.py +235 -0
- lamindb/models/_describe.py +663 -0
- lamindb/models/_django.py +416 -0
- lamindb/models/_feature_manager.py +1651 -0
- lamindb/models/_from_values.py +421 -0
- lamindb/models/_is_versioned.py +329 -0
- lamindb/models/_label_manager.py +310 -0
- lamindb/models/_relations.py +116 -0
- lamindb/models/_run_cleanup.py +48 -0
- lamindb/models/artifact.py +3379 -0
- lamindb/models/artifact_set.py +187 -0
- lamindb/models/block.py +514 -0
- lamindb/models/can_curate.py +810 -0
- lamindb/models/collection.py +681 -0
- lamindb/models/feature.py +1562 -0
- lamindb/models/has_parents.py +645 -0
- lamindb/models/project.py +547 -0
- lamindb/models/query_manager.py +347 -0
- lamindb/models/query_set.py +1665 -0
- lamindb/models/record.py +703 -0
- lamindb/models/run.py +612 -0
- lamindb/models/save.py +517 -0
- lamindb/models/schema.py +1343 -0
- lamindb/models/sqlrecord.py +2487 -0
- lamindb/models/storage.py +389 -0
- lamindb/models/transform.py +579 -0
- lamindb/models/ulabel.py +317 -0
- lamindb/py.typed +0 -0
- lamindb/setup/__init__.py +16 -0
- lamindb/setup/_merge.py +95 -0
- lamindb/setup/_switch.py +36 -0
- lamindb/setup/core/__init__.py +4 -0
- lamindb/setup/errors/__init__.py +4 -0
- lamindb/setup/types/__init__.py +4 -0
- lamindb_core-2.3a1.dist-info/LICENSE +201 -0
- lamindb_core-2.3a1.dist-info/METADATA +527 -0
- lamindb_core-2.3a1.dist-info/RECORD +113 -0
- lamindb_core-2.3a1.dist-info/WHEEL +4 -0
lamindb/__init__.py
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"""A data framework for biology.
|
|
2
|
+
|
|
3
|
+
Installation::
|
|
4
|
+
|
|
5
|
+
pip install lamindb
|
|
6
|
+
|
|
7
|
+
If you just want to *read* data from a LaminDB instance, use :class:`~lamindb.DB`::
|
|
8
|
+
|
|
9
|
+
import lamindb as ln
|
|
10
|
+
|
|
11
|
+
db = ln.DB("laminlabs/cellxgene")
|
|
12
|
+
|
|
13
|
+
To *write* data, connect to a writable instance::
|
|
14
|
+
|
|
15
|
+
lamin login
|
|
16
|
+
lamin connect account/name
|
|
17
|
+
|
|
18
|
+
You can create an instance at `lamin.ai <https://lamin.ai>`__ and invite collaborators.
|
|
19
|
+
If you prefer to work with a local database (no login required), run::
|
|
20
|
+
|
|
21
|
+
lamin init --storage ./quickstart-data --modules bionty
|
|
22
|
+
|
|
23
|
+
LaminDB will then auto-connect upon import and you can then create & save objects like this::
|
|
24
|
+
|
|
25
|
+
import lamindb as ln
|
|
26
|
+
# → connected lamindb: account/instance
|
|
27
|
+
|
|
28
|
+
ln.Artifact("./my_dataset.parquet", key="datasets/my_dataset.parquet").save()
|
|
29
|
+
|
|
30
|
+
Lineage
|
|
31
|
+
=======
|
|
32
|
+
|
|
33
|
+
Track inputs, outputs, parameters, and environments of notebooks, scripts, and functions.
|
|
34
|
+
|
|
35
|
+
.. autosummary::
|
|
36
|
+
:toctree: .
|
|
37
|
+
|
|
38
|
+
track
|
|
39
|
+
finish
|
|
40
|
+
flow
|
|
41
|
+
step
|
|
42
|
+
|
|
43
|
+
Artifacts & storage locations
|
|
44
|
+
=============================
|
|
45
|
+
|
|
46
|
+
Files, folders & arrays and their storage locations.
|
|
47
|
+
|
|
48
|
+
.. autosummary::
|
|
49
|
+
:toctree: .
|
|
50
|
+
|
|
51
|
+
Artifact
|
|
52
|
+
Storage
|
|
53
|
+
|
|
54
|
+
Transforms & runs
|
|
55
|
+
=================
|
|
56
|
+
|
|
57
|
+
Data transformations and their executions.
|
|
58
|
+
|
|
59
|
+
.. autosummary::
|
|
60
|
+
:toctree: .
|
|
61
|
+
|
|
62
|
+
Transform
|
|
63
|
+
Run
|
|
64
|
+
|
|
65
|
+
Records, labels, features & schemas
|
|
66
|
+
===================================
|
|
67
|
+
|
|
68
|
+
Create labels and manage flexible records, e.g., for samples or donors.
|
|
69
|
+
|
|
70
|
+
.. autosummary::
|
|
71
|
+
:toctree: .
|
|
72
|
+
|
|
73
|
+
Record
|
|
74
|
+
ULabel
|
|
75
|
+
|
|
76
|
+
Define features & schemas to validate artifacts & records.
|
|
77
|
+
|
|
78
|
+
.. autosummary::
|
|
79
|
+
:toctree: .
|
|
80
|
+
|
|
81
|
+
Feature
|
|
82
|
+
Schema
|
|
83
|
+
|
|
84
|
+
Project management
|
|
85
|
+
==================
|
|
86
|
+
|
|
87
|
+
.. autosummary::
|
|
88
|
+
:toctree: .
|
|
89
|
+
|
|
90
|
+
Branch
|
|
91
|
+
Space
|
|
92
|
+
Project
|
|
93
|
+
User
|
|
94
|
+
Collection
|
|
95
|
+
Reference
|
|
96
|
+
|
|
97
|
+
Basic utilities
|
|
98
|
+
===============
|
|
99
|
+
|
|
100
|
+
Connecting, viewing database content, accessing settings & run context.
|
|
101
|
+
|
|
102
|
+
.. autosummary::
|
|
103
|
+
:toctree: .
|
|
104
|
+
|
|
105
|
+
DB
|
|
106
|
+
connect
|
|
107
|
+
view
|
|
108
|
+
save
|
|
109
|
+
UPath
|
|
110
|
+
settings
|
|
111
|
+
context
|
|
112
|
+
|
|
113
|
+
Curators and integrations
|
|
114
|
+
=========================
|
|
115
|
+
|
|
116
|
+
.. autosummary::
|
|
117
|
+
:toctree: .
|
|
118
|
+
|
|
119
|
+
curators
|
|
120
|
+
integrations
|
|
121
|
+
|
|
122
|
+
Examples, errors & setup
|
|
123
|
+
========================
|
|
124
|
+
|
|
125
|
+
.. autosummary::
|
|
126
|
+
:toctree: .
|
|
127
|
+
|
|
128
|
+
examples
|
|
129
|
+
errors
|
|
130
|
+
setup
|
|
131
|
+
|
|
132
|
+
Developer API
|
|
133
|
+
=============
|
|
134
|
+
|
|
135
|
+
.. autosummary::
|
|
136
|
+
:toctree: .
|
|
137
|
+
|
|
138
|
+
base
|
|
139
|
+
core
|
|
140
|
+
models
|
|
141
|
+
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
# ruff: noqa: I001
|
|
145
|
+
# denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
|
|
146
|
+
__version__ = "2.3a1"
|
|
147
|
+
|
|
148
|
+
import warnings as _warnings
|
|
149
|
+
|
|
150
|
+
# through SpatialData
|
|
151
|
+
_warnings.filterwarnings(
|
|
152
|
+
"ignore", message="The legacy Dask DataFrame implementation is deprecated"
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
from lamindb_setup._check_setup import _check_instance_setup
|
|
156
|
+
from lamindb_setup._connect_instance import connect
|
|
157
|
+
from lamindb_setup.core.upath import UPath
|
|
158
|
+
|
|
159
|
+
from . import base, errors, setup
|
|
160
|
+
|
|
161
|
+
_check_instance_setup(from_module="lamindb")
|
|
162
|
+
|
|
163
|
+
from .core._functions import flow, step, tracked
|
|
164
|
+
from ._view import view
|
|
165
|
+
from .core._context import context
|
|
166
|
+
from .core._settings import settings
|
|
167
|
+
from .models import (
|
|
168
|
+
Artifact,
|
|
169
|
+
Collection,
|
|
170
|
+
Feature,
|
|
171
|
+
Project,
|
|
172
|
+
Reference,
|
|
173
|
+
Run,
|
|
174
|
+
Schema,
|
|
175
|
+
Storage,
|
|
176
|
+
Transform,
|
|
177
|
+
ULabel,
|
|
178
|
+
User,
|
|
179
|
+
Space,
|
|
180
|
+
Branch,
|
|
181
|
+
Record,
|
|
182
|
+
DB,
|
|
183
|
+
)
|
|
184
|
+
from .models.save import save
|
|
185
|
+
from . import core
|
|
186
|
+
from . import integrations
|
|
187
|
+
from . import curators
|
|
188
|
+
from . import examples
|
|
189
|
+
|
|
190
|
+
track = context._track
|
|
191
|
+
finish = context._finish
|
|
192
|
+
settings.__doc__ = """Global live settings (:class:`~lamindb.core.Settings`)."""
|
|
193
|
+
context.__doc__ = """Global run context (:class:`~lamindb.core.Context`)."""
|
|
194
|
+
|
|
195
|
+
from django.db.models import Q
|
|
196
|
+
|
|
197
|
+
Param = Feature # backward compat
|
|
198
|
+
|
|
199
|
+
__all__ = [
|
|
200
|
+
# data lineage
|
|
201
|
+
"track",
|
|
202
|
+
"finish",
|
|
203
|
+
"step",
|
|
204
|
+
"flow",
|
|
205
|
+
# registries
|
|
206
|
+
"Artifact",
|
|
207
|
+
"Storage",
|
|
208
|
+
"Transform",
|
|
209
|
+
"Run",
|
|
210
|
+
"Feature",
|
|
211
|
+
"ULabel",
|
|
212
|
+
"Schema",
|
|
213
|
+
"Record",
|
|
214
|
+
"User",
|
|
215
|
+
"Collection",
|
|
216
|
+
"Project",
|
|
217
|
+
"Space",
|
|
218
|
+
"Branch",
|
|
219
|
+
"Reference",
|
|
220
|
+
# other
|
|
221
|
+
"connect",
|
|
222
|
+
"view",
|
|
223
|
+
"save",
|
|
224
|
+
"UPath",
|
|
225
|
+
"settings",
|
|
226
|
+
"context",
|
|
227
|
+
"DB",
|
|
228
|
+
# curators and integrations
|
|
229
|
+
"curators",
|
|
230
|
+
"integrations",
|
|
231
|
+
# examples, errors, setup
|
|
232
|
+
"examples",
|
|
233
|
+
"errors",
|
|
234
|
+
"setup",
|
|
235
|
+
# low-level functionality
|
|
236
|
+
"base",
|
|
237
|
+
"core",
|
|
238
|
+
"models",
|
|
239
|
+
]
|