lamindb_setup 0.74.2__py2.py3-none-any.whl → 0.74.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/_exportdb.py +1 -1
- lamindb_setup/core/_setup_bionty_sources.py +10 -17
- {lamindb_setup-0.74.2.dist-info → lamindb_setup-0.74.3.dist-info}/METADATA +1 -1
- {lamindb_setup-0.74.2.dist-info → lamindb_setup-0.74.3.dist-info}/RECORD +7 -7
- {lamindb_setup-0.74.2.dist-info → lamindb_setup-0.74.3.dist-info}/LICENSE +0 -0
- {lamindb_setup-0.74.2.dist-info → lamindb_setup-0.74.3.dist-info}/WHEEL +0 -0
lamindb_setup/__init__.py
CHANGED
lamindb_setup/_exportdb.py
CHANGED
|
@@ -9,14 +9,14 @@ if TYPE_CHECKING:
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def write_bionty_sources(isettings: InstanceSettings) -> None:
|
|
12
|
-
"""Write bionty sources to
|
|
12
|
+
"""Write bionty sources to Source table."""
|
|
13
13
|
if "bionty" not in isettings.schema:
|
|
14
14
|
return None
|
|
15
15
|
import shutil
|
|
16
16
|
|
|
17
17
|
import bionty_base
|
|
18
18
|
from bionty_base.dev._handle_sources import parse_sources_yaml
|
|
19
|
-
from lnschema_bionty.models import
|
|
19
|
+
from lnschema_bionty.models import Source
|
|
20
20
|
|
|
21
21
|
shutil.copy(
|
|
22
22
|
bionty_base.settings.current_sources, bionty_base.settings.lamindb_sources
|
|
@@ -32,16 +32,11 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
|
|
|
32
32
|
.set_index(["entity", key])
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
currently_used = _get_currently_used("organism")
|
|
37
|
-
key = "organism"
|
|
38
|
-
except KeyError:
|
|
39
|
-
currently_used = _get_currently_used("species")
|
|
40
|
-
key = "species"
|
|
35
|
+
currently_used = _get_currently_used("organism")
|
|
41
36
|
|
|
42
37
|
all_records = []
|
|
43
38
|
for kwargs in all_sources_dict:
|
|
44
|
-
act = currently_used.loc[(kwargs["entity"], kwargs[
|
|
39
|
+
act = currently_used.loc[(kwargs["entity"], kwargs["organism"])].to_dict()
|
|
45
40
|
if (act["source"] == kwargs["source"]) and (
|
|
46
41
|
act["version"] == kwargs["version"]
|
|
47
42
|
):
|
|
@@ -49,15 +44,13 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
|
|
|
49
44
|
|
|
50
45
|
# when the database is not yet migrated but setup is updated
|
|
51
46
|
# won't need this once lamindb is released with the new pin
|
|
52
|
-
if hasattr(PublicSource, "species") and "organism" in kwargs:
|
|
53
|
-
kwargs["species"] = kwargs.pop("organism")
|
|
54
|
-
elif hasattr(PublicSource, "organism") and "species" in kwargs:
|
|
55
|
-
kwargs["organism"] = kwargs.pop("species")
|
|
56
47
|
kwargs["run"] = None # can't yet access tracking information
|
|
57
|
-
|
|
48
|
+
kwargs["in_db"] = False
|
|
49
|
+
# kwargs["name"] = kwargs.pop("source")
|
|
50
|
+
record = Source(**kwargs)
|
|
58
51
|
all_records.append(record)
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
Source.objects.bulk_create(all_records, ignore_conflicts=True)
|
|
61
54
|
|
|
62
55
|
|
|
63
56
|
def load_bionty_sources(isettings: InstanceSettings):
|
|
@@ -68,11 +61,11 @@ def load_bionty_sources(isettings: InstanceSettings):
|
|
|
68
61
|
import bionty_base
|
|
69
62
|
from bionty_base.dev._handle_sources import parse_currently_used_sources
|
|
70
63
|
from bionty_base.dev._io import write_yaml
|
|
71
|
-
from lnschema_bionty.models import
|
|
64
|
+
from lnschema_bionty.models import Source
|
|
72
65
|
|
|
73
66
|
try:
|
|
74
67
|
# need try except because of integer primary key migration
|
|
75
|
-
active_records =
|
|
68
|
+
active_records = Source.objects.filter(currently_used=True).all().values()
|
|
76
69
|
write_yaml(
|
|
77
70
|
parse_currently_used_sources(active_records),
|
|
78
71
|
bionty_base.settings.lamindb_sources,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lamindb_setup/__init__.py,sha256=
|
|
1
|
+
lamindb_setup/__init__.py,sha256=FLoipEAQXtUmcK_Dwo1brKCnl2kfCxuCwN6GTe1FgxU,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
|
|
@@ -6,7 +6,7 @@ lamindb_setup/_close.py,sha256=1QS9p2SCacgovYn6xqWU4zFvwHN1RgIccvzwJgFvKgU,1186
|
|
|
6
6
|
lamindb_setup/_connect_instance.py,sha256=dWqvNBBxqCG6xOiY_fI-P5ccyzno_ePGP3Rp1rgNq3g,12512
|
|
7
7
|
lamindb_setup/_delete.py,sha256=Y8KSFYgY0UHAvjd7cCL6hZ_XiLeJwx50BguVATcj_Xo,5524
|
|
8
8
|
lamindb_setup/_django.py,sha256=EoyWvFzH0i9wxjy4JZhcoXCTckztP_Mrl6FbYQnMmLE,1534
|
|
9
|
-
lamindb_setup/_exportdb.py,sha256=
|
|
9
|
+
lamindb_setup/_exportdb.py,sha256=43g77-tH-vAlTn8ig1mMD9-KXLKvxUeDLaq0gVu3l-c,2114
|
|
10
10
|
lamindb_setup/_importdb.py,sha256=yYYShzUajTsR-cTW4CZ-UNDWZY2uE5PAgNbp-wn8Ogc,1874
|
|
11
11
|
lamindb_setup/_init_instance.py,sha256=jcKtXLOwkoq7bC-0j0xnNU4_up9nPl0iKQPNoJbBts8,12078
|
|
12
12
|
lamindb_setup/_migrate.py,sha256=P4n3x0SYzO9szjF2-JMa7z4mQadtWjHv5ow4HbCDZLI,8864
|
|
@@ -33,14 +33,14 @@ lamindb_setup/core/_settings_save.py,sha256=n_tYfb9EBSxwm4LHyPRHJptE5uB8lmHhcRkz
|
|
|
33
33
|
lamindb_setup/core/_settings_storage.py,sha256=65aobewYX6VfOeYZjZQOOI7ZD_3b4QA9TDmrduU0m4c,13262
|
|
34
34
|
lamindb_setup/core/_settings_store.py,sha256=VEE8Ff2A7y4j8ksOaa7g48jNaOqe1PBnBjb1PKKGUKU,2115
|
|
35
35
|
lamindb_setup/core/_settings_user.py,sha256=P2lC4WDRAFfT-Xq3MlXJ-wMKIHCoGNhMTQfRGIAyUNQ,1344
|
|
36
|
-
lamindb_setup/core/_setup_bionty_sources.py,sha256=
|
|
36
|
+
lamindb_setup/core/_setup_bionty_sources.py,sha256=i_fVCnoh38ouTKKeM-MUXQbkkxMcrSz5dTM_mOCHUcU,2732
|
|
37
37
|
lamindb_setup/core/cloud_sqlite_locker.py,sha256=reu02M4aE2BT_A5AFqwhv48l91mOMyQ4zTd-hh-wtuU,6922
|
|
38
38
|
lamindb_setup/core/django.py,sha256=QUQm3zt5QIiD8uv6o9vbSm_bshqiSWzKSkgD3z2eJCg,3542
|
|
39
39
|
lamindb_setup/core/exceptions.py,sha256=eoI7AXgATgDVzgArtN7CUvpaMUC067vsBg5LHCsWzDM,305
|
|
40
40
|
lamindb_setup/core/hashing.py,sha256=_JliYeCcjT_foOUJ5ck1rvcCo9q7r4b4SaSclQ_w4Qo,3071
|
|
41
41
|
lamindb_setup/core/types.py,sha256=bcYnZ0uM_2NXKJCl94Mmc-uYrQlRUUVKG3sK2N-F-N4,532
|
|
42
42
|
lamindb_setup/core/upath.py,sha256=dwudkTVsXuyjS-2xR16WomcWtXJAEfRZ0ZzFq8_EDhE,27157
|
|
43
|
-
lamindb_setup-0.74.
|
|
44
|
-
lamindb_setup-0.74.
|
|
45
|
-
lamindb_setup-0.74.
|
|
46
|
-
lamindb_setup-0.74.
|
|
43
|
+
lamindb_setup-0.74.3.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
44
|
+
lamindb_setup-0.74.3.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
|
|
45
|
+
lamindb_setup-0.74.3.dist-info/METADATA,sha256=dqS1Dfpqk1G-BoZzexMF8b1wv_MxWPuqKwKMM1rvWx8,1638
|
|
46
|
+
lamindb_setup-0.74.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|