mp-api 0.46.2rc11__tar.gz → 0.46.2rc12__tar.gz
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.
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/PKG-INFO +1 -1
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/client.py +64 -15
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/materials.py +4 -1
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/PKG-INFO +1 -1
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.coveragerc +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.github/workflows/lint.yml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.github/workflows/release.yml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.github/workflows/testing.yml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.github/workflows/upgrade_dependencies.yml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.gitignore +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/.pre-commit-config.yaml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/CODE_OF_CONDUCT.md +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/LICENSE +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/README.md +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/dev/generate_mcp_tools.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/dev/inspect_mcp.sh +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/Makefile +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/_templates/custom-class-template.rst +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/_templates/custom-module-template.rst +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/conf.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/index.rst +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/make.bat +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/docs/modules.rst +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/_test_utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/_server_utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/_logger.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/_types.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/_units.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/client.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/schemas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/settings.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/contribs/utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/_oxygen_evolution.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/exceptions.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/schemas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/settings.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/core/utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/mprester.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/_server.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/absorption.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/alloys.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/bonds.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/chemenv.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/dielectric.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/doi.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/elasticity.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/electrodes.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/electronic_structure.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/eos.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/grain_boundaries.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/magnetism.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/oxidation_states.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/phonon.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/piezo.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/provenance.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/robocrys.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/similarity.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/substrates.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/summary.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/surface_properties.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/synthesis.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/tasks.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/thermo.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/xas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/molecules/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/molecules/jcesr.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/molecules/molecules.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/molecules/summary.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/_schemas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/mp_mcp.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/server.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/tools.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/mcp/utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/py.typed +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/SOURCES.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/dependency_links.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/entry_points.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/requires.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api.egg-info/top_level.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/pyproject.toml +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.11.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.11_extras.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.12.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.12_extras.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.13.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.13_extras.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.14.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.14_extras.txt +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/setup.cfg +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/test_files/Si_mp_149.cif +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/contribs/conftest.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/contribs/test_client.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/contribs/test_contribs_schemas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/contribs/test_contribs_utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/contribs/test_types.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/core/test_oxygen_evolution.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/core/test_schemas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/core/test_utils.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_absorption.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_alloys.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_bonds.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_chemenv.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_dielectric.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_doi.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_elasticity.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_electrodes.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_electronic_structure.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_eos.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_grain_boundary.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_magnetism.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_materials.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_oxidation_states.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_phonon.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_piezo.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_provenance.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_robocrys.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_similarity.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_substrates.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_summary.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_surface_properties.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_synthesis.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_tasks.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_thermo.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/materials/test_xas.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/molecules/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/molecules/test_jcesr.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/molecules/test_molecules.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/molecules/test_summary.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/test_client.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/test_core_client.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/test_heartbeat.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/client/test_mprester.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/mcp/__init__.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/mcp/test_server.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/mcp/test_tools.py +0 -0
- {mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/tests/mcp/test_utils.py +0 -0
|
@@ -33,7 +33,7 @@ import requests
|
|
|
33
33
|
from botocore import UNSIGNED
|
|
34
34
|
from botocore.config import Config
|
|
35
35
|
from botocore.exceptions import ClientError
|
|
36
|
-
from deltalake import DeltaTable, QueryBuilder, convert_to_deltalake
|
|
36
|
+
from deltalake import DeltaTable, QueryBuilder, Schema, convert_to_deltalake
|
|
37
37
|
from emmet.core.arrow import arrowize
|
|
38
38
|
from emmet.core.utils import jsanitize
|
|
39
39
|
from pydantic import BaseModel
|
|
@@ -79,6 +79,13 @@ STATIC_COLLECTIONS = [
|
|
|
79
79
|
"synth-descriptions",
|
|
80
80
|
"xas",
|
|
81
81
|
]
|
|
82
|
+
CONTROLLED_COLLECTIONS = [
|
|
83
|
+
"chemenv",
|
|
84
|
+
"materials",
|
|
85
|
+
"oxidation-states",
|
|
86
|
+
"summary",
|
|
87
|
+
"thermo",
|
|
88
|
+
]
|
|
82
89
|
|
|
83
90
|
hdlr = logging.StreamHandler()
|
|
84
91
|
fmt = logging.Formatter("%(name)s - %(levelname)s - %(message)s")
|
|
@@ -683,6 +690,7 @@ class BaseRester(_Rester):
|
|
|
683
690
|
bucket: str,
|
|
684
691
|
prefix: str,
|
|
685
692
|
access_controlled: bool = True,
|
|
693
|
+
versioned: bool = False,
|
|
686
694
|
timeout: int | None = None,
|
|
687
695
|
label: str | None = None,
|
|
688
696
|
) -> dict[str, Any]:
|
|
@@ -692,12 +700,16 @@ class BaseRester(_Rester):
|
|
|
692
700
|
bucket (str) : S3 OpenData bucket
|
|
693
701
|
prefix (str) : S3 object prefix
|
|
694
702
|
access_controlled (bool): whether or not table has access controlled data
|
|
703
|
+
versioned (bool): whether or not table is partitioned on db version
|
|
695
704
|
timeout (int or None) : timeout on getting access-controlled groups
|
|
696
705
|
label (str or None) : label of the table in QueryBuilder
|
|
697
706
|
|
|
698
707
|
Returns:
|
|
699
708
|
dict of str to Any
|
|
700
709
|
"""
|
|
710
|
+
# just in case
|
|
711
|
+
prefix = prefix.rstrip("/")
|
|
712
|
+
|
|
701
713
|
# Check if user has access to GNoMe
|
|
702
714
|
# temp suppress tqdm
|
|
703
715
|
re_enable = not self.mute_progress_bars
|
|
@@ -755,11 +767,15 @@ class BaseRester(_Rester):
|
|
|
755
767
|
controlled_batch_str = ",".join(
|
|
756
768
|
[f"'{tag}'" for tag in self.access_controlled_batch_ids]
|
|
757
769
|
)
|
|
770
|
+
_coll = prefix.split("/")[-1]
|
|
771
|
+
|
|
772
|
+
if _coll == "tasks":
|
|
773
|
+
condition = f"batch_id NOT IN ({controlled_batch_str})"
|
|
774
|
+
else:
|
|
775
|
+
condition = "builder_meta.license != 'BY-NC'"
|
|
758
776
|
|
|
759
777
|
predicate = (
|
|
760
|
-
f"WHERE
|
|
761
|
-
if not has_gnome_access and controlled_batch_str and access_controlled
|
|
762
|
-
else ""
|
|
778
|
+
f"WHERE {condition}" if not has_gnome_access and access_controlled else ""
|
|
763
779
|
)
|
|
764
780
|
# TODO: do we need something like this?
|
|
765
781
|
# predicate += f"{' AND ' if predicate else 'WHERE '}version='{self.db_version}'"
|
|
@@ -768,10 +784,13 @@ class BaseRester(_Rester):
|
|
|
768
784
|
num_docs_needed: int = tbl.count()
|
|
769
785
|
|
|
770
786
|
if not has_gnome_access:
|
|
787
|
+
mongo_predicate = (
|
|
788
|
+
{"batch_id_neq_any": self.access_controlled_batch_ids}
|
|
789
|
+
if _coll == "tasks"
|
|
790
|
+
else {"license": "BY-NC"}
|
|
791
|
+
)
|
|
771
792
|
try:
|
|
772
|
-
num_docs_needed = self.count(
|
|
773
|
-
{"batch_id_neq_any": self.access_controlled_batch_ids}
|
|
774
|
-
)
|
|
793
|
+
num_docs_needed = self.count(mongo_predicate)
|
|
775
794
|
except MPRestError:
|
|
776
795
|
# batch_id isn't a valid field
|
|
777
796
|
num_docs_needed = self.count()
|
|
@@ -793,7 +812,12 @@ class BaseRester(_Rester):
|
|
|
793
812
|
|
|
794
813
|
file_options = ds.ParquetFileFormat().make_write_options(compression="zstd")
|
|
795
814
|
|
|
796
|
-
def _flush(
|
|
815
|
+
def _flush(
|
|
816
|
+
accumulator: list[pa.RecordBatch],
|
|
817
|
+
group: int,
|
|
818
|
+
schema: pa.Schema,
|
|
819
|
+
partitioning: pa.dataset.partitioning,
|
|
820
|
+
):
|
|
797
821
|
# somewhere post datafusion 51.0.0 and arrow-rs 57.0.0
|
|
798
822
|
# casts to *View types began, need to cast back to base schema
|
|
799
823
|
# -> pyarrow is behind on implementation support for *View types
|
|
@@ -807,6 +831,7 @@ class BaseRester(_Rester):
|
|
|
807
831
|
tbl,
|
|
808
832
|
base_dir=target_path,
|
|
809
833
|
format="parquet",
|
|
834
|
+
partitioning=partitioning,
|
|
810
835
|
basename_template=f"group-{group}-" + "part-{i}.zstd.parquet",
|
|
811
836
|
existing_data_behavior="overwrite_or_ignore",
|
|
812
837
|
max_rows_per_group=1024,
|
|
@@ -816,7 +841,18 @@ class BaseRester(_Rester):
|
|
|
816
841
|
group = 1
|
|
817
842
|
size = 0
|
|
818
843
|
accumulator = []
|
|
819
|
-
|
|
844
|
+
_schema = pa.schema(arrowize(self.document_model))
|
|
845
|
+
schema = (
|
|
846
|
+
_schema.insert(0, pa.field("version", pa.string()))
|
|
847
|
+
if versioned
|
|
848
|
+
else _schema
|
|
849
|
+
)
|
|
850
|
+
partitioning_schema = pa.schema([pa.field("version", pa.string())])
|
|
851
|
+
partitioning = (
|
|
852
|
+
pa.dataset.partitioning(partitioning_schema, flavor="hive")
|
|
853
|
+
if versioned
|
|
854
|
+
else None
|
|
855
|
+
)
|
|
820
856
|
for page in iterator:
|
|
821
857
|
# arro3 rb to pyarrow rb for compat w/ pyarrow ds writer
|
|
822
858
|
rg = pa.record_batch(page)
|
|
@@ -828,13 +864,13 @@ class BaseRester(_Rester):
|
|
|
828
864
|
pbar.update(page_size)
|
|
829
865
|
|
|
830
866
|
if size >= MAPI_CLIENT_SETTINGS.DATASET_FLUSH_THRESHOLD:
|
|
831
|
-
_flush(accumulator, group, schema)
|
|
867
|
+
_flush(accumulator, group, schema, partitioning)
|
|
832
868
|
group += 1
|
|
833
869
|
size = 0
|
|
834
870
|
accumulator.clear()
|
|
835
871
|
|
|
836
872
|
if accumulator:
|
|
837
|
-
_flush(accumulator, group + 1, schema)
|
|
873
|
+
_flush(accumulator, group + 1, schema, partitioning)
|
|
838
874
|
|
|
839
875
|
if pbar is not None:
|
|
840
876
|
pbar.close()
|
|
@@ -842,7 +878,13 @@ class BaseRester(_Rester):
|
|
|
842
878
|
logger.info(f"Dataset for {suffix} written to {target_path}")
|
|
843
879
|
logger.info("Converting to DeltaTable...")
|
|
844
880
|
|
|
845
|
-
|
|
881
|
+
delta_paritioning = Schema.from_arrow(partitioning_schema)
|
|
882
|
+
|
|
883
|
+
convert_to_deltalake(
|
|
884
|
+
target_path,
|
|
885
|
+
partition_by=delta_paritioning if versioned else None,
|
|
886
|
+
partition_strategy="hive" if versioned else None,
|
|
887
|
+
)
|
|
846
888
|
|
|
847
889
|
logger.info(
|
|
848
890
|
"Consult the delta-rs and pyarrow documentation for advanced usage: "
|
|
@@ -928,13 +970,15 @@ class BaseRester(_Rester):
|
|
|
928
970
|
suffix = self.suffix
|
|
929
971
|
elif self.suffix == "molecules/summary":
|
|
930
972
|
suffix = "molecules"
|
|
973
|
+
elif self.suffix == "molecules/jcesr":
|
|
974
|
+
suffix = "jcesr"
|
|
931
975
|
else:
|
|
932
976
|
infix, suffix = self.suffix.split("/", 1)
|
|
933
977
|
suffix = infix if suffix == "core" else suffix
|
|
934
978
|
suffix = suffix.replace("_", "-")
|
|
935
979
|
|
|
936
980
|
if "tasks" in suffix:
|
|
937
|
-
bucket_suffix, prefix = ("parsed", "core/tasks
|
|
981
|
+
bucket_suffix, prefix = ("parsed", "core/tasks")
|
|
938
982
|
elif suffix in STATIC_COLLECTIONS:
|
|
939
983
|
bucket_suffix = "build"
|
|
940
984
|
prefix = f"static-collections/{suffix}"
|
|
@@ -946,9 +990,14 @@ class BaseRester(_Rester):
|
|
|
946
990
|
bucket = f"materialsproject-{bucket_suffix}"
|
|
947
991
|
|
|
948
992
|
if self.delta_backed:
|
|
949
|
-
access_controlled = suffix
|
|
993
|
+
access_controlled = suffix in CONTROLLED_COLLECTIONS
|
|
994
|
+
versioned = suffix != "tasks" and suffix not in STATIC_COLLECTIONS
|
|
950
995
|
return self._query_delta_backed(
|
|
951
|
-
bucket,
|
|
996
|
+
bucket=bucket,
|
|
997
|
+
prefix=prefix,
|
|
998
|
+
access_controlled=access_controlled,
|
|
999
|
+
versioned=versioned,
|
|
1000
|
+
timeout=timeout,
|
|
952
1001
|
)
|
|
953
1002
|
|
|
954
1003
|
# Paginate over all entries in the bucket.
|
|
@@ -102,7 +102,7 @@ class MaterialsRester(CoreRester):
|
|
|
102
102
|
Returns:
|
|
103
103
|
([MaterialsDoc], [dict]) List of material documents or dictionaries.
|
|
104
104
|
"""
|
|
105
|
-
query_params: dict =
|
|
105
|
+
query_params: dict = dict()
|
|
106
106
|
|
|
107
107
|
if material_ids:
|
|
108
108
|
if isinstance(material_ids, str):
|
|
@@ -163,6 +163,9 @@ class MaterialsRester(CoreRester):
|
|
|
163
163
|
if query_params[entry] is not None
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
if query_params:
|
|
167
|
+
query_params.update({"deprecated": deprecated})
|
|
168
|
+
|
|
166
169
|
return super()._search( # type: ignore[return-value]
|
|
167
170
|
num_chunks=num_chunks,
|
|
168
171
|
chunk_size=chunk_size,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/electronic_structure.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/mp_api/client/routes/materials/surface_properties.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.11_extras.txt
RENAMED
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.12_extras.txt
RENAMED
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.13_extras.txt
RENAMED
|
File without changes
|
|
File without changes
|
{mp_api-0.46.2rc11 → mp_api-0.46.2rc12}/requirements/requirements-ubuntu-latest_py3.14_extras.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|