lamindb_setup 0.76.2__py2.py3-none-any.whl → 0.76.3__py2.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_setup/__init__.py +1 -1
- lamindb_setup/_schema_metadata.py +7 -3
- lamindb_setup/core/upath.py +6 -9
- {lamindb_setup-0.76.2.dist-info → lamindb_setup-0.76.3.dist-info}/METADATA +1 -1
- {lamindb_setup-0.76.2.dist-info → lamindb_setup-0.76.3.dist-info}/RECORD +7 -7
- {lamindb_setup-0.76.2.dist-info → lamindb_setup-0.76.3.dist-info}/LICENSE +0 -0
- {lamindb_setup-0.76.2.dist-info → lamindb_setup-0.76.3.dist-info}/WHEEL +0 -0
lamindb_setup/__init__.py
CHANGED
|
@@ -356,7 +356,9 @@ class _SchemaHandler:
|
|
|
356
356
|
return self.to_dict(include_django_objects=False)
|
|
357
357
|
|
|
358
358
|
def _get_modules_metadata(self):
|
|
359
|
-
|
|
359
|
+
from lnschema_core.models import Record, Registry
|
|
360
|
+
|
|
361
|
+
all_models = {
|
|
360
362
|
module_name: {
|
|
361
363
|
model._meta.model_name: _ModelHandler(
|
|
362
364
|
model, module_name, self.included_modules
|
|
@@ -364,13 +366,15 @@ class _SchemaHandler:
|
|
|
364
366
|
for model in self._get_schema_module(
|
|
365
367
|
module_name
|
|
366
368
|
).models.__dict__.values()
|
|
367
|
-
if model.__class__
|
|
368
|
-
and model
|
|
369
|
+
if model.__class__ is Registry
|
|
370
|
+
and model is not Record
|
|
369
371
|
and not model._meta.abstract
|
|
370
372
|
and model.__get_schema_name__() == module_name
|
|
371
373
|
}
|
|
372
374
|
for module_name in self.included_modules
|
|
373
375
|
}
|
|
376
|
+
assert all_models
|
|
377
|
+
return all_models
|
|
374
378
|
|
|
375
379
|
def _get_module_set_info(self):
|
|
376
380
|
# TODO: rely on schemamodule table for this
|
lamindb_setup/core/upath.py
CHANGED
|
@@ -28,7 +28,7 @@ LocalPathClasses = (PosixUPath, WindowsUPath, LocalPath)
|
|
|
28
28
|
# also see https://gist.github.com/securifera/e7eed730cbe1ce43d0c29d7cd2d582f4
|
|
29
29
|
# ".gz" is not listed here as it typically occurs with another suffix
|
|
30
30
|
# the complete list is at lamindb.core.storage._suffixes
|
|
31
|
-
|
|
31
|
+
VALID_SIMPLE_SUFFIXES = {
|
|
32
32
|
#
|
|
33
33
|
# without readers
|
|
34
34
|
#
|
|
@@ -56,11 +56,8 @@ VALID_SUFFIXES = {
|
|
|
56
56
|
".zarr",
|
|
57
57
|
".json",
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
".spatialdata.zarr",
|
|
62
|
-
".ome.zarr",
|
|
63
|
-
}
|
|
59
|
+
# below gets updated within lamindb because it's frequently changing
|
|
60
|
+
VALID_COMPOSITE_SUFFIXES = {".anndata.zarr"}
|
|
64
61
|
|
|
65
62
|
TRAILING_SEP = (os.sep, os.altsep) if os.altsep is not None else os.sep
|
|
66
63
|
|
|
@@ -76,7 +73,7 @@ def extract_suffix_from_path(path: Path, arg_name: str | None = None) -> str:
|
|
|
76
73
|
return process_digits(path.suffix)
|
|
77
74
|
|
|
78
75
|
total_suffix = "".join(path.suffixes)
|
|
79
|
-
if total_suffix in
|
|
76
|
+
if total_suffix in VALID_SIMPLE_SUFFIXES:
|
|
80
77
|
return total_suffix
|
|
81
78
|
elif total_suffix.endswith(tuple(VALID_COMPOSITE_SUFFIXES)):
|
|
82
79
|
# below seems slow but OK for now
|
|
@@ -94,7 +91,7 @@ def extract_suffix_from_path(path: Path, arg_name: str | None = None) -> str:
|
|
|
94
91
|
# in COMPRESSION_SUFFIXES to detect something like .random.gz and then
|
|
95
92
|
# add ".random.gz" but concluded it's too dangerous it's safer to just
|
|
96
93
|
# use ".gz" in such a case
|
|
97
|
-
if path.suffixes[-2] in
|
|
94
|
+
if path.suffixes[-2] in VALID_SIMPLE_SUFFIXES:
|
|
98
95
|
suffix = "".join(path.suffixes[-2:])
|
|
99
96
|
msg += f"inferring: '{suffix}'"
|
|
100
97
|
# do not print a warning for things like .tar.gz, .fastq.gz
|
|
@@ -105,7 +102,7 @@ def extract_suffix_from_path(path: Path, arg_name: str | None = None) -> str:
|
|
|
105
102
|
msg += (
|
|
106
103
|
f"using only last suffix: '{suffix}' - if you want your composite"
|
|
107
104
|
" suffix to be recognized add it to"
|
|
108
|
-
" lamindb.core.storage.
|
|
105
|
+
" lamindb.core.storage.VALID_SIMPLE_SUFFIXES.add()"
|
|
109
106
|
)
|
|
110
107
|
if print_hint:
|
|
111
108
|
logger.hint(msg)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lamindb_setup/__init__.py,sha256=
|
|
1
|
+
lamindb_setup/__init__.py,sha256=hXWSzOTJWwpoCg2nw2RH87bEJu7oXk_jyxAbJdcrsYU,1542
|
|
2
2
|
lamindb_setup/_cache.py,sha256=wA7mbysANwe8hPNbjDo9bOmXJ0xIyaS5iyxIpxSWji4,846
|
|
3
3
|
lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
|
|
4
4
|
lamindb_setup/_check_setup.py,sha256=cNEL9Q4yPpmEkGKHH8JgullWl1VUZwALJ4RHn9wZypY,2613
|
|
@@ -12,7 +12,7 @@ lamindb_setup/_init_instance.py,sha256=pR_pK38okij7CfnQDecJLKR5lhhTeE4oZ14Lb9bMM
|
|
|
12
12
|
lamindb_setup/_migrate.py,sha256=P4n3x0SYzO9szjF2-JMa7z4mQadtWjHv5ow4HbCDZLI,8864
|
|
13
13
|
lamindb_setup/_register_instance.py,sha256=alQuYp2f8Ct8xvRC1gt8p_HZ0tqCd3gZD3kiPBLPpsI,1269
|
|
14
14
|
lamindb_setup/_schema.py,sha256=b3uzhhWpV5mQtDwhMINc2MabGCnGLESy51ito3yl6Wc,679
|
|
15
|
-
lamindb_setup/_schema_metadata.py,sha256=
|
|
15
|
+
lamindb_setup/_schema_metadata.py,sha256=nF29OuMNswJUCyvSyOHEUQLQ7PcfB7uwvczloBYSWuU,13187
|
|
16
16
|
lamindb_setup/_set_managed_storage.py,sha256=mNZrANn-9rwZ0oGWxxg0wS0T0VOQCWyo4nSSyNAE15Q,1419
|
|
17
17
|
lamindb_setup/_setup_user.py,sha256=6Oc7Rke-yRQSZbuntdUAz8QbJ6UuPzYHI9FnYlf_q-A,3670
|
|
18
18
|
lamindb_setup/_silence_loggers.py,sha256=AKF_YcHvX32eGXdsYK8MJlxEaZ-Uo2f6QDRzjKFCtws,1568
|
|
@@ -39,8 +39,8 @@ lamindb_setup/core/django.py,sha256=QUQm3zt5QIiD8uv6o9vbSm_bshqiSWzKSkgD3z2eJCg,
|
|
|
39
39
|
lamindb_setup/core/exceptions.py,sha256=eoI7AXgATgDVzgArtN7CUvpaMUC067vsBg5LHCsWzDM,305
|
|
40
40
|
lamindb_setup/core/hashing.py,sha256=Y2cvEaqtm3KwpHqj5ZG2f_sLaXhsQT4oDrmJdHbOQeo,3116
|
|
41
41
|
lamindb_setup/core/types.py,sha256=bcYnZ0uM_2NXKJCl94Mmc-uYrQlRUUVKG3sK2N-F-N4,532
|
|
42
|
-
lamindb_setup/core/upath.py,sha256=
|
|
43
|
-
lamindb_setup-0.76.
|
|
44
|
-
lamindb_setup-0.76.
|
|
45
|
-
lamindb_setup-0.76.
|
|
46
|
-
lamindb_setup-0.76.
|
|
42
|
+
lamindb_setup/core/upath.py,sha256=Bhxr1B1sFuIp13YTBOEYJSmSOwmU6owk8giBGLCKdg4,27194
|
|
43
|
+
lamindb_setup-0.76.3.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
44
|
+
lamindb_setup-0.76.3.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
|
|
45
|
+
lamindb_setup-0.76.3.dist-info/METADATA,sha256=29omTu3ShcauGqhxT0g_ZAAuOBZveomsA-hFBH3OGzs,1638
|
|
46
|
+
lamindb_setup-0.76.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|