lamindb 0.74.0__py3-none-any.whl → 0.74.1__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 -5
- lamindb/_artifact.py +5 -5
- lamindb/_finish.py +1 -1
- lamindb/_from_values.py +3 -3
- lamindb/_query_manager.py +1 -1
- lamindb/_query_set.py +5 -3
- lamindb/_registry.py +2 -2
- lamindb/core/__init__.py +3 -4
- lamindb/core/_data.py +1 -1
- lamindb/core/_feature_manager.py +1 -1
- lamindb/core/_run_context.py +4 -2
- lamindb/core/_settings.py +43 -49
- lamindb/core/datasets/_core.py +3 -3
- lamindb/core/storage/paths.py +3 -3
- lamindb/core/subsettings/__init__.py +12 -0
- lamindb/core/subsettings/_creation_settings.py +38 -0
- lamindb/core/subsettings/_transform_settings.py +21 -0
- {lamindb-0.74.0.dist-info → lamindb-0.74.1.dist-info}/METADATA +3 -3
- {lamindb-0.74.0.dist-info → lamindb-0.74.1.dist-info}/RECORD +21 -19
- lamindb/core/_transform_settings.py +0 -9
- {lamindb-0.74.0.dist-info → lamindb-0.74.1.dist-info}/LICENSE +0 -0
- {lamindb-0.74.0.dist-info → lamindb-0.74.1.dist-info}/WHEEL +0 -0
lamindb/__init__.py
CHANGED
@@ -42,7 +42,7 @@ Modules & settings:
|
|
42
42
|
"""
|
43
43
|
|
44
44
|
# denote a release candidate for 0.1.0 with 0.1rc1, 0.1a1, 0.1b1, etc.
|
45
|
-
__version__ = "0.74.
|
45
|
+
__version__ = "0.74.1"
|
46
46
|
|
47
47
|
import os as _os
|
48
48
|
|
@@ -90,17 +90,14 @@ if _check_instance_setup(from_lamindb=True):
|
|
90
90
|
_storage,
|
91
91
|
_transform,
|
92
92
|
_ulabel,
|
93
|
+
integrations,
|
93
94
|
)
|
94
|
-
|
95
|
-
dev = core # backward compat
|
96
|
-
from . import integrations
|
97
95
|
from ._annotate import Annotate
|
98
96
|
from ._finish import finish
|
99
97
|
from ._save import save
|
100
98
|
from ._view import view
|
101
99
|
from .core._run_context import run_context as _run_context
|
102
100
|
from .core._settings import settings
|
103
|
-
from .core._transform_settings import transform # backward compat
|
104
101
|
|
105
102
|
# schema modules
|
106
103
|
if not _os.environ.get("LAMINDB_MULTI_INSTANCE") == "true":
|
lamindb/_artifact.py
CHANGED
@@ -190,7 +190,7 @@ def get_stat_or_artifact(
|
|
190
190
|
using_key: str | None = None,
|
191
191
|
) -> tuple[int, str | None, str | None, int | None] | Artifact:
|
192
192
|
n_objects = None
|
193
|
-
if settings.
|
193
|
+
if settings.creation.artifact_skip_size_hash:
|
194
194
|
return None, None, None, n_objects
|
195
195
|
stat = path.stat() # one network request
|
196
196
|
if not isinstance(path, LocalPathClasses):
|
@@ -242,14 +242,14 @@ def get_stat_or_artifact(
|
|
242
242
|
Artifact.objects.using(using_key).filter(hash=hash, visibility=None).all()
|
243
243
|
)
|
244
244
|
if len(result) > 0:
|
245
|
-
if settings.
|
245
|
+
if settings.creation.artifact_if_hash_exists == "error":
|
246
246
|
msg = f"artifact with same hash exists: {result[0]}"
|
247
247
|
hint = (
|
248
248
|
"💡 you can make this error a warning:\n"
|
249
|
-
" ln.settings.
|
249
|
+
" ln.settings.creation.artifact_if_hash_exists"
|
250
250
|
)
|
251
251
|
raise FileExistsError(f"{msg}\n{hint}")
|
252
|
-
elif settings.
|
252
|
+
elif settings.creation.artifact_if_hash_exists == "warn_create_new":
|
253
253
|
logger.warning(
|
254
254
|
"creating new Artifact object despite existing artifact with same hash:"
|
255
255
|
f" {result[0]}"
|
@@ -376,7 +376,7 @@ def get_artifact_kwargs_from_data(
|
|
376
376
|
)
|
377
377
|
|
378
378
|
# do we use a virtual or an actual storage key?
|
379
|
-
key_is_virtual = settings.
|
379
|
+
key_is_virtual = settings.creation._artifact_use_virtual_keys
|
380
380
|
|
381
381
|
# if the file is already in storage, independent of the default
|
382
382
|
# we use an actual storage key
|
lamindb/_finish.py
CHANGED
@@ -144,7 +144,7 @@ def save_run_context_core(
|
|
144
144
|
prev_report = prev_transform.latest_report
|
145
145
|
if prev_transform.source_code_id is not None:
|
146
146
|
prev_source = prev_transform.source_code
|
147
|
-
ln.settings.
|
147
|
+
ln.settings.creation.artifact_silence_missing_run_warning = True
|
148
148
|
|
149
149
|
# track source code
|
150
150
|
if transform.source_code_id is not None:
|
lamindb/_from_values.py
CHANGED
@@ -28,7 +28,7 @@ def get_or_create_records(
|
|
28
28
|
Registry = field.field.model
|
29
29
|
if create:
|
30
30
|
return [Registry(**{field.field.name: value}) for value in iterable]
|
31
|
-
|
31
|
+
creation_search_names = settings.creation.search_names
|
32
32
|
feature: Feature = None
|
33
33
|
organism = _get_organism_record(field, organism)
|
34
34
|
kwargs: dict = {}
|
@@ -36,7 +36,7 @@ def get_or_create_records(
|
|
36
36
|
kwargs["organism"] = organism
|
37
37
|
if public_source is not None:
|
38
38
|
kwargs["public_source"] = public_source
|
39
|
-
settings.
|
39
|
+
settings.creation.search_names = False
|
40
40
|
try:
|
41
41
|
iterable_idx = index_iterable(iterable)
|
42
42
|
|
@@ -88,7 +88,7 @@ def get_or_create_records(
|
|
88
88
|
logger.debug(f"added default feature '{feature_name}'")
|
89
89
|
return records
|
90
90
|
finally:
|
91
|
-
settings.
|
91
|
+
settings.creation.search_names = creation_search_names
|
92
92
|
|
93
93
|
|
94
94
|
def get_existing_records(
|
lamindb/_query_manager.py
CHANGED
@@ -45,7 +45,7 @@ class QueryManager(models.Manager):
|
|
45
45
|
|
46
46
|
if (
|
47
47
|
run_context.run is None
|
48
|
-
and not settings.
|
48
|
+
and not settings.creation.artifact_silence_missing_run_warning
|
49
49
|
):
|
50
50
|
logger.warning(WARNING_RUN_TRANSFORM)
|
51
51
|
_track_run_input(self.instance)
|
lamindb/_query_set.py
CHANGED
@@ -97,7 +97,9 @@ class QuerySet(models.QuerySet, CanValidate):
|
|
97
97
|
"""
|
98
98
|
|
99
99
|
@doc_args(Registry.df.__doc__)
|
100
|
-
def df(
|
100
|
+
def df(
|
101
|
+
self, include: str | list[str] | None = None, join: str = "inner"
|
102
|
+
) -> pd.DataFrame:
|
101
103
|
"""{}."""
|
102
104
|
# re-order the columns
|
103
105
|
exclude_field_names = ["created_at"]
|
@@ -173,7 +175,7 @@ class QuerySet(models.QuerySet, CanValidate):
|
|
173
175
|
link_groupby = link_df.groupby(left_side_link_model)[
|
174
176
|
values_expression
|
175
177
|
].apply(list)
|
176
|
-
df = pd.concat((link_groupby, df), axis=1, join=
|
178
|
+
df = pd.concat((link_groupby, df), axis=1, join=join)
|
177
179
|
df.rename(columns={values_expression: expression}, inplace=True)
|
178
180
|
else:
|
179
181
|
# the F() based implementation could also work for many-to-many,
|
@@ -185,7 +187,7 @@ class QuerySet(models.QuerySet, CanValidate):
|
|
185
187
|
)
|
186
188
|
df_anno = df_anno.set_index(pk_column_name)
|
187
189
|
df_anno.rename(columns={"expression": expression}, inplace=True)
|
188
|
-
df = pd.concat((df_anno, df), axis=1, join=
|
190
|
+
df = pd.concat((df_anno, df), axis=1, join=join)
|
189
191
|
return df
|
190
192
|
|
191
193
|
def delete(self, *args, **kwargs):
|
lamindb/_registry.py
CHANGED
@@ -82,7 +82,7 @@ def __init__(orm: Registry, *args, **kwargs):
|
|
82
82
|
has_consciously_provided_uid = False
|
83
83
|
if "_has_consciously_provided_uid" in kwargs:
|
84
84
|
has_consciously_provided_uid = kwargs.pop("_has_consciously_provided_uid")
|
85
|
-
if settings.
|
85
|
+
if settings.creation.search_names and not has_consciously_provided_uid:
|
86
86
|
match = suggest_records_with_similar_names(orm, kwargs)
|
87
87
|
if match:
|
88
88
|
if "version" in kwargs:
|
@@ -447,7 +447,7 @@ def transfer_to_default_db(
|
|
447
447
|
if run_context.run is not None:
|
448
448
|
record.run_id = run_context.run.id
|
449
449
|
else:
|
450
|
-
if not settings.
|
450
|
+
if not settings.creation.artifact_silence_missing_run_warning:
|
451
451
|
logger.warning(WARNING_RUN_TRANSFORM)
|
452
452
|
record.run_id = None
|
453
453
|
if hasattr(record, "transform_id") and record._meta.model_name != "run":
|
lamindb/core/__init__.py
CHANGED
@@ -32,13 +32,12 @@ Annotators:
|
|
32
32
|
MuDataAnnotator
|
33
33
|
AnnotateLookup
|
34
34
|
|
35
|
-
|
35
|
+
Other:
|
36
36
|
|
37
37
|
.. autosummary::
|
38
38
|
:toctree: .
|
39
39
|
|
40
40
|
Settings
|
41
|
-
TransformSettings
|
42
41
|
MappedCollection
|
43
42
|
run_context
|
44
43
|
|
@@ -51,6 +50,7 @@ Modules:
|
|
51
50
|
storage
|
52
51
|
types
|
53
52
|
exceptions
|
53
|
+
subsettings
|
54
54
|
|
55
55
|
"""
|
56
56
|
|
@@ -77,8 +77,7 @@ from lamindb._query_set import QuerySet, RecordsList
|
|
77
77
|
from lamindb.core._feature_manager import FeatureManager, ParamManager
|
78
78
|
from lamindb.core._label_manager import LabelManager
|
79
79
|
|
80
|
-
from . import _data, datasets, exceptions, fields, types
|
80
|
+
from . import _data, datasets, exceptions, fields, subsettings, types
|
81
81
|
from ._mapped_collection import MappedCollection
|
82
82
|
from ._run_context import run_context
|
83
83
|
from ._settings import Settings
|
84
|
-
from ._transform_settings import TransformSettings
|
lamindb/core/_data.py
CHANGED
@@ -46,7 +46,7 @@ WARNING_RUN_TRANSFORM = "no run & transform get linked, consider calling ln.trac
|
|
46
46
|
def get_run(run: Run | None) -> Run | None:
|
47
47
|
if run is None:
|
48
48
|
run = run_context.run
|
49
|
-
if run is None and not settings.
|
49
|
+
if run is None and not settings.creation.artifact_silence_missing_run_warning:
|
50
50
|
logger.warning(WARNING_RUN_TRANSFORM)
|
51
51
|
# suppress run by passing False
|
52
52
|
elif not run:
|
lamindb/core/_feature_manager.py
CHANGED
@@ -243,7 +243,7 @@ def parse_feature_sets_from_anndata(
|
|
243
243
|
using_key = settings._using_key
|
244
244
|
data_parse = backed_access(filepath, using_key)
|
245
245
|
else:
|
246
|
-
data_parse = ad.
|
246
|
+
data_parse = ad.read_h5ad(filepath, backed="r")
|
247
247
|
type = "float"
|
248
248
|
else:
|
249
249
|
type = (
|
lamindb/core/_run_context.py
CHANGED
@@ -14,8 +14,6 @@ from lnschema_core.models import Param, ParamValue, RunParamValue
|
|
14
14
|
from lnschema_core.types import TransformType
|
15
15
|
from lnschema_core.users import current_user_id
|
16
16
|
|
17
|
-
from lamindb.core._transform_settings import transform as transform_settings
|
18
|
-
|
19
17
|
from ._settings import settings
|
20
18
|
from ._sync_git import get_transform_reference_from_git_repo
|
21
19
|
from .exceptions import (
|
@@ -24,6 +22,7 @@ from .exceptions import (
|
|
24
22
|
NoTitleError,
|
25
23
|
UpdateTransformSettings,
|
26
24
|
)
|
25
|
+
from .subsettings._transform_settings import transform_settings
|
27
26
|
from .versioning import bump_version as bump_version_function
|
28
27
|
|
29
28
|
if TYPE_CHECKING:
|
@@ -288,6 +287,9 @@ class run_context:
|
|
288
287
|
path=path
|
289
288
|
)
|
290
289
|
transform_type = TransformType.script
|
290
|
+
# overwrite whatever is auto-detected in the notebook or script
|
291
|
+
if transform_settings.name is not None:
|
292
|
+
name = transform_settings.name
|
291
293
|
cls._create_or_load_transform(
|
292
294
|
stem_uid=stem_uid,
|
293
295
|
version=version,
|
lamindb/core/_settings.py
CHANGED
@@ -9,11 +9,13 @@ from lamindb_setup._set_managed_storage import set_managed_storage
|
|
9
9
|
from lamindb_setup.core._settings import settings as setup_settings
|
10
10
|
from lamindb_setup.core._settings_instance import sanitize_git_repo_url
|
11
11
|
|
12
|
-
from .
|
12
|
+
from .subsettings._creation_settings import CreationSettings, creation_settings
|
13
|
+
from .subsettings._transform_settings import TransformSettings, transform_settings
|
13
14
|
|
14
15
|
if TYPE_CHECKING:
|
15
16
|
from pathlib import Path
|
16
17
|
|
18
|
+
from lamindb_setup.core._settings_storage import StorageSettings
|
17
19
|
from upath import UPath
|
18
20
|
|
19
21
|
VERBOSITY_TO_INT = {
|
@@ -40,29 +42,15 @@ class Settings:
|
|
40
42
|
logger.set_verbosity(self._verbosity_int)
|
41
43
|
self._sync_git_repo: str | None = git_repo
|
42
44
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
"""Behavior if file hash exists (default `"warn_return_existing"`).
|
47
|
-
|
48
|
-
One of `["warn_return_existing", "error", "warn_create_new"]`.
|
49
|
-
|
50
|
-
FAQ: :doc:`/faq/idempotency`
|
51
|
-
"""
|
52
|
-
upon_file_create_skip_size_hash: bool = False
|
53
|
-
"""To speed up registering high numbers of files (default `False`).
|
54
|
-
|
55
|
-
This bypasses queries for size and hash to AWS & GCP.
|
56
|
-
|
57
|
-
It speeds up file creation by about a factor 100.
|
58
|
-
"""
|
59
|
-
upon_create_search_names: bool = True
|
60
|
-
"""To speed up creating Registry objects (default `True`).
|
45
|
+
@property
|
46
|
+
def creation(self) -> CreationSettings:
|
47
|
+
"""Record creation settings.
|
61
48
|
|
62
|
-
|
49
|
+
For example, `ln.settings.creation.search_names = False` will disable
|
50
|
+
searching for records with similar names during creation.
|
51
|
+
"""
|
52
|
+
return creation_settings
|
63
53
|
|
64
|
-
FAQ: :doc:`/faq/idempotency`
|
65
|
-
"""
|
66
54
|
track_run_inputs: bool = True
|
67
55
|
"""Track files as input upon `.load()`, `.cache()` and `.backed()`.
|
68
56
|
|
@@ -70,14 +58,6 @@ class Settings:
|
|
70
58
|
|
71
59
|
FAQ: :doc:`/faq/track-run-inputs`
|
72
60
|
"""
|
73
|
-
silence_file_run_transform_warning: bool = False
|
74
|
-
"""Silence warning about missing run & transform during file creation."""
|
75
|
-
artifact_use_virtual_keys: bool = True
|
76
|
-
"""Treat `key` parameter in :class:`~lamindb.Artifact` as virtual.
|
77
|
-
|
78
|
-
If `True`, the `key` is **not** used to construct file paths, but file paths are
|
79
|
-
based on the `uid` of artifact.
|
80
|
-
"""
|
81
61
|
__using_key: str | None = None
|
82
62
|
_using_storage: str | None = None
|
83
63
|
|
@@ -101,8 +81,17 @@ class Settings:
|
|
101
81
|
|
102
82
|
@property
|
103
83
|
def transform(self) -> TransformSettings:
|
104
|
-
"""Transform settings.
|
105
|
-
|
84
|
+
"""Transform settings.
|
85
|
+
|
86
|
+
For example::
|
87
|
+
|
88
|
+
ln.settings.transform.stem_uid = "FPnfDtJz8qbE" # defines version family
|
89
|
+
ln.settings.transform.version = "1" # defines version
|
90
|
+
ln.settings.transform.name = "My good script" # semantic name
|
91
|
+
|
92
|
+
The first two are typically auto-generated by :func:`~lamindb.track`.
|
93
|
+
"""
|
94
|
+
return transform_settings
|
106
95
|
|
107
96
|
@property
|
108
97
|
def sync_git_repo(self) -> str | None:
|
@@ -116,18 +105,25 @@ class Settings:
|
|
116
105
|
def sync_git_repo(self, value) -> None:
|
117
106
|
"""Sync transforms with scripts in git repository.
|
118
107
|
|
119
|
-
|
108
|
+
For example: `ln.sync_git_repo = https://github.com/laminlabs/redun-lamin`
|
120
109
|
"""
|
121
110
|
self._sync_git_repo = sanitize_git_repo_url(value)
|
122
111
|
assert self._sync_git_repo.startswith("https://")
|
123
112
|
|
124
113
|
@property
|
125
|
-
def storage(self) ->
|
126
|
-
"""Default storage location
|
114
|
+
def storage(self) -> StorageSettings:
|
115
|
+
"""Default storage location.
|
127
116
|
|
128
117
|
Examples:
|
129
118
|
|
130
|
-
|
119
|
+
>>> ln.settings.storage
|
120
|
+
StorageSettings(root='s3://my-bucket', uid='j7MaPxtLxPeE')
|
121
|
+
|
122
|
+
>>> ln.settings.storage.root
|
123
|
+
UPath('s3://my-bucket')
|
124
|
+
|
125
|
+
You can switch the default storage location to another managed storage
|
126
|
+
location by passing a string:
|
131
127
|
|
132
128
|
>>> ln.settings.storage = "s3://some-bucket"
|
133
129
|
|
@@ -139,7 +135,7 @@ class Settings:
|
|
139
135
|
>>> )
|
140
136
|
>>> ln.settings.storage = "s3://some-bucket", kwargs
|
141
137
|
"""
|
142
|
-
return self._storage_settings
|
138
|
+
return self._storage_settings
|
143
139
|
|
144
140
|
@storage.setter
|
145
141
|
def storage(self, path_kwargs: str | Path | UPath | tuple[str | UPath, Mapping]):
|
@@ -150,16 +146,14 @@ class Settings:
|
|
150
146
|
set_managed_storage(path, **kwargs)
|
151
147
|
|
152
148
|
@property
|
153
|
-
def storage_local(self) ->
|
149
|
+
def storage_local(self) -> StorageSettings:
|
154
150
|
"""An additional local default storage (a path to its root).
|
155
151
|
|
156
152
|
Is only available if :attr:`~lamindb.setup.core.InstanceSettings.keep_artifacts_local` is enabled.
|
157
153
|
|
158
154
|
Guide: :doc:`faq/keep-artifacts-local`
|
159
|
-
|
160
|
-
Shortcut for: `ln.setup.settings.instance.storage_local.root`
|
161
155
|
"""
|
162
|
-
return ln_setup.settings.instance.storage_local
|
156
|
+
return ln_setup.settings.instance.storage_local
|
163
157
|
|
164
158
|
@storage_local.setter
|
165
159
|
def storage_local(self, local_root: Path):
|
@@ -167,14 +161,14 @@ class Settings:
|
|
167
161
|
|
168
162
|
@property
|
169
163
|
def verbosity(self) -> str:
|
170
|
-
"""Logger verbosity (default 'warning').
|
171
|
-
|
172
|
-
- 'error'
|
173
|
-
- 'warning'
|
174
|
-
- 'success'
|
175
|
-
- 'info'
|
176
|
-
- 'hint'
|
177
|
-
- 'debug'
|
164
|
+
"""Logger verbosity (default `'warning'`).
|
165
|
+
|
166
|
+
- `'error'`: ❌ only show error messages
|
167
|
+
- `'warning'`: ❗ also show warning messages
|
168
|
+
- `'success'`: ✅ also show success and save messages
|
169
|
+
- `'info'`: 💡 also show info messages
|
170
|
+
- `'hint'`: 💡 also show hint messages
|
171
|
+
- `'debug'`: 🐛 also show detailed debug messages
|
178
172
|
"""
|
179
173
|
return VERBOSITY_TO_STR[self._verbosity_int]
|
180
174
|
|
lamindb/core/datasets/_core.py
CHANGED
@@ -91,7 +91,7 @@ def file_tsv_rnaseq_nfcore_salmon_merged_gene_counts(
|
|
91
91
|
|
92
92
|
def file_fastq(in_storage_root=False) -> Path:
|
93
93
|
"""Mini mock fastq artifact."""
|
94
|
-
basedir = Path() if not in_storage_root else settings.storage
|
94
|
+
basedir = Path() if not in_storage_root else settings.storage.root
|
95
95
|
filepath = basedir / "input.fastq.gz"
|
96
96
|
with open(filepath, "w") as f:
|
97
97
|
f.write("Mock fastq artifact.")
|
@@ -100,7 +100,7 @@ def file_fastq(in_storage_root=False) -> Path:
|
|
100
100
|
|
101
101
|
def file_bam(in_storage_root=False) -> Path: # pragma: no cover
|
102
102
|
"""Mini mock bam artifact."""
|
103
|
-
basedir = Path() if not in_storage_root else settings.storage
|
103
|
+
basedir = Path() if not in_storage_root else settings.storage.root
|
104
104
|
filepath = basedir / "output.bam"
|
105
105
|
with open(filepath, "w") as f:
|
106
106
|
f.write("Mock bam artifact.")
|
@@ -109,7 +109,7 @@ def file_bam(in_storage_root=False) -> Path: # pragma: no cover
|
|
109
109
|
|
110
110
|
def file_mini_csv(in_storage_root=False) -> Path:
|
111
111
|
"""Mini csv artifact."""
|
112
|
-
basedir = Path() if not in_storage_root else settings.storage
|
112
|
+
basedir = Path() if not in_storage_root else settings.storage.root
|
113
113
|
filepath = basedir / "mini.csv"
|
114
114
|
df = pd.DataFrame([1, 2, 3], columns=["test"])
|
115
115
|
df.to_csv(filepath, index=False)
|
lamindb/core/storage/paths.py
CHANGED
@@ -72,7 +72,7 @@ def attempt_accessing_path(
|
|
72
72
|
storage_settings = settings._storage_settings
|
73
73
|
else:
|
74
74
|
storage_settings = StorageSettings(
|
75
|
-
settings.storage, access_token=access_token
|
75
|
+
settings.storage.root, access_token=access_token
|
76
76
|
)
|
77
77
|
else:
|
78
78
|
if artifact._state.db not in ("default", None) and using_key is None:
|
@@ -143,8 +143,8 @@ def delete_storage(
|
|
143
143
|
"""Delete arbitrary artifact."""
|
144
144
|
# TODO is_relative_to is not available in 3.8 and deprecated since 3.12
|
145
145
|
# replace with check_path_is_child_of_root but this needs to first be debugged
|
146
|
-
# if not check_path_is_child_of_root(storagepath, settings.storage):
|
147
|
-
if not storagepath.is_relative_to(settings.storage): # type: ignore
|
146
|
+
# if not check_path_is_child_of_root(storagepath, settings.storage.root):
|
147
|
+
if not storagepath.is_relative_to(settings.storage.root): # type: ignore
|
148
148
|
allow_delete = False
|
149
149
|
if setup_settings.instance.keep_artifacts_local:
|
150
150
|
allow_delete = storagepath.is_relative_to( # type: ignore
|
@@ -0,0 +1,38 @@
|
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
|
4
|
+
class CreationSettings:
|
5
|
+
artifact_if_hash_exists: Literal[
|
6
|
+
"warn_return_existing", "error", "warn_create_new"
|
7
|
+
] = "warn_return_existing"
|
8
|
+
"""Behavior if file hash exists (default `"warn_return_existing"`).
|
9
|
+
|
10
|
+
One of `["warn_return_existing", "error", "warn_create_new"]`.
|
11
|
+
|
12
|
+
FAQ: :doc:`/faq/idempotency`
|
13
|
+
"""
|
14
|
+
artifact_skip_size_hash: bool = False
|
15
|
+
"""To speed up registering high numbers of files (default `False`).
|
16
|
+
|
17
|
+
This bypasses queries for size and hash to AWS & GCP.
|
18
|
+
|
19
|
+
It speeds up file creation by about a factor 100.
|
20
|
+
"""
|
21
|
+
search_names: bool = True
|
22
|
+
"""To speed up creating records (default `True`).
|
23
|
+
|
24
|
+
If `True`, search for alternative names.
|
25
|
+
|
26
|
+
FAQ: :doc:`/faq/idempotency`
|
27
|
+
"""
|
28
|
+
artifact_silence_missing_run_warning: bool = False
|
29
|
+
"""Silence warning about missing run & transform during artifact creation."""
|
30
|
+
_artifact_use_virtual_keys: bool = True
|
31
|
+
"""Treat `key` parameter in :class:`~lamindb.Artifact` as virtual.
|
32
|
+
|
33
|
+
If `True`, the `key` is **not** used to construct file paths, but file paths are
|
34
|
+
based on the `uid` of artifact.
|
35
|
+
"""
|
36
|
+
|
37
|
+
|
38
|
+
creation_settings = CreationSettings()
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
|
4
|
+
class TransformSettings:
|
5
|
+
stem_uid: str | None = None
|
6
|
+
"""Defines the version family of the transform.
|
7
|
+
|
8
|
+
For example, all notebooks of the same family have a uid that starts with
|
9
|
+
`"FPnfDtJz8qbE"`.
|
10
|
+
|
11
|
+
The full uids of the notebooks in this family are of form
|
12
|
+
`"{stem_uid}{suffix_uid}"` where the `suffix_uid` encodes the semantic
|
13
|
+
`version`.
|
14
|
+
"""
|
15
|
+
version: str | None = None
|
16
|
+
"""The version."""
|
17
|
+
name: str | None = None
|
18
|
+
"""A name like a notebook or script title."""
|
19
|
+
|
20
|
+
|
21
|
+
transform_settings = TransformSettings()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lamindb
|
3
|
-
Version: 0.74.
|
3
|
+
Version: 0.74.1
|
4
4
|
Summary: A data framework for biology.
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
6
6
|
Requires-Python: >=3.8
|
@@ -17,7 +17,7 @@ Requires-Dist: rapidfuzz
|
|
17
17
|
Requires-Dist: pyarrow
|
18
18
|
Requires-Dist: typing_extensions!=4.6.0
|
19
19
|
Requires-Dist: python-dateutil
|
20
|
-
Requires-Dist: anndata>=0.8.0
|
20
|
+
Requires-Dist: anndata>=0.8.0,<=0.10.8
|
21
21
|
Requires-Dist: scipy<1.13.0rc1
|
22
22
|
Requires-Dist: fsspec
|
23
23
|
Requires-Dist: pandas
|
@@ -59,7 +59,7 @@ Provides-Extra: zarr
|
|
59
59
|
|
60
60
|
# LaminDB - A data framework for biology
|
61
61
|
|
62
|
-
- Manage
|
62
|
+
- Manage data & metadata with a unified Python API ("lakehouse").
|
63
63
|
- Track data lineage across notebooks & pipelines.
|
64
64
|
- Integrate registries for experimental metadata & in-house ontologies.
|
65
65
|
- Validate, standardize & annotate.
|
@@ -1,18 +1,18 @@
|
|
1
|
-
lamindb/__init__.py,sha256=
|
1
|
+
lamindb/__init__.py,sha256=7wGOqqM6NyKeQG6qqir53qzUowWMRAd36tH5L874hd0,2182
|
2
2
|
lamindb/_annotate.py,sha256=CScyKVB3k_x5p0pihxO1UrTFBCvPcSSjBXvGY3YgTLs,44381
|
3
|
-
lamindb/_artifact.py,sha256=
|
3
|
+
lamindb/_artifact.py,sha256=zVNBF7y-rARGG78Z2d2dI2J0Tg_5yeZL-GfogzBB7xY,40456
|
4
4
|
lamindb/_can_validate.py,sha256=s1q0lxplqnhytrVgArBTm05XKMMmpreK0ZlVCsd2jjk,14849
|
5
5
|
lamindb/_collection.py,sha256=AGiztgM_OIet617aF86muL6lIv6GEDcmXorize6V62U,14657
|
6
6
|
lamindb/_feature.py,sha256=Z_Awtsj183SA1egZgNmJI_dH04rqXAj72od3H6n0uBk,7398
|
7
7
|
lamindb/_feature_set.py,sha256=ZAFLyIiWC6yPOFTF7K03olE2Rl3KthsV-1ttqJySzqQ,8106
|
8
8
|
lamindb/_filter.py,sha256=jEA1n1Hi6lEPaD0JXiTSh9K4joGzWU6Yxy0LCLTiOdY,1422
|
9
|
-
lamindb/_finish.py,sha256=
|
10
|
-
lamindb/_from_values.py,sha256=
|
9
|
+
lamindb/_finish.py,sha256=WkFvZ0DijW9fRIsjyoxcAC4ehan_B0C8Fqoz9ZON19A,10213
|
10
|
+
lamindb/_from_values.py,sha256=Sq1NdjsqReih8aUR-JHZ09pxHdqL8rY-cZFHo078OJw,13886
|
11
11
|
lamindb/_is_versioned.py,sha256=0PgRCmxEmYDcAjllLSOYZm132B1lW6QgmBBERhRyFt0,1341
|
12
12
|
lamindb/_parents.py,sha256=kb5AHkntpTP5g2lk1aPL0FmIilYZYVZvj6stddFOI40,15075
|
13
|
-
lamindb/_query_manager.py,sha256=
|
14
|
-
lamindb/_query_set.py,sha256=
|
15
|
-
lamindb/_registry.py,sha256=
|
13
|
+
lamindb/_query_manager.py,sha256=TjiwtX5CErEV58WyUFJ76p0riuPDODf8LGXo48aR9Fg,4236
|
14
|
+
lamindb/_query_set.py,sha256=q3C0gdfassidngMteGHuOlhHmt_3VXEGOwblRDInxpA,11626
|
15
|
+
lamindb/_registry.py,sha256=C_QKBAOhFj_pROBLUlieiPYWljd5ThPpTXunAekCQe8,18764
|
16
16
|
lamindb/_run.py,sha256=xj3ER4F_yWvuNw1mr0XU-QuIPi5hBO7Ue0ygBgJQ6mc,1887
|
17
17
|
lamindb/_save.py,sha256=It4XO448D8NG2cReo9Xy0lQBQdkMm_rCx_TGD1qZWWc,11864
|
18
18
|
lamindb/_storage.py,sha256=8wRefV-Klu6VBVtwcwppvTojeXnxRThaBdFniA0AEIw,400
|
@@ -20,23 +20,22 @@ lamindb/_transform.py,sha256=E9C7psuOnsNrUQpWRuGgEUM8_pc7YhDn7n4ieHzB4X0,3169
|
|
20
20
|
lamindb/_ulabel.py,sha256=XDSdZBXX_ki5s1vOths3MjF2x5DPggBR_PV_KF4SGyg,1611
|
21
21
|
lamindb/_utils.py,sha256=LGdiW4k3GClLz65vKAVRkL6Tw-Gkx9DWAdez1jyA5bE,428
|
22
22
|
lamindb/_view.py,sha256=NdWWF75rmkCHefqBViUnsHLu3OViJ1z_bEvfcedydsw,2330
|
23
|
-
lamindb/core/__init__.py,sha256=
|
24
|
-
lamindb/core/_data.py,sha256=
|
25
|
-
lamindb/core/_feature_manager.py,sha256=
|
23
|
+
lamindb/core/__init__.py,sha256=RDtvov8NkPTNT4Lhs1KWTd2s4eQsPBH0s3fQRNJQCZA,1375
|
24
|
+
lamindb/core/_data.py,sha256=u6eYlDOnLuwFMRsyg97qoIushwbHhwoQT-zjEL7p8VU,16241
|
25
|
+
lamindb/core/_feature_manager.py,sha256=OQ14OONCRecqVatNm5kALh5LuhWqKrwoMNPJ_qHtGhw,31372
|
26
26
|
lamindb/core/_label_manager.py,sha256=d9r3tiNDFbpZQmxE1jmgdgnMYPOfTPpAKGKtRRLmVj8,9640
|
27
27
|
lamindb/core/_mapped_collection.py,sha256=_OwFZh5SePDUD70XIK5kngv3we_Z5-YdGHNfpUSatSQ,19469
|
28
|
-
lamindb/core/_run_context.py,sha256=
|
29
|
-
lamindb/core/_settings.py,sha256=
|
28
|
+
lamindb/core/_run_context.py,sha256=ybGgrzGBy9kOyQNH1bPaMixXZNmZGynAP1eO6Zwtp4A,18393
|
29
|
+
lamindb/core/_settings.py,sha256=HIuCC9xEVo_3o-uogZlN-6oQVs92EWmaqBJWAdGKj5o,6009
|
30
30
|
lamindb/core/_sync_git.py,sha256=5Fb82eG1WYyBlfMRCMlcUZNTVk70UU_SPnfvYEBL-A8,4124
|
31
31
|
lamindb/core/_track_environment.py,sha256=xLZ6kgzxWS6MWZ5LQ_wkbJX99vmYOT8iQ-Fz4OHCgWw,754
|
32
|
-
lamindb/core/_transform_settings.py,sha256=eV96QKX9jOojjzF-a0oo0wXQsMXN2F6QV7orE06oFC8,161
|
33
32
|
lamindb/core/exceptions.py,sha256=bbm-PeSy24qFcqh2HpucZWpwGAvk-TL_3FUoAPb3e3E,867
|
34
33
|
lamindb/core/fields.py,sha256=Jgi_XI-iTe6cT7oD8FV_JqEpjN1Q9rZWwL8VLtj4jkA,164
|
35
34
|
lamindb/core/schema.py,sha256=BbG7JGrXVLwEX_6eQb8ouJc9Q-MgazwqHvAM5dtrWtM,1861
|
36
35
|
lamindb/core/types.py,sha256=xeQF2x40p2pR9eIVQrXT74RrS810z2fbjmTRTSQUqPM,230
|
37
36
|
lamindb/core/versioning.py,sha256=zbp3wAWOqU1uDF9wRrpaS9JfmRglUQtVHvFpWWoJHZk,4943
|
38
37
|
lamindb/core/datasets/__init__.py,sha256=zRP98oqUAaXhqWyKMiH0s_ImVIuNeziQQ2kQ_t0f-DI,1353
|
39
|
-
lamindb/core/datasets/_core.py,sha256=
|
38
|
+
lamindb/core/datasets/_core.py,sha256=11vsIRREU7TvjwkL2htJWAGoBNCmG2qz8ps4Bd4SNLQ,19873
|
40
39
|
lamindb/core/datasets/_fake.py,sha256=BZF9R_1iF0HDnvtZNqL2FtsjSMuqDIfuFxnw_LJYIh4,953
|
41
40
|
lamindb/core/storage/__init__.py,sha256=5LUFQKRr2BX24d-yWBezhTXBV83sShcOvPj5Y5u6qIg,441
|
42
41
|
lamindb/core/storage/_anndata_sizes.py,sha256=aXO3OB--tF5MChenSsigW6Q-RuE8YJJOUTVukkLrv9A,1029
|
@@ -44,12 +43,15 @@ lamindb/core/storage/_backed_access.py,sha256=eManrLsu3pSSQAyAKy47FDBm-iHgjaNfHA
|
|
44
43
|
lamindb/core/storage/_valid_suffixes.py,sha256=J08aglC9oo35pzahj0SQXW9IHib8Asp4dc11co-2uys,212
|
45
44
|
lamindb/core/storage/_zarr.py,sha256=5ceEz6YIvgvUnVVNWhK5Z4W0WfrvyvY82Yna5jSX1_E,3661
|
46
45
|
lamindb/core/storage/objects.py,sha256=OzvBCS-Urz5mr-O95qYt6RGBDDX5HmjfRRKWPPDn1ZE,1797
|
47
|
-
lamindb/core/storage/paths.py,sha256=
|
46
|
+
lamindb/core/storage/paths.py,sha256=p5TsZUOfQAN_0kzpr0JO43hRKLc95IO5qSu5V12A8Ok,8218
|
47
|
+
lamindb/core/subsettings/__init__.py,sha256=KFHPzIE7f7Bj4RgMjGQF4CjTdHVG_VNFBrCndo49ixo,198
|
48
|
+
lamindb/core/subsettings/_creation_settings.py,sha256=54mfMH_osC753hpxcl7Dq1rwBD2LHnWveXtQpkLBITE,1194
|
49
|
+
lamindb/core/subsettings/_transform_settings.py,sha256=4YbCuZtJo6zdytl6UQR4GvdDkTtT6SRBqVzofGzNOt8,583
|
48
50
|
lamindb/integrations/__init__.py,sha256=aH2PmO2m4-vwIifMYTB0Fyyr_gZWtVnV71jT0tVWSw0,123
|
49
51
|
lamindb/integrations/_vitessce.py,sha256=Qd39OuNsL0GXU7nMvEWLRRESFQ0mwGf_ePMJE_FDYm8,2639
|
50
52
|
lamindb/setup/__init__.py,sha256=OwZpZzPDv5lPPGXZP7-zK6UdO4FHvvuBh439yZvIp3A,410
|
51
53
|
lamindb/setup/core/__init__.py,sha256=SevlVrc2AZWL3uALbE5sopxBnIZPWZ1IB0NBDudiAL8,167
|
52
|
-
lamindb-0.74.
|
53
|
-
lamindb-0.74.
|
54
|
-
lamindb-0.74.
|
55
|
-
lamindb-0.74.
|
54
|
+
lamindb-0.74.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
55
|
+
lamindb-0.74.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
56
|
+
lamindb-0.74.1.dist-info/METADATA,sha256=iQeRxSkzFqxjAVMnofcMWyBaYsXLEp5gIhDeP339GNI,2732
|
57
|
+
lamindb-0.74.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|