mpcontribs-client 5.8.4__py3-none-any.whl → 5.10.0__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.
- mpcontribs/client/__init__.py +14 -7
- {mpcontribs_client-5.8.4.dist-info → mpcontribs_client-5.10.0.dist-info}/METADATA +20 -10
- mpcontribs_client-5.10.0.dist-info/RECORD +6 -0
- {mpcontribs_client-5.8.4.dist-info → mpcontribs_client-5.10.0.dist-info}/WHEEL +1 -1
- mpcontribs_client-5.8.4.dist-info/RECORD +0 -6
- {mpcontribs_client-5.8.4.dist-info → mpcontribs_client-5.10.0.dist-info}/LICENSE +0 -0
- {mpcontribs_client-5.8.4.dist-info → mpcontribs_client-5.10.0.dist-info}/top_level.txt +0 -0
mpcontribs/client/__init__.py
CHANGED
|
@@ -54,13 +54,12 @@ from urllib3.util.retry import Retry
|
|
|
54
54
|
from filetype.types.archive import Gz
|
|
55
55
|
from filetype.types.image import Jpeg, Png, Gif, Tiff
|
|
56
56
|
from pint import UnitRegistry
|
|
57
|
-
from pint.unit import UnitDefinition
|
|
58
|
-
from pint.converters import ScaleConverter
|
|
59
57
|
from pint.errors import DimensionalityError
|
|
60
58
|
from tempfile import gettempdir
|
|
61
59
|
from plotly.express._chart_types import line as line_chart
|
|
62
60
|
from cachetools import cached, LRUCache
|
|
63
61
|
from cachetools.keys import hashkey
|
|
62
|
+
from pymatgen.core import SETTINGS
|
|
64
63
|
|
|
65
64
|
RETRIES = 3
|
|
66
65
|
MAX_WORKERS = 3
|
|
@@ -103,10 +102,16 @@ ureg = UnitRegistry(
|
|
|
103
102
|
lambda s: s.replace("%", " percent "),
|
|
104
103
|
],
|
|
105
104
|
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
ureg.define(
|
|
109
|
-
|
|
105
|
+
if "percent" not in ureg:
|
|
106
|
+
# percent is native in pint >= 0.21
|
|
107
|
+
ureg.define("percent = 0.01 = %")
|
|
108
|
+
if "permille" not in ureg:
|
|
109
|
+
# permille is native in pint >= 0.24.2
|
|
110
|
+
ureg.define("permille = 0.001 = ‰ = %%")
|
|
111
|
+
if "ppm" not in ureg:
|
|
112
|
+
# ppm is native in pint >= 0.21
|
|
113
|
+
ureg.define("ppm = 1e-6")
|
|
114
|
+
ureg.define("ppb = 1e-9")
|
|
110
115
|
ureg.define("atom = 1")
|
|
111
116
|
ureg.define("bohr_magneton = e * hbar / (2 * m_e) = µᵇ = µ_B = mu_B")
|
|
112
117
|
ureg.define("electron_mass = 9.1093837015e-31 kg = mₑ = m_e")
|
|
@@ -886,7 +891,9 @@ class Client(SwaggerClient):
|
|
|
886
891
|
host = os.environ.get("MPCONTRIBS_API_HOST", DEFAULT_HOST)
|
|
887
892
|
|
|
888
893
|
if not apikey:
|
|
889
|
-
apikey = os.environ.get("MPCONTRIBS_API_KEY")
|
|
894
|
+
apikey = os.environ.get("MPCONTRIBS_API_KEY", SETTINGS.get("PMG_MAPI_KEY"))
|
|
895
|
+
if apikey and len(apikey) != 32:
|
|
896
|
+
raise MPContribsClientError(f"Invalid API key: {apikey}")
|
|
890
897
|
|
|
891
898
|
if apikey and headers:
|
|
892
899
|
apikey = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: mpcontribs-client
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.10.0
|
|
4
4
|
Summary: client library for MPContribs API
|
|
5
5
|
Home-page: https://github.com/materialsproject/MPContribs/tree/master/mpcontribs-client
|
|
6
6
|
Author: Patrick Huck
|
|
@@ -9,7 +9,7 @@ License: MIT
|
|
|
9
9
|
Requires-Python: >=3.8
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: numpy
|
|
12
|
+
Requires-Dist: numpy
|
|
13
13
|
Requires-Dist: boltons
|
|
14
14
|
Requires-Dist: bravado
|
|
15
15
|
Requires-Dist: filetype
|
|
@@ -17,7 +17,7 @@ Requires-Dist: flatten-dict
|
|
|
17
17
|
Requires-Dist: ipython
|
|
18
18
|
Requires-Dist: json2html
|
|
19
19
|
Requires-Dist: pandas
|
|
20
|
-
Requires-Dist: pint
|
|
20
|
+
Requires-Dist: pint
|
|
21
21
|
Requires-Dist: plotly
|
|
22
22
|
Requires-Dist: pyIsEmail
|
|
23
23
|
Requires-Dist: pymatgen
|
|
@@ -29,12 +29,22 @@ Requires-Dist: ujson
|
|
|
29
29
|
Requires-Dist: semantic-version
|
|
30
30
|
Requires-Dist: cachetools
|
|
31
31
|
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: flake8
|
|
33
|
-
Requires-Dist: pytest
|
|
34
|
-
Requires-Dist: pytest-flake8
|
|
35
|
-
Requires-Dist: pytest-pycodestyle
|
|
36
|
-
Requires-Dist: pytest-cov
|
|
37
|
-
Requires-Dist: py
|
|
32
|
+
Requires-Dist: flake8; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-flake8; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-pycodestyle; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
37
|
+
Requires-Dist: py; extra == "dev"
|
|
38
|
+
Dynamic: author
|
|
39
|
+
Dynamic: author-email
|
|
40
|
+
Dynamic: description
|
|
41
|
+
Dynamic: description-content-type
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: license
|
|
44
|
+
Dynamic: provides-extra
|
|
45
|
+
Dynamic: requires-dist
|
|
46
|
+
Dynamic: requires-python
|
|
47
|
+
Dynamic: summary
|
|
38
48
|
|
|
39
49
|

|
|
40
50
|

|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
mpcontribs/client/__init__.py,sha256=0orUhfmCeQN9Qt6dIWl3kWhTye81zLIg1Kvb9EOhvys,96959
|
|
2
|
+
mpcontribs_client-5.10.0.dist-info/LICENSE,sha256=5tG0Niaqw2hnuyZZYkRXLSnfVrZA47COwduU_6caPLM,1074
|
|
3
|
+
mpcontribs_client-5.10.0.dist-info/METADATA,sha256=29GsT_gTk4wQk_bem_5bwUHkeWsGbPyqdKapniQ_VV4,2776
|
|
4
|
+
mpcontribs_client-5.10.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
5
|
+
mpcontribs_client-5.10.0.dist-info/top_level.txt,sha256=t8R5L_Dg9oDQMh2gyRFdZGnrzZsr7OjCBTrhTcmimC8,11
|
|
6
|
+
mpcontribs_client-5.10.0.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
mpcontribs/client/__init__.py,sha256=xvHBjJnbIEwA9Ubg9a_sbqp0zbG8rVCoKutiY_cA5M4,96799
|
|
2
|
-
mpcontribs_client-5.8.4.dist-info/LICENSE,sha256=5tG0Niaqw2hnuyZZYkRXLSnfVrZA47COwduU_6caPLM,1074
|
|
3
|
-
mpcontribs_client-5.8.4.dist-info/METADATA,sha256=L9NNJo4IpeKVPQoRnETAc0XuJgYHSA5wEzcPwhhe-gw,2572
|
|
4
|
-
mpcontribs_client-5.8.4.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
|
5
|
-
mpcontribs_client-5.8.4.dist-info/top_level.txt,sha256=t8R5L_Dg9oDQMh2gyRFdZGnrzZsr7OjCBTrhTcmimC8,11
|
|
6
|
-
mpcontribs_client-5.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|