mpcontribs-client 5.10.0__py3-none-any.whl → 5.10.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.
- mpcontribs/client/__init__.py +9 -9
- {mpcontribs_client-5.10.0.dist-info → mpcontribs_client-5.10.1.dist-info}/METADATA +1 -1
- mpcontribs_client-5.10.1.dist-info/RECORD +6 -0
- {mpcontribs_client-5.10.0.dist-info → mpcontribs_client-5.10.1.dist-info}/WHEEL +1 -1
- mpcontribs_client-5.10.0.dist-info/RECORD +0 -6
- {mpcontribs_client-5.10.0.dist-info → mpcontribs_client-5.10.1.dist-info}/LICENSE +0 -0
- {mpcontribs_client-5.10.0.dist-info → mpcontribs_client-5.10.1.dist-info}/top_level.txt +0 -0
mpcontribs/client/__init__.py
CHANGED
|
@@ -115,6 +115,7 @@ ureg.define("ppb = 1e-9")
|
|
|
115
115
|
ureg.define("atom = 1")
|
|
116
116
|
ureg.define("bohr_magneton = e * hbar / (2 * m_e) = µᵇ = µ_B = mu_B")
|
|
117
117
|
ureg.define("electron_mass = 9.1093837015e-31 kg = mₑ = m_e")
|
|
118
|
+
ureg.define("sccm = cm³/min")
|
|
118
119
|
|
|
119
120
|
LOG_LEVEL = os.environ.get("MPCONTRIBS_CLIENT_LOG_LEVEL", "INFO")
|
|
120
121
|
log_level = getattr(logging, LOG_LEVEL.upper())
|
|
@@ -1402,7 +1403,7 @@ class Client(SwaggerClient):
|
|
|
1402
1403
|
self.attachments.getAttachmentById(pk=aid, _fields=["_all"]).result()
|
|
1403
1404
|
)
|
|
1404
1405
|
|
|
1405
|
-
def init_columns(self, columns: dict = None) -> dict:
|
|
1406
|
+
def init_columns(self, columns: dict = None, name: str = None) -> dict:
|
|
1406
1407
|
"""initialize columns for a project to set their order and desired units
|
|
1407
1408
|
|
|
1408
1409
|
The `columns` field of a project tracks the minima and maxima of each `data` field
|
|
@@ -1435,8 +1436,11 @@ class Client(SwaggerClient):
|
|
|
1435
1436
|
Args:
|
|
1436
1437
|
columns (dict): dictionary mapping data column to its unit
|
|
1437
1438
|
"""
|
|
1438
|
-
|
|
1439
|
-
|
|
1439
|
+
name = self.project or name
|
|
1440
|
+
if not name:
|
|
1441
|
+
raise MPContribsClientError(
|
|
1442
|
+
"initialize client with project or set `name` argument!"
|
|
1443
|
+
)
|
|
1440
1444
|
|
|
1441
1445
|
columns = flatten(columns or {}, reducer="dot")
|
|
1442
1446
|
|
|
@@ -1497,9 +1501,7 @@ class Client(SwaggerClient):
|
|
|
1497
1501
|
|
|
1498
1502
|
# TODO catch unsupported column renaming or implement solution
|
|
1499
1503
|
# reconcile with existing columns
|
|
1500
|
-
resp = self.projects.getProjectByName(
|
|
1501
|
-
pk=self.project, _fields=["columns"]
|
|
1502
|
-
).result()
|
|
1504
|
+
resp = self.projects.getProjectByName(pk=name, _fields=["columns"]).result()
|
|
1503
1505
|
existing_columns = {}
|
|
1504
1506
|
|
|
1505
1507
|
for col in resp["columns"]:
|
|
@@ -1556,9 +1558,7 @@ class Client(SwaggerClient):
|
|
|
1556
1558
|
if not valid:
|
|
1557
1559
|
raise MPContribsClientError(error)
|
|
1558
1560
|
|
|
1559
|
-
return self.projects.updateProjectByName(
|
|
1560
|
-
pk=self.project, project=payload
|
|
1561
|
-
).result()
|
|
1561
|
+
return self.projects.updateProjectByName(pk=name, project=payload).result()
|
|
1562
1562
|
|
|
1563
1563
|
def delete_contributions(self, query: dict = None, timeout: int = -1):
|
|
1564
1564
|
"""Remove all contributions for a query
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
mpcontribs/client/__init__.py,sha256=SmVQBVOTWRYfX-rUXEP1gdPkJANxWdTDUP5c679yRSU,97012
|
|
2
|
+
mpcontribs_client-5.10.1.dist-info/LICENSE,sha256=5tG0Niaqw2hnuyZZYkRXLSnfVrZA47COwduU_6caPLM,1074
|
|
3
|
+
mpcontribs_client-5.10.1.dist-info/METADATA,sha256=vsvzgHYxTxXppTw3ZaCu7mJU4HAmmvOgKZdwv3ijg-o,2776
|
|
4
|
+
mpcontribs_client-5.10.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
5
|
+
mpcontribs_client-5.10.1.dist-info/top_level.txt,sha256=t8R5L_Dg9oDQMh2gyRFdZGnrzZsr7OjCBTrhTcmimC8,11
|
|
6
|
+
mpcontribs_client-5.10.1.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
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,,
|
|
File without changes
|
|
File without changes
|