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.
Files changed (113) hide show
  1. lamindb/__init__.py +239 -0
  2. lamindb/_finish.py +512 -0
  3. lamindb/_view.py +166 -0
  4. lamindb/base/__init__.py +22 -0
  5. lamindb/base/dtypes.py +98 -0
  6. lamindb/base/fields.py +296 -0
  7. lamindb/base/ids.py +1 -0
  8. lamindb/base/types.py +138 -0
  9. lamindb/base/uids.py +112 -0
  10. lamindb/base/users.py +61 -0
  11. lamindb/base/utils.py +55 -0
  12. lamindb/core/__init__.py +65 -0
  13. lamindb/core/_compat.py +60 -0
  14. lamindb/core/_context.py +1200 -0
  15. lamindb/core/_functions.py +182 -0
  16. lamindb/core/_mapped_collection.py +649 -0
  17. lamindb/core/_settings.py +296 -0
  18. lamindb/core/_sync_git.py +296 -0
  19. lamindb/core/_track_environment.py +31 -0
  20. lamindb/core/exceptions.py +1 -0
  21. lamindb/core/loaders.py +207 -0
  22. lamindb/core/storage/__init__.py +20 -0
  23. lamindb/core/storage/_anndata_accessor.py +898 -0
  24. lamindb/core/storage/_backed_access.py +224 -0
  25. lamindb/core/storage/_polars_lazy_df.py +119 -0
  26. lamindb/core/storage/_pyarrow_dataset.py +41 -0
  27. lamindb/core/storage/_spatialdata_accessor.py +63 -0
  28. lamindb/core/storage/_tiledbsoma.py +356 -0
  29. lamindb/core/storage/_valid_suffixes.py +21 -0
  30. lamindb/core/storage/_zarr.py +124 -0
  31. lamindb/core/storage/objects.py +108 -0
  32. lamindb/core/storage/paths.py +214 -0
  33. lamindb/core/storage/types.py +15 -0
  34. lamindb/core/subsettings/__init__.py +9 -0
  35. lamindb/core/subsettings/_annotation_settings.py +11 -0
  36. lamindb/core/subsettings/_creation_settings.py +26 -0
  37. lamindb/curators/__init__.py +52 -0
  38. lamindb/curators/core.py +2165 -0
  39. lamindb/errors.py +156 -0
  40. lamindb/examples/__init__.py +16 -0
  41. lamindb/examples/cellxgene/__init__.py +11 -0
  42. lamindb/examples/cellxgene/_cellxgene.py +312 -0
  43. lamindb/examples/croissant/__init__.py +69 -0
  44. lamindb/examples/croissant/mini_immuno.anndata.zarr_metadata.json +73 -0
  45. lamindb/examples/datasets/__init__.py +197 -0
  46. lamindb/examples/datasets/_core.py +627 -0
  47. lamindb/examples/datasets/_fake.py +36 -0
  48. lamindb/examples/datasets/_small.py +141 -0
  49. lamindb/examples/datasets/define_mini_immuno_features_labels.py +20 -0
  50. lamindb/examples/datasets/define_mini_immuno_schema_flexible.py +14 -0
  51. lamindb/examples/datasets/mini_immuno.py +189 -0
  52. lamindb/examples/datasets/save_mini_immuno_datasets.py +48 -0
  53. lamindb/examples/fixtures/__init__.py +0 -0
  54. lamindb/examples/fixtures/sheets.py +291 -0
  55. lamindb/examples/mlflow/__init__.py +35 -0
  56. lamindb/examples/schemas/__init__.py +9 -0
  57. lamindb/examples/schemas/_anndata.py +29 -0
  58. lamindb/examples/schemas/_simple.py +27 -0
  59. lamindb/examples/schemas/define_schema_anndata_ensembl_gene_ids_and_valid_features_in_obs.py +13 -0
  60. lamindb/examples/schemas/define_valid_features.py +3 -0
  61. lamindb/examples/wandb/__init__.py +37 -0
  62. lamindb/integrations/__init__.py +36 -0
  63. lamindb/integrations/_croissant.py +145 -0
  64. lamindb/integrations/_vitessce.py +104 -0
  65. lamindb/integrations/lightning.py +575 -0
  66. lamindb/migrations/0177_squashed.py +6148 -0
  67. lamindb/migrations/0178_v2_2.py +599 -0
  68. lamindb/migrations/0179_v2_2_part_2.py +60 -0
  69. lamindb/migrations/0180_v2_2_part_3.py +35 -0
  70. lamindb/migrations/0181_v2_2_part_4.py +28 -0
  71. lamindb/migrations/0182_v2_2_part_5.py +311 -0
  72. lamindb/migrations/0183_squashed.py +6570 -0
  73. lamindb/migrations/0183_v2_2_part_6.py +19 -0
  74. lamindb/migrations/README.md +3 -0
  75. lamindb/migrations/__init__.py +0 -0
  76. lamindb/models/__init__.py +235 -0
  77. lamindb/models/_describe.py +663 -0
  78. lamindb/models/_django.py +416 -0
  79. lamindb/models/_feature_manager.py +1651 -0
  80. lamindb/models/_from_values.py +421 -0
  81. lamindb/models/_is_versioned.py +329 -0
  82. lamindb/models/_label_manager.py +310 -0
  83. lamindb/models/_relations.py +116 -0
  84. lamindb/models/_run_cleanup.py +48 -0
  85. lamindb/models/artifact.py +3379 -0
  86. lamindb/models/artifact_set.py +187 -0
  87. lamindb/models/block.py +514 -0
  88. lamindb/models/can_curate.py +810 -0
  89. lamindb/models/collection.py +681 -0
  90. lamindb/models/feature.py +1562 -0
  91. lamindb/models/has_parents.py +645 -0
  92. lamindb/models/project.py +547 -0
  93. lamindb/models/query_manager.py +347 -0
  94. lamindb/models/query_set.py +1665 -0
  95. lamindb/models/record.py +703 -0
  96. lamindb/models/run.py +612 -0
  97. lamindb/models/save.py +517 -0
  98. lamindb/models/schema.py +1343 -0
  99. lamindb/models/sqlrecord.py +2487 -0
  100. lamindb/models/storage.py +389 -0
  101. lamindb/models/transform.py +579 -0
  102. lamindb/models/ulabel.py +317 -0
  103. lamindb/py.typed +0 -0
  104. lamindb/setup/__init__.py +16 -0
  105. lamindb/setup/_merge.py +95 -0
  106. lamindb/setup/_switch.py +36 -0
  107. lamindb/setup/core/__init__.py +4 -0
  108. lamindb/setup/errors/__init__.py +4 -0
  109. lamindb/setup/types/__init__.py +4 -0
  110. lamindb_core-2.3a1.dist-info/LICENSE +201 -0
  111. lamindb_core-2.3a1.dist-info/METADATA +527 -0
  112. lamindb_core-2.3a1.dist-info/RECORD +113 -0
  113. 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
+ ]