lamindb 0.76.14__py3-none-any.whl → 0.76.16__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/_artifact.py +44 -35
- lamindb/_can_validate.py +31 -22
- lamindb/_collection.py +6 -5
- lamindb/_curate.py +80 -48
- lamindb/_feature.py +2 -3
- lamindb/_feature_set.py +1 -2
- lamindb/_finish.py +12 -7
- lamindb/_is_versioned.py +1 -2
- lamindb/_parents.py +28 -5
- lamindb/_query_manager.py +1 -2
- lamindb/_query_set.py +51 -6
- lamindb/_record.py +125 -62
- lamindb/_save.py +2 -2
- lamindb/_transform.py +1 -2
- lamindb/_ulabel.py +1 -1
- lamindb/core/_context.py +48 -26
- lamindb/core/_label_manager.py +1 -1
- lamindb/core/_mapped_collection.py +1 -1
- lamindb/core/storage/_anndata_accessor.py +7 -4
- lamindb/core/storage/_backed_access.py +16 -8
- lamindb/core/storage/_pyarrow_dataset.py +31 -0
- {lamindb-0.76.14.dist-info → lamindb-0.76.16.dist-info}/METADATA +20 -9
- {lamindb-0.76.14.dist-info → lamindb-0.76.16.dist-info}/RECORD +26 -26
- lamindb/_filter.py +0 -21
- {lamindb-0.76.14.dist-info → lamindb-0.76.16.dist-info}/LICENSE +0 -0
- {lamindb-0.76.14.dist-info → lamindb-0.76.16.dist-info}/WHEEL +0 -0
lamindb/core/_context.py
CHANGED
@@ -82,11 +82,14 @@ def raise_missing_context(transform_type: str, key: str) -> bool:
|
|
82
82
|
transform = Transform.filter(key=key).latest_version().first()
|
83
83
|
if transform is None:
|
84
84
|
new_uid = f"{base62_12()}0000"
|
85
|
-
message = f'to track this {transform_type},
|
85
|
+
message = f'to track this {transform_type}, run: ln.track("{new_uid}")'
|
86
86
|
else:
|
87
87
|
uid = transform.uid
|
88
88
|
new_uid = f"{uid[:-4]}{increment_base62(uid[-4:])}"
|
89
|
-
message =
|
89
|
+
message = (
|
90
|
+
f"you already have a transform with key '{key}': Transform('{transform.uid[:8]}')\n"
|
91
|
+
f' (1) to make a revision, run: ln.track("{new_uid}")\n (2) to create a new transform, rename your {transform_type} file and re-run: ln.track()'
|
92
|
+
)
|
90
93
|
if transform_type == "notebook":
|
91
94
|
print(f"→ {message}")
|
92
95
|
response = input("→ Ready to re-run? (y/n)")
|
@@ -118,6 +121,8 @@ class Context:
|
|
118
121
|
Enables convenient data lineage tracking by managing a transform & run
|
119
122
|
upon :meth:`~lamindb.core.Context.track` & :meth:`~lamindb.core.Context.finish`.
|
120
123
|
|
124
|
+
Guide: :doc:`/track`
|
125
|
+
|
121
126
|
Examples:
|
122
127
|
|
123
128
|
Is typically used via the global :class:`~lamindb.context` object via `ln.track()` and `ln.finish()`:
|
@@ -137,7 +142,8 @@ class Context:
|
|
137
142
|
self._run: Run | None = None
|
138
143
|
self._path: Path | None = None
|
139
144
|
"""A local path to the script that's running."""
|
140
|
-
self.
|
145
|
+
self._logging_message_track: str = ""
|
146
|
+
self._logging_message_imports: str = ""
|
141
147
|
|
142
148
|
@property
|
143
149
|
def transform(self) -> Transform | None:
|
@@ -178,12 +184,11 @@ class Context:
|
|
178
184
|
|
179
185
|
def track(
|
180
186
|
self,
|
181
|
-
|
187
|
+
transform: str | Transform | None = None,
|
182
188
|
*,
|
183
189
|
params: dict | None = None,
|
184
190
|
new_run: bool | None = None,
|
185
191
|
path: str | None = None,
|
186
|
-
transform: Transform | None = None,
|
187
192
|
) -> None:
|
188
193
|
"""Initiate a run with tracked data lineage.
|
189
194
|
|
@@ -196,24 +201,31 @@ class Context:
|
|
196
201
|
script-like transform exists in a git repository and links it.
|
197
202
|
|
198
203
|
Args:
|
199
|
-
|
204
|
+
transform: A transform `uid` or record. If `None`, creates a `uid`.
|
200
205
|
params: A dictionary of parameters to track for the run.
|
201
206
|
new_run: If `False`, loads latest run of transform
|
202
207
|
(default notebook), if `True`, creates new run (default pipeline).
|
203
208
|
path: Filepath of notebook or script. Only needed if it can't be
|
204
209
|
automatically detected.
|
205
|
-
transform: Useful to track an abstract pipeline.
|
206
210
|
|
207
211
|
Examples:
|
208
212
|
|
209
|
-
To
|
213
|
+
To create a transform `uid` for tracking a script or notebook, call:
|
210
214
|
|
211
|
-
>>> import lamindb as ln
|
212
215
|
>>> ln.track()
|
213
216
|
|
217
|
+
To track the run of a notebook or script, call:
|
218
|
+
|
219
|
+
>>> ln.track("FPnfDtJz8qbE0000") # replace with your uid
|
220
|
+
|
214
221
|
"""
|
215
|
-
|
222
|
+
self._logging_message_track = ""
|
223
|
+
self._logging_message_imports = ""
|
224
|
+
uid = None
|
225
|
+
if transform is not None and isinstance(transform, str):
|
226
|
+
uid = transform
|
216
227
|
self.uid = uid
|
228
|
+
transform = None
|
217
229
|
self._path = None
|
218
230
|
if transform is None:
|
219
231
|
is_tracked = False
|
@@ -223,17 +235,20 @@ class Context:
|
|
223
235
|
)
|
224
236
|
transform = None
|
225
237
|
stem_uid = None
|
238
|
+
# you can set ln.context.uid and then call ln.track() without passing anythin
|
239
|
+
# that has been the preferred syntax for a while; we'll likely
|
240
|
+
# deprecate it at some point
|
226
241
|
if uid is not None or self.uid is not None:
|
227
242
|
transform = Transform.filter(uid=self.uid).one_or_none()
|
228
243
|
if self.version is not None:
|
229
244
|
# test inconsistent version passed
|
230
245
|
if (
|
231
246
|
transform is not None
|
232
|
-
and transform.version is not None
|
233
|
-
and self.version != transform.version
|
247
|
+
and transform.version is not None # type: ignore
|
248
|
+
and self.version != transform.version # type: ignore
|
234
249
|
):
|
235
250
|
raise SystemExit(
|
236
|
-
f"Please pass consistent version: ln.context.version = '{transform.version}'"
|
251
|
+
f"Please pass consistent version: ln.context.version = '{transform.version}'" # type: ignore
|
237
252
|
)
|
238
253
|
# test whether version was already used for another member of the family
|
239
254
|
suid, vuid = (
|
@@ -302,10 +317,14 @@ class Context:
|
|
302
317
|
transform_exists = Transform.filter(id=transform.id).first()
|
303
318
|
if transform_exists is None:
|
304
319
|
transform.save()
|
305
|
-
self.
|
320
|
+
self._logging_message_track += (
|
321
|
+
f"created Transform('{transform.uid[:8]}')"
|
322
|
+
)
|
306
323
|
transform_exists = transform
|
307
324
|
else:
|
308
|
-
self.
|
325
|
+
self._logging_message_track += (
|
326
|
+
f"loaded Transform('{transform.uid[:8]}')"
|
327
|
+
)
|
309
328
|
self._transform = transform_exists
|
310
329
|
|
311
330
|
if new_run is None: # for notebooks, default to loading latest runs
|
@@ -322,7 +341,7 @@ class Context:
|
|
322
341
|
)
|
323
342
|
if run is not None: # loaded latest run
|
324
343
|
run.started_at = datetime.now(timezone.utc) # update run time
|
325
|
-
self.
|
344
|
+
self._logging_message_track += f", started Run('{run.uid[:8]}') at {format_field_value(run.started_at)}"
|
326
345
|
|
327
346
|
if run is None: # create new run
|
328
347
|
run = Run(
|
@@ -330,7 +349,7 @@ class Context:
|
|
330
349
|
params=params,
|
331
350
|
)
|
332
351
|
run.started_at = datetime.now(timezone.utc)
|
333
|
-
self.
|
352
|
+
self._logging_message_track += f", started new Run('{run.uid[:8]}') at {format_field_value(run.started_at)}"
|
334
353
|
# can only determine at ln.finish() if run was consecutive in
|
335
354
|
# interactive session, otherwise, is consecutive
|
336
355
|
run.is_consecutive = True if is_run_from_ipython else None
|
@@ -338,13 +357,14 @@ class Context:
|
|
338
357
|
run.save()
|
339
358
|
if params is not None:
|
340
359
|
run.params.add_values(params)
|
341
|
-
self.
|
360
|
+
self._logging_message_track += "\n→ params: " + " ".join(
|
342
361
|
f"{key}='{value}'" for key, value in params.items()
|
343
362
|
)
|
344
363
|
self._run = run
|
345
364
|
track_environment(run)
|
346
|
-
logger.important(self.
|
347
|
-
self.
|
365
|
+
logger.important(self._logging_message_track)
|
366
|
+
if self._logging_message_imports:
|
367
|
+
logger.important(self._logging_message_imports)
|
348
368
|
|
349
369
|
def _track_script(
|
350
370
|
self,
|
@@ -406,9 +426,9 @@ class Context:
|
|
406
426
|
from nbproject.dev._pypackage import infer_pypackages
|
407
427
|
|
408
428
|
nb = nbproject.dev.read_notebook(path_str)
|
409
|
-
|
429
|
+
self._logging_message_imports += (
|
410
430
|
"notebook imports:"
|
411
|
-
f" {pretty_pypackages(infer_pypackages(nb, pin_versions=True))}"
|
431
|
+
f" {pretty_pypackages(infer_pypackages(nb, pin_versions=True))}\n"
|
412
432
|
)
|
413
433
|
except Exception:
|
414
434
|
logger.debug("inferring imported packages failed")
|
@@ -471,7 +491,7 @@ class Context:
|
|
471
491
|
raise_update_context = True
|
472
492
|
if raise_update_context:
|
473
493
|
raise UpdateContext(get_key_clashing_message(revises, key))
|
474
|
-
self.
|
494
|
+
self._logging_message_track += f"created Transform('{transform.uid[:8]}')"
|
475
495
|
else:
|
476
496
|
uid = transform.uid
|
477
497
|
# transform was already saved via `finish()`
|
@@ -485,7 +505,7 @@ class Context:
|
|
485
505
|
elif transform.name != name:
|
486
506
|
transform.name = name
|
487
507
|
transform.save()
|
488
|
-
self.
|
508
|
+
self._logging_message_track += (
|
489
509
|
"updated transform name, " # white space on purpose
|
490
510
|
)
|
491
511
|
elif (
|
@@ -509,7 +529,7 @@ class Context:
|
|
509
529
|
if condition:
|
510
530
|
bump_revision = True
|
511
531
|
else:
|
512
|
-
self.
|
532
|
+
self._logging_message_track += (
|
513
533
|
f"loaded Transform('{transform.uid[:8]}')"
|
514
534
|
)
|
515
535
|
if bump_revision:
|
@@ -523,7 +543,9 @@ class Context:
|
|
523
543
|
f'ln.track("{uid[:-4]}{increment_base62(uid[-4:])}")'
|
524
544
|
)
|
525
545
|
else:
|
526
|
-
self.
|
546
|
+
self._logging_message_track += (
|
547
|
+
f"loaded Transform('{transform.uid[:8]}')"
|
548
|
+
)
|
527
549
|
self._transform = transform
|
528
550
|
|
529
551
|
def finish(self, ignore_non_consecutive: None | bool = None) -> None:
|
lamindb/core/_label_manager.py
CHANGED
@@ -202,7 +202,7 @@ class LabelManager:
|
|
202
202
|
transfer_logs = {"mapped": [], "transferred": [], "run": None}
|
203
203
|
using_key = settings._using_key
|
204
204
|
for related_name, (_, labels) in get_labels_as_dict(
|
205
|
-
data, instance=
|
205
|
+
data, instance=data._state.db
|
206
206
|
).items():
|
207
207
|
labels = labels.all()
|
208
208
|
if not labels.exists():
|
@@ -54,13 +54,16 @@ if anndata_version_parse < version.parse("0.10.0"):
|
|
54
54
|
return SparseDataset(group)
|
55
55
|
|
56
56
|
else:
|
57
|
+
if anndata_version_parse >= version.parse("0.11.0"):
|
58
|
+
from anndata._core.sparse_dataset import ( # type: ignore
|
59
|
+
_CSRDataset as CSRDataset,
|
60
|
+
)
|
61
|
+
else:
|
62
|
+
from anndata._core.sparse_dataset import CSRDataset # type: ignore
|
57
63
|
from anndata._core.sparse_dataset import (
|
58
64
|
BaseCompressedSparseDataset as SparseDataset,
|
59
65
|
)
|
60
|
-
from anndata._core.sparse_dataset import
|
61
|
-
CSRDataset,
|
62
|
-
sparse_dataset,
|
63
|
-
)
|
66
|
+
from anndata._core.sparse_dataset import sparse_dataset # type: ignore
|
64
67
|
|
65
68
|
def _check_group_format(*args):
|
66
69
|
pass
|
@@ -7,11 +7,13 @@ from anndata._io.specs.registry import get_spec
|
|
7
7
|
from lnschema_core import Artifact
|
8
8
|
|
9
9
|
from ._anndata_accessor import AnnDataAccessor, StorageType, registry
|
10
|
+
from ._pyarrow_dataset import _is_pyarrow_dataset, _open_pyarrow_dataset
|
10
11
|
from ._tiledbsoma import _open_tiledbsoma
|
11
12
|
from .paths import filepath_from_artifact
|
12
13
|
|
13
14
|
if TYPE_CHECKING:
|
14
15
|
from fsspec.core import OpenFile
|
16
|
+
from pyarrow.dataset import Dataset as PyArrowDataset
|
15
17
|
from tiledbsoma import Collection as SOMACollection
|
16
18
|
from tiledbsoma import Experiment as SOMAExperiment
|
17
19
|
from upath import UPath
|
@@ -67,22 +69,28 @@ def backed_access(
|
|
67
69
|
artifact_or_filepath: Artifact | UPath,
|
68
70
|
mode: str = "r",
|
69
71
|
using_key: str | None = None,
|
70
|
-
) ->
|
72
|
+
) -> (
|
73
|
+
AnnDataAccessor | BackedAccessor | SOMACollection | SOMAExperiment | PyArrowDataset
|
74
|
+
):
|
71
75
|
if isinstance(artifact_or_filepath, Artifact):
|
72
|
-
|
76
|
+
objectpath, _ = filepath_from_artifact(
|
77
|
+
artifact_or_filepath, using_key=using_key
|
78
|
+
)
|
73
79
|
else:
|
74
|
-
|
75
|
-
name =
|
76
|
-
suffix =
|
80
|
+
objectpath = artifact_or_filepath
|
81
|
+
name = objectpath.name
|
82
|
+
suffix = objectpath.suffix
|
77
83
|
|
78
84
|
if name == "soma" or suffix == ".tiledbsoma":
|
79
85
|
if mode not in {"r", "w"}:
|
80
86
|
raise ValueError("`mode` should be either 'r' or 'w' for tiledbsoma.")
|
81
|
-
return _open_tiledbsoma(
|
87
|
+
return _open_tiledbsoma(objectpath, mode=mode) # type: ignore
|
82
88
|
elif suffix in {".h5", ".hdf5", ".h5ad"}:
|
83
|
-
conn, storage = registry.open("h5py",
|
89
|
+
conn, storage = registry.open("h5py", objectpath, mode=mode)
|
84
90
|
elif suffix == ".zarr":
|
85
|
-
conn, storage = registry.open("zarr",
|
91
|
+
conn, storage = registry.open("zarr", objectpath, mode=mode)
|
92
|
+
elif _is_pyarrow_dataset(objectpath):
|
93
|
+
return _open_pyarrow_dataset(objectpath)
|
86
94
|
else:
|
87
95
|
raise ValueError(
|
88
96
|
"object should have .h5, .hdf5, .h5ad, .zarr, .tiledbsoma suffix, not"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import TYPE_CHECKING
|
4
|
+
|
5
|
+
import pyarrow.dataset
|
6
|
+
from lamindb_setup.core.upath import LocalPathClasses
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from upath import UPath
|
10
|
+
|
11
|
+
|
12
|
+
PYARROW_SUFFIXES = (".parquet", ".csv", ".json", ".orc", ".arrow", ".feather")
|
13
|
+
|
14
|
+
|
15
|
+
def _is_pyarrow_dataset(path: UPath) -> bool:
|
16
|
+
# it is assumed here that path exists
|
17
|
+
if path.is_file():
|
18
|
+
return path.suffix in PYARROW_SUFFIXES
|
19
|
+
else:
|
20
|
+
objects = path.rglob("*")
|
21
|
+
suffixes = {object.suffix for object in objects if object.suffix != ""}
|
22
|
+
return len(suffixes) == 1 and suffixes.pop() in PYARROW_SUFFIXES
|
23
|
+
|
24
|
+
|
25
|
+
def _open_pyarrow_dataset(path: UPath) -> pyarrow.dataset.Dataset:
|
26
|
+
if isinstance(path, LocalPathClasses):
|
27
|
+
path_str, filesystem = path.as_posix(), None
|
28
|
+
else:
|
29
|
+
path_str, filesystem = path.path, path.fs
|
30
|
+
|
31
|
+
return pyarrow.dataset.dataset(path_str, filesystem=filesystem)
|
@@ -1,29 +1,30 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lamindb
|
3
|
-
Version: 0.76.
|
3
|
+
Version: 0.76.16
|
4
4
|
Summary: A data framework for biology.
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
6
|
-
Requires-Python: >=3.9
|
6
|
+
Requires-Python: >=3.9,<3.13
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
Classifier: Programming Language :: Python :: 3.9
|
9
9
|
Classifier: Programming Language :: Python :: 3.10
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
11
|
-
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
12
|
+
Requires-Dist: lnschema_core==0.76.2
|
12
13
|
Requires-Dist: lamin_utils==0.13.7
|
13
|
-
Requires-Dist: lamin_cli==0.
|
14
|
+
Requires-Dist: lamin_cli==0.21.2
|
14
15
|
Requires-Dist: lamindb_setup
|
15
16
|
Requires-Dist: rapidfuzz
|
16
17
|
Requires-Dist: pyarrow
|
17
18
|
Requires-Dist: typing_extensions!=4.6.0
|
18
19
|
Requires-Dist: python-dateutil
|
19
|
-
Requires-Dist: anndata>=0.8.0,<=0.
|
20
|
-
Requires-Dist: scipy<1.13.0rc1
|
20
|
+
Requires-Dist: anndata>=0.8.0,<=0.11.1
|
21
21
|
Requires-Dist: fsspec
|
22
|
-
Requires-Dist: pandas
|
23
22
|
Requires-Dist: graphviz
|
24
23
|
Requires-Dist: psycopg2-binary
|
25
24
|
Requires-Dist: lamindb_setup[aws] ; extra == "aws"
|
26
|
-
Requires-Dist: bionty==0.52.
|
25
|
+
Requires-Dist: bionty==0.52.1 ; extra == "bionty"
|
26
|
+
Requires-Dist: cellregistry ; extra == "cellregistry"
|
27
|
+
Requires-Dist: clinicore ; extra == "clinicore"
|
27
28
|
Requires-Dist: line_profiler ; extra == "dev"
|
28
29
|
Requires-Dist: pre-commit ; extra == "dev"
|
29
30
|
Requires-Dist: nox ; extra == "dev"
|
@@ -35,20 +36,30 @@ Requires-Dist: mudata ; extra == "dev"
|
|
35
36
|
Requires-Dist: nbproject_test>=0.5.1 ; extra == "dev"
|
36
37
|
Requires-Dist: faker-biology ; extra == "dev"
|
37
38
|
Requires-Dist: django-schema-graph ; extra == "erdiagram"
|
38
|
-
Requires-Dist: readfcs>=1.1.
|
39
|
+
Requires-Dist: readfcs>=1.1.9 ; extra == "fcs"
|
40
|
+
Requires-Dist: findrefs ; extra == "findrefs"
|
39
41
|
Requires-Dist: lamindb_setup[gcp] ; extra == "gcp"
|
40
42
|
Requires-Dist: nbproject==0.10.5 ; extra == "jupyter"
|
41
43
|
Requires-Dist: jupytext ; extra == "jupyter"
|
42
44
|
Requires-Dist: nbconvert ; extra == "jupyter"
|
45
|
+
Requires-Dist: omop ; extra == "omop"
|
46
|
+
Requires-Dist: ourprojects ; extra == "ourprojects"
|
47
|
+
Requires-Dist: wetlab ; extra == "wetlab"
|
43
48
|
Requires-Dist: zarr>=2.16.0 ; extra == "zarr"
|
44
49
|
Project-URL: Home, https://github.com/laminlabs/lamindb
|
45
50
|
Provides-Extra: aws
|
46
51
|
Provides-Extra: bionty
|
52
|
+
Provides-Extra: cellregistry
|
53
|
+
Provides-Extra: clinicore
|
47
54
|
Provides-Extra: dev
|
48
55
|
Provides-Extra: erdiagram
|
49
56
|
Provides-Extra: fcs
|
57
|
+
Provides-Extra: findrefs
|
50
58
|
Provides-Extra: gcp
|
51
59
|
Provides-Extra: jupyter
|
60
|
+
Provides-Extra: omop
|
61
|
+
Provides-Extra: ourprojects
|
62
|
+
Provides-Extra: wetlab
|
52
63
|
Provides-Extra: zarr
|
53
64
|
|
54
65
|
[](https://github.com/laminlabs/lamindb)
|
@@ -1,32 +1,31 @@
|
|
1
|
-
lamindb/__init__.py,sha256=
|
2
|
-
lamindb/_artifact.py,sha256=
|
3
|
-
lamindb/_can_validate.py,sha256=
|
4
|
-
lamindb/_collection.py,sha256=
|
5
|
-
lamindb/_curate.py,sha256=
|
6
|
-
lamindb/_feature.py,sha256=
|
7
|
-
lamindb/_feature_set.py,sha256=
|
8
|
-
lamindb/
|
9
|
-
lamindb/_finish.py,sha256=VMAmxCUFmTKIMSCx7LEh4QAnWDeue6MeUAAzkMVEYMU,9546
|
1
|
+
lamindb/__init__.py,sha256=kJTUjuddkfht0Wb1zhHebfdwK5q1CGpluwZwj8cvYfs,2278
|
2
|
+
lamindb/_artifact.py,sha256=4sHLnJQdWAjplB-dk0JXzhrHaaDn2ri5SeyvA7yzajQ,45166
|
3
|
+
lamindb/_can_validate.py,sha256=zRmSOJqPwwHcmRHDH18Dbn6eklY62vgiLpyKgvXpbLU,19956
|
4
|
+
lamindb/_collection.py,sha256=MLOEoOgTu7rTlRD7zkm1k0YIk_gVhQDO17JbmZCptOs,14573
|
5
|
+
lamindb/_curate.py,sha256=aBpw0RdzDeFd4NdMzr5d4ZbpwOinONwcELnEy_odSNw,64493
|
6
|
+
lamindb/_feature.py,sha256=9cgrcHoyOa1jpON-9KiUfFSHcxiGECiefUAqAx4cVvU,5325
|
7
|
+
lamindb/_feature_set.py,sha256=WdXw_YGlMXCs8l0WVHOrqvvrH2hsQLqCiho8LFDYwhI,8161
|
8
|
+
lamindb/_finish.py,sha256=r8q6rhml2vHiDlojCnfSpS8pbfnq7u6MwIcBIwuVq2o,9745
|
10
9
|
lamindb/_from_values.py,sha256=uRtZLaMWKoANMMXm1hrADHfckRCTiK8_d02Yp07nLkw,14119
|
11
|
-
lamindb/_is_versioned.py,sha256=
|
12
|
-
lamindb/_parents.py,sha256=
|
13
|
-
lamindb/_query_manager.py,sha256=
|
14
|
-
lamindb/_query_set.py,sha256=
|
15
|
-
lamindb/_record.py,sha256=
|
10
|
+
lamindb/_is_versioned.py,sha256=GWZk-usV6aB33Cl9AlrnEGE5nxUkZic7QJzOW_DrwQA,1298
|
11
|
+
lamindb/_parents.py,sha256=INhbqh6IaUjuYVUOp-6rnOGN-8kGZirNqqW9XQ1qz_M,17119
|
12
|
+
lamindb/_query_manager.py,sha256=noc05Ad-aADxckOVBVDAiErFB7gL8XTgckELvI4rGmM,3702
|
13
|
+
lamindb/_query_set.py,sha256=xcGQZvWIGM9gQPtES3jQjZL_wCaUAp-ZNeVb1Kv-Ado,14682
|
14
|
+
lamindb/_record.py,sha256=nVkVnOcVFxVyE5a1boXtKp4i4idlIJHJevXfHiwoxSk,29149
|
16
15
|
lamindb/_run.py,sha256=K_5drpLn3D7y3XtZ3vtAw35rG5RCSvB4bXQZx4ESSI0,1964
|
17
|
-
lamindb/_save.py,sha256=
|
16
|
+
lamindb/_save.py,sha256=OD052Qr_hiMyAonHTktKETe_Bhnp1RY810y0rwZqpBQ,11352
|
18
17
|
lamindb/_storage.py,sha256=GBVChv-DHVMNEBJL5l_JT6B4RDhZ6NnwgzmUICphYKk,413
|
19
|
-
lamindb/_transform.py,sha256=
|
20
|
-
lamindb/_ulabel.py,sha256=
|
18
|
+
lamindb/_transform.py,sha256=HpqRCk0ZTmqxSV4nRbyvDq8fAQEE9wTj31d-CusiL6A,4720
|
19
|
+
lamindb/_ulabel.py,sha256=DQQzAPkrOg8W9I77BJ5umajR8MQcFSvXYUy53YNN2HA,1604
|
21
20
|
lamindb/_utils.py,sha256=LGdiW4k3GClLz65vKAVRkL6Tw-Gkx9DWAdez1jyA5bE,428
|
22
21
|
lamindb/_view.py,sha256=4Ln2ItTb3857PAI-70O8eJYqoTJ_NNFc7E_wds6OGns,2412
|
23
22
|
lamindb/core/__init__.py,sha256=y87MCP1BEC2qHNVDIOwqVteIP_2hPCdIoa9JXr0EG8U,1524
|
24
|
-
lamindb/core/_context.py,sha256=
|
23
|
+
lamindb/core/_context.py,sha256=6TJzCA88F4LUxLXBVpJ0UAeKhHgL8WieKgsbXmVtlnU,23803
|
25
24
|
lamindb/core/_data.py,sha256=BVZkxK8aloSecH25LivbwnjcG1fz7Gs2UDceO5pWd3I,20049
|
26
25
|
lamindb/core/_django.py,sha256=yeMPp1n9WrFmEjVRdavfpVqAolPLd24RseTQlvsK67w,7157
|
27
26
|
lamindb/core/_feature_manager.py,sha256=q4WmzJvFLL_fAs-vNRgV2klanAoU6Wu8_g0O2dyIjVg,40027
|
28
|
-
lamindb/core/_label_manager.py,sha256=
|
29
|
-
lamindb/core/_mapped_collection.py,sha256=
|
27
|
+
lamindb/core/_label_manager.py,sha256=Y0NdvXLGB3RTYPnNJiGfnhnvYWSS7XsOEj9UattJw3c,10943
|
28
|
+
lamindb/core/_mapped_collection.py,sha256=EDS0xzOdCc_iGE_Iqv5COTVHNm4jWue7Jtcd8DdXkJU,24591
|
30
29
|
lamindb/core/_settings.py,sha256=6jNadlQdimxCsKR2ZyUD0YJYzOdubTnKktki-MqEWqQ,6137
|
31
30
|
lamindb/core/_sync_git.py,sha256=lIgl6YfpH4rCFT1WILAp7zlemZfxog1d0zp3cX0KIZw,4531
|
32
31
|
lamindb/core/_track_environment.py,sha256=Ywzg_sJ7guI1dcsN7h5orce9VdYl8VGVE3OLITlHBXQ,820
|
@@ -40,9 +39,10 @@ lamindb/core/datasets/__init__.py,sha256=zRP98oqUAaXhqWyKMiH0s_ImVIuNeziQQ2kQ_t0
|
|
40
39
|
lamindb/core/datasets/_core.py,sha256=JGP_q-OQibDCEaI54jZ2F6fSbSW9Yg6oYOqgOCXM0v4,20414
|
41
40
|
lamindb/core/datasets/_fake.py,sha256=BZF9R_1iF0HDnvtZNqL2FtsjSMuqDIfuFxnw_LJYIh4,953
|
42
41
|
lamindb/core/storage/__init__.py,sha256=JOIMu_7unbyhndtH1j0Q-9AvY8knSuc1IJO9sQnyBAQ,498
|
43
|
-
lamindb/core/storage/_anndata_accessor.py,sha256=
|
42
|
+
lamindb/core/storage/_anndata_accessor.py,sha256=C321qng00vMmugukxv5dX8z3oJeRxq869DgAGaEd5rg,24413
|
44
43
|
lamindb/core/storage/_anndata_sizes.py,sha256=aXO3OB--tF5MChenSsigW6Q-RuE8YJJOUTVukkLrv9A,1029
|
45
|
-
lamindb/core/storage/_backed_access.py,sha256=
|
44
|
+
lamindb/core/storage/_backed_access.py,sha256=t9iS9mlZQBy1FfIS-Twt-96npYiShbPwEo2y9_3b6jY,3517
|
45
|
+
lamindb/core/storage/_pyarrow_dataset.py,sha256=wuLsEvdblqMdUdDfMtis8AWrE3igzvFWTSTbxuD1Oc8,926
|
46
46
|
lamindb/core/storage/_tiledbsoma.py,sha256=0NPLS5m1icEhzWPfXAv4U2SNiLGqGQd7FM6xCm5wYEc,7269
|
47
47
|
lamindb/core/storage/_valid_suffixes.py,sha256=vUSeQ4s01rdhD_vSd6wKmFBsgMJAKkBMnL_T9Y1znMg,501
|
48
48
|
lamindb/core/storage/_zarr.py,sha256=TODQD3p1eykoPwP-c-YRP_UDmsbMeBGMGvkBxxOMeYc,3663
|
@@ -55,7 +55,7 @@ lamindb/integrations/__init__.py,sha256=RWGMYYIzr8zvmNPyVB4m-p4gMDhxdRbjES2Ed23O
|
|
55
55
|
lamindb/integrations/_vitessce.py,sha256=uPl45_w4Uu9_BhpBDDVonC1nDOuAnB7DAnzi5w5bZAE,4032
|
56
56
|
lamindb/setup/__init__.py,sha256=OwZpZzPDv5lPPGXZP7-zK6UdO4FHvvuBh439yZvIp3A,410
|
57
57
|
lamindb/setup/core/__init__.py,sha256=SevlVrc2AZWL3uALbE5sopxBnIZPWZ1IB0NBDudiAL8,167
|
58
|
-
lamindb-0.76.
|
59
|
-
lamindb-0.76.
|
60
|
-
lamindb-0.76.
|
61
|
-
lamindb-0.76.
|
58
|
+
lamindb-0.76.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
59
|
+
lamindb-0.76.16.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
60
|
+
lamindb-0.76.16.dist-info/METADATA,sha256=kAhqI1VyLBx0iXLsQIt31re6xPcJEG2YiXS0N1BaO_M,2797
|
61
|
+
lamindb-0.76.16.dist-info/RECORD,,
|
lamindb/_filter.py
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from typing import TYPE_CHECKING
|
4
|
-
|
5
|
-
from ._query_set import QuerySet, process_expressions
|
6
|
-
|
7
|
-
if TYPE_CHECKING:
|
8
|
-
from lnschema_core import Record
|
9
|
-
|
10
|
-
|
11
|
-
def filter(registry: type[Record], *queries, **expressions) -> QuerySet:
|
12
|
-
"""See :meth:`~lamindb.core.Record.filter`."""
|
13
|
-
_using_key = None
|
14
|
-
if "_using_key" in expressions:
|
15
|
-
_using_key = expressions.pop("_using_key")
|
16
|
-
expressions = process_expressions(registry, expressions)
|
17
|
-
qs = QuerySet(model=registry, using=_using_key)
|
18
|
-
if len(expressions) > 0:
|
19
|
-
return qs.filter(*queries, **expressions)
|
20
|
-
else:
|
21
|
-
return qs
|
File without changes
|
File without changes
|