bioversions 0.5.376__py3-none-any.whl → 0.7.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.
- bioversions/__init__.py +7 -3
- bioversions/__main__.py +0 -2
- bioversions/charts.py +3 -7
- bioversions/cli.py +3 -5
- bioversions/py.typed +0 -0
- bioversions/resources/__init__.py +18 -7
- bioversions/resources/update.py +20 -12
- bioversions/resources/versions.json +20536 -0
- bioversions/slack_client.py +2 -5
- bioversions/sources/__init__.py +32 -17
- bioversions/sources/antibodyregistry.py +9 -6
- bioversions/sources/bigg.py +5 -7
- bioversions/sources/biogrid.py +0 -2
- bioversions/sources/cellosaurus.py +3 -5
- bioversions/sources/chebi.py +1 -3
- bioversions/sources/chembl.py +3 -4
- bioversions/sources/chemidplus.py +1 -3
- bioversions/sources/civic.py +9 -4
- bioversions/sources/complexportal.py +0 -2
- bioversions/sources/daily.py +0 -2
- bioversions/sources/depmap.py +1 -3
- bioversions/sources/dgi.py +9 -12
- bioversions/sources/disgenet.py +1 -3
- bioversions/sources/drugbank.py +2 -4
- bioversions/sources/drugcentral.py +2 -4
- bioversions/sources/ensembl.py +1 -3
- bioversions/sources/expasy.py +1 -4
- bioversions/sources/flybase.py +0 -2
- bioversions/sources/gtdb.py +35 -0
- bioversions/sources/guidetopharmacology.py +3 -5
- bioversions/sources/hgnc.py +13 -14
- bioversions/sources/homologene.py +0 -2
- bioversions/sources/icd10.py +1 -3
- bioversions/sources/icd11.py +1 -3
- bioversions/sources/icf.py +1 -3
- bioversions/sources/intact.py +0 -2
- bioversions/sources/interpro.py +1 -3
- bioversions/sources/itis.py +8 -15
- bioversions/sources/kegg.py +7 -7
- bioversions/sources/mesh.py +10 -5
- bioversions/sources/mgi.py +0 -2
- bioversions/sources/mirbase.py +13 -8
- bioversions/sources/moalmanac.py +0 -2
- bioversions/sources/msigdb.py +0 -2
- bioversions/sources/ncit.py +1 -4
- bioversions/sources/npass.py +0 -2
- bioversions/sources/obo.py +4 -6
- bioversions/sources/ols.py +6 -8
- bioversions/sources/omim.py +5 -6
- bioversions/sources/oncotree.py +4 -4
- bioversions/sources/pathbank.py +0 -2
- bioversions/sources/pathwaycommons.py +0 -2
- bioversions/sources/pfam.py +0 -2
- bioversions/sources/pombase.py +0 -2
- bioversions/sources/pr.py +1 -3
- bioversions/sources/pubchem.py +0 -2
- bioversions/sources/reactome.py +0 -2
- bioversions/sources/rfam.py +0 -2
- bioversions/sources/rgd.py +1 -3
- bioversions/sources/rhea.py +0 -2
- bioversions/sources/rxnorm.py +0 -2
- bioversions/sources/sgd.py +0 -2
- bioversions/sources/signor.py +36 -0
- bioversions/sources/slm.py +4 -3
- bioversions/sources/stringdb.py +2 -4
- bioversions/sources/umls.py +0 -2
- bioversions/sources/uniprot.py +1 -3
- bioversions/sources/unversioned.py +0 -2
- bioversions/sources/wikipathways.py +0 -2
- bioversions/sources/zfin.py +0 -2
- bioversions/templates/base.html +28 -0
- bioversions/templates/home.html +60 -0
- bioversions/twitter_client.py +5 -8
- bioversions/utils.py +30 -31
- bioversions/version.py +3 -5
- bioversions/wsgi.py +2 -4
- bioversions-0.7.1.dist-info/METADATA +393 -0
- bioversions-0.7.1.dist-info/RECORD +81 -0
- bioversions-0.7.1.dist-info/WHEEL +4 -0
- {bioversions-0.5.376.dist-info → bioversions-0.7.1.dist-info}/entry_points.txt +1 -0
- {bioversions-0.5.376.dist-info → bioversions-0.7.1.dist-info/licenses}/LICENSE +1 -1
- bioversions-0.5.376.dist-info/METADATA +0 -166
- bioversions-0.5.376.dist-info/RECORD +0 -77
- bioversions-0.5.376.dist-info/WHEEL +0 -5
- bioversions-0.5.376.dist-info/top_level.txt +0 -1
bioversions/__init__.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""What's the current version for each biological database?""" # noqa:D400
|
4
2
|
|
5
|
-
from .sources import get_rows, get_version, resolve
|
3
|
+
from .sources import get_rows, get_version, resolve
|
4
|
+
|
5
|
+
__all__ = [
|
6
|
+
"get_rows",
|
7
|
+
"get_version",
|
8
|
+
"resolve",
|
9
|
+
]
|
bioversions/__main__.py
CHANGED
bioversions/charts.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Generation of charts summarizing bioversions."""
|
4
2
|
|
5
3
|
import os
|
@@ -21,7 +19,7 @@ def version_types_pie_chart():
|
|
21
19
|
"Missing" if getter.version_type is None else getter.version_type.value
|
22
20
|
for getter in get_getters()
|
23
21
|
)
|
24
|
-
labels, counts = zip(*counts.most_common())
|
22
|
+
labels, counts = zip(*counts.most_common(), strict=False)
|
25
23
|
fig, ax = plt.subplots()
|
26
24
|
ax.pie(
|
27
25
|
counts,
|
@@ -29,9 +27,7 @@ def version_types_pie_chart():
|
|
29
27
|
autopct="%1.f%%",
|
30
28
|
startangle=30,
|
31
29
|
explode=[0.01 for _ in range(len(counts))],
|
32
|
-
# shadow=True,
|
33
30
|
)
|
34
|
-
# fig.legend(fontsize='medium')
|
35
31
|
fig.tight_layout()
|
36
32
|
path = os.path.join(IMG, "version_types.svg")
|
37
33
|
plt.savefig(path, dpi=300)
|
@@ -45,7 +41,7 @@ def verioning_date_formats_pie_chart():
|
|
45
41
|
for getter in get_getters()
|
46
42
|
if getter.version_type in {VersionType.date, VersionType.month}
|
47
43
|
)
|
48
|
-
labels, counts = zip(*counts.most_common())
|
44
|
+
labels, counts = zip(*counts.most_common(), strict=False)
|
49
45
|
fig, ax = plt.subplots()
|
50
46
|
ax.pie(
|
51
47
|
counts,
|
@@ -67,7 +63,7 @@ def has_release_url():
|
|
67
63
|
for getter in get_getters()
|
68
64
|
if getter.version_type != VersionType.unversioned
|
69
65
|
)
|
70
|
-
labels, counts = zip(*counts.most_common())
|
66
|
+
labels, counts = zip(*counts.most_common(), strict=False)
|
71
67
|
fig, ax = plt.subplots()
|
72
68
|
ax.pie(
|
73
69
|
counts,
|
bioversions/cli.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Command line interface for bioversions."""
|
4
2
|
|
5
3
|
import click
|
@@ -21,9 +19,9 @@ main.add_command(update)
|
|
21
19
|
web = make_web_command(
|
22
20
|
app="bioversions.wsgi:app",
|
23
21
|
group=main,
|
24
|
-
command_kwargs=
|
25
|
-
help
|
26
|
-
|
22
|
+
command_kwargs={
|
23
|
+
"help": "Run the bioversions web application.",
|
24
|
+
},
|
27
25
|
)
|
28
26
|
|
29
27
|
|
bioversions/py.typed
CHANGED
File without changes
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Resources."""
|
4
2
|
|
5
3
|
import datetime
|
@@ -9,17 +7,18 @@ from pathlib import Path
|
|
9
7
|
import yaml
|
10
8
|
|
11
9
|
__all__ = [
|
12
|
-
"VERSIONS_PATH",
|
13
10
|
"EXPORT_PATH",
|
11
|
+
"VERSIONS_PATH",
|
14
12
|
"load_versions",
|
15
|
-
"write_versions",
|
16
13
|
"write_export",
|
14
|
+
"write_versions",
|
17
15
|
]
|
18
16
|
|
19
17
|
HERE = Path(__file__).parent.resolve()
|
20
18
|
VERSIONS_PATH = HERE.joinpath(HERE, "versions.json")
|
21
19
|
|
22
20
|
ROOT = HERE.parent.parent.parent.resolve()
|
21
|
+
PYPROJECT_TOML_PATH = ROOT.joinpath("pyproject.toml")
|
23
22
|
DOCS = ROOT.joinpath("docs")
|
24
23
|
EXPORTS_DIRECTORY = DOCS.joinpath("_data")
|
25
24
|
EXPORT_PATH = EXPORTS_DIRECTORY.joinpath("versions.yml")
|
@@ -28,22 +27,34 @@ FAILURES_PATH = DOCS.joinpath("failures.md")
|
|
28
27
|
|
29
28
|
def load_versions():
|
30
29
|
"""Load Bioversions data."""
|
30
|
+
if not VERSIONS_PATH.is_file():
|
31
|
+
raise RuntimeError(
|
32
|
+
f"bioversions was not packaged/built/installed properly -"
|
33
|
+
f"{VERSIONS_PATH.name} was not found inside the distribution"
|
34
|
+
)
|
31
35
|
with open(VERSIONS_PATH) as file:
|
32
36
|
return json.load(file)
|
33
37
|
|
34
38
|
|
35
39
|
def _date_converter(o):
|
36
|
-
if isinstance(o,
|
40
|
+
if isinstance(o, datetime.datetime | datetime.date):
|
37
41
|
return o.strftime("%Y-%m-%d")
|
38
42
|
|
39
43
|
|
40
|
-
def write_versions(versions, indent: int = 2, **kwargs):
|
44
|
+
def write_versions(versions, indent: int = 2, **kwargs) -> None:
|
41
45
|
"""Write Bioversions data."""
|
46
|
+
_ensure_editable()
|
42
47
|
with open(VERSIONS_PATH, "w") as file:
|
43
48
|
json.dump(versions, file, indent=indent, default=_date_converter, **kwargs)
|
44
49
|
|
45
50
|
|
46
|
-
def write_export(versions):
|
51
|
+
def write_export(versions) -> None:
|
47
52
|
"""Write Bioversions data to the export directory."""
|
53
|
+
_ensure_editable()
|
48
54
|
with open(EXPORT_PATH, "w") as file:
|
49
55
|
yaml.safe_dump(versions, file)
|
56
|
+
|
57
|
+
|
58
|
+
def _ensure_editable() -> None:
|
59
|
+
if not PYPROJECT_TOML_PATH.is_file():
|
60
|
+
raise RuntimeError("can not make export when bioversions is not installed in editable mode")
|
bioversions/resources/update.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Update the web page."""
|
4
2
|
|
5
3
|
import getpass
|
@@ -7,6 +5,7 @@ import sys
|
|
7
5
|
from datetime import datetime
|
8
6
|
|
9
7
|
import click
|
8
|
+
from tqdm import tqdm
|
10
9
|
from tqdm.contrib.logging import logging_redirect_tqdm
|
11
10
|
|
12
11
|
from bioversions.resources import (
|
@@ -16,7 +15,7 @@ from bioversions.resources import (
|
|
16
15
|
write_export,
|
17
16
|
write_versions,
|
18
17
|
)
|
19
|
-
from bioversions.sources import _iter_versions
|
18
|
+
from bioversions.sources import FailureTuple, _iter_versions
|
20
19
|
from bioversions.version import get_git_hash
|
21
20
|
|
22
21
|
__all__ = [
|
@@ -36,7 +35,7 @@ def update(force: bool):
|
|
36
35
|
_update(force=force)
|
37
36
|
|
38
37
|
|
39
|
-
def _update(force: bool):
|
38
|
+
def _update(force: bool): # noqa:C901
|
40
39
|
if not get_git_hash():
|
41
40
|
click.secho("Not on development installation", fg="red")
|
42
41
|
return sys.exit(1)
|
@@ -49,10 +48,10 @@ def _update(force: bool):
|
|
49
48
|
today = datetime.now().strftime("%Y-%m-%d")
|
50
49
|
|
51
50
|
changes = False
|
52
|
-
|
53
|
-
for bv
|
54
|
-
if
|
55
|
-
|
51
|
+
failure_tuples = []
|
52
|
+
for bv in _iter_versions(use_tqdm=True):
|
53
|
+
if isinstance(bv, FailureTuple):
|
54
|
+
failure_tuples.append(bv)
|
56
55
|
continue
|
57
56
|
|
58
57
|
if bv.name in versions:
|
@@ -83,7 +82,7 @@ def _update(force: bool):
|
|
83
82
|
v["releases"].append(append_dict)
|
84
83
|
|
85
84
|
if not changes and not force:
|
86
|
-
click.
|
85
|
+
tqdm.write(click.style(f"No changes to {EXPORT_PATH}", fg="yellow", bold=True))
|
87
86
|
else:
|
88
87
|
rv_database = sorted(versions.values(), key=lambda version: version["name"].lower())
|
89
88
|
rv = {
|
@@ -94,11 +93,20 @@ def _update(force: bool):
|
|
94
93
|
},
|
95
94
|
"database": rv_database,
|
96
95
|
}
|
97
|
-
click.
|
96
|
+
tqdm.write(click.style(f"Writing new {EXPORT_PATH}", fg="green", bold=True))
|
98
97
|
write_export(rv)
|
99
98
|
write_versions(rv)
|
100
99
|
|
101
|
-
|
100
|
+
if failure_tuples:
|
101
|
+
click.secho(f"Writing failure summary to {FAILURES_PATH}")
|
102
|
+
text = "# Summary of Errors\n\n"
|
103
|
+
for t in failure_tuples:
|
104
|
+
text += f"- {t.name} - {t.message}\n"
|
105
|
+
text += "\n"
|
106
|
+
for t in failure_tuples:
|
107
|
+
text += f"## {t.name}\n\nUsing class: `{t.clstype}`\n\n"
|
108
|
+
text += f"```python-traceback\n{t.trace}\n```\n\n"
|
109
|
+
FAILURES_PATH.write_text(text)
|
102
110
|
|
103
111
|
|
104
112
|
def _log_update(bv) -> None:
|
@@ -106,7 +114,7 @@ def _log_update(bv) -> None:
|
|
106
114
|
if bv.homepage:
|
107
115
|
text += f". See {bv.homepage}"
|
108
116
|
|
109
|
-
click.
|
117
|
+
tqdm.write(click.style(text, fg="green", bold=True))
|
110
118
|
|
111
119
|
try:
|
112
120
|
from .. import slack_client
|