Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev/generate_mcp_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def regenerate_tools(
COORDINATION_GEOMETRIES_IUPAC,
COORDINATION_GEOMETRIES_NAMES,
)
from emmet.core.electronic_structure import BSPathType, DOSProjectionType
from emmet.core.band_theory import BSPathType
from emmet.core.electronic_structure import DOSProjectionType
from emmet.core.grain_boundary import GBTypeEnum
from emmet.core.mpid import MPID
from emmet.core.thermo import ThermoType
Expand Down
6 changes: 4 additions & 2 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from functools import cache, lru_cache
from typing import TYPE_CHECKING

from emmet.core.electronic_structure import BSPathType
from emmet.core.band_theory import BSPathType
from emmet.core.mpid import MPID, AlphaID
from emmet.core.types.enums import ThermoType
from emmet.core.vasp.calc_types import CalcType
Expand Down Expand Up @@ -1231,9 +1231,11 @@ def get_charge_density_from_task_id(
Returns:
(Chgcar, (Chgcar, CoreTaskDoc | dict), None): Pymatgen Chgcar object, or tuple with object and CoreTaskDoc
"""
# TODO: change when `validate_ids` is updated to return AlphaID
validated_id = AlphaID(validate_ids([task_id])[0].split("-")[-1], prefix="mp")
chgcar = self.materials.tasks._query_open_data(
bucket="materialsproject-parsed",
key=f"chgcars/{validate_ids([task_id])[0]}.json.gz",
key=f"chgcars/{validated_id.string}.json.gz",
decoder=lambda x: load_json(x, deser=True),
)[0][0]["data"]

Expand Down
2 changes: 1 addition & 1 deletion mp_api/client/routes/materials/electronic_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from collections import defaultdict
from typing import TYPE_CHECKING

from emmet.core.band_theory import BSPathType
from emmet.core.electronic_structure import (
BSPathType,
DOSProjectionType,
ElectronicStructureDoc,
)
Expand Down
8 changes: 7 additions & 1 deletion mp_api/client/routes/materials/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ def search(
if isinstance(task_ids, str):
task_ids = [task_ids]

query_params.update({"task_ids": ",".join(validate_ids(task_ids))})
# TODO: this should just be a join on `validate_ids`,
# once `validate_ids` returns AlphaID
validated = validate_ids(task_ids)
validated += [
str(AlphaID(task_id.split("-")[-1], padlen=8)) for task_id in validated
]
query_params["task_ids"] = ",".join(validated)

if formula:
query_params.update({"formula": formula})
Expand Down
3 changes: 2 additions & 1 deletion mp_api/mcp/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
COORDINATION_GEOMETRIES_IUPAC,
COORDINATION_GEOMETRIES_NAMES,
)
from emmet.core.electronic_structure import BSPathType, DOSProjectionType
from emmet.core.band_theory import BSPathType
from emmet.core.electronic_structure import DOSProjectionType
from emmet.core.grain_boundary import GBTypeEnum
from emmet.core.mpid import MPID
from emmet.core.summary import HasProps
Expand Down
26 changes: 13 additions & 13 deletions requirements/requirements-ubuntu-latest_py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ bibtexparser==1.4.4
# via pymatgen-core
blake3==1.0.8
# via emmet-core
boto3==1.42.90
boto3==1.42.94
# via mp-api (pyproject.toml)
botocore==1.42.90
botocore==1.42.94
# via
# boto3
# s3transfer
certifi==2026.2.25
certifi==2026.4.22
# via requests
charset-normalizer==3.4.7
# via requests
contourpy==1.3.3
# via matplotlib
cycler==0.12.1
# via matplotlib
deltalake==1.5.0
deltalake==1.5.1
# via mp-api (pyproject.toml)
deprecated==1.3.1
# via deltalake
emmet-core==0.86.4rc1
emmet-core==0.86.4rc2
# via mp-api (pyproject.toml)
fonttools==4.62.1
# via matplotlib
idna==3.11
idna==3.13
# via requests
inflect==7.5.0
# via emmet-core
Expand All @@ -48,7 +48,7 @@ kiwisolver==1.5.0
# via matplotlib
latexcodec==3.0.1
# via pybtex
lxml==6.0.4
lxml==6.1.0
# via pymatgen-core
matplotlib==3.10.8
# via pymatgen-core
Expand All @@ -61,7 +61,7 @@ more-itertools==11.0.2
# via inflect
mpmath==1.3.0
# via sympy
narwhals==2.19.0
narwhals==2.20.0
# via plotly
networkx==3.6.1
# via pymatgen-core
Expand Down Expand Up @@ -93,18 +93,18 @@ plotly==6.7.0
# via pymatgen-core
pubchempy==1.0.5
# via emmet-core
pyarrow==23.0.1
pyarrow==24.0.0
# via mp-api (pyproject.toml)
pybtex==0.26.1
# via emmet-core
pydantic==2.13.1
pydantic==2.13.3
# via
# emmet-core
# pydantic-settings
# pymatgen-io-validation
pydantic-core==2.46.1
pydantic-core==2.46.3
# via pydantic
pydantic-settings==2.13.1
pydantic-settings==2.14.0
# via
# emmet-core
# pymatgen-io-validation
Expand Down Expand Up @@ -137,7 +137,7 @@ requests==2.33.1
# pymatgen-io-validation
ruamel-yaml==0.19.1
# via monty
s3transfer==0.16.0
s3transfer==0.16.1
# via boto3
scipy==1.17.1
# via pymatgen-core
Expand Down
55 changes: 29 additions & 26 deletions requirements/requirements-ubuntu-latest_py3.11_extras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ attrs==26.1.0
# cyclopts
# jsonschema
# referencing
authlib==1.6.11
authlib==1.7.0
# via fastmcp
babel==2.18.0
# via sphinx
Expand All @@ -47,23 +47,23 @@ blinker==1.9.0
# via flask
boltons==25.0.0
# via mpcontribs-client
boto3==1.42.90
boto3==1.42.94
# via mp-api (pyproject.toml)
botocore==1.42.90
botocore==1.42.94
# via
# boto3
# s3transfer
bravado==12.0.1
# via mpcontribs-client
bravado-core==6.1.1
bravado-core==6.3.1
# via bravado
cachetools==7.0.5
cachetools==7.0.6
# via
# mpcontribs-client
# py-key-value-aio
caio==0.9.25
# via aiofile
certifi==2026.2.25
certifi==2026.4.22
# via
# httpcore
# httpx
Expand All @@ -74,7 +74,7 @@ cfgv==3.5.0
# via pre-commit
charset-normalizer==3.4.7
# via requests
click==8.3.2
click==8.3.3
# via
# flask
# uvicorn
Expand All @@ -85,17 +85,18 @@ coverage[toml]==7.13.5
cryptography==46.0.7
# via
# authlib
# joserfc
# pyjwt
# secretstorage
custodian==2025.12.14
# via mp-api (pyproject.toml)
cycler==0.12.1
# via matplotlib
cyclopts==4.10.2
cyclopts==4.11.0
# via fastmcp
decorator==5.2.1
# via ipython
deltalake==1.5.0
deltalake==1.5.1
# via mp-api (pyproject.toml)
deprecated==1.3.1
# via deltalake
Expand All @@ -114,7 +115,7 @@ docutils==0.22.4
# sphinx
email-validator==2.3.0
# via pydantic
emmet-core[all]==0.86.4rc1
emmet-core[all]==0.86.4rc2
# via mp-api (pyproject.toml)
exceptiongroup==1.3.1
# via fastmcp
Expand All @@ -124,7 +125,7 @@ executing==2.2.1
# via stack-data
fastmcp==3.2.4
# via mp-api (pyproject.toml)
filelock==3.28.0
filelock==3.29.0
# via
# python-discovery
# virtualenv
Expand Down Expand Up @@ -158,9 +159,9 @@ httpx==0.28.1
# mcp
httpx-sse==0.4.3
# via mcp
identify==2.6.18
identify==2.6.19
# via pre-commit
idna==3.11
idna==3.13
# via
# anyio
# email-validator
Expand Down Expand Up @@ -213,6 +214,8 @@ joblib==1.5.3
# via
# pymatgen-analysis-diffusion
# pymatgen-core
joserfc==1.6.4
# via authlib
json2html==1.3.0
# via mpcontribs-client
jsonpointer==3.1.1
Expand Down Expand Up @@ -242,7 +245,7 @@ lazy-loader==0.5
# via scikit-image
librt==0.9.0
# via mypy
lxml==6.0.4
lxml==6.1.0
# via pymatgen-core
markdown-it-py==4.0.0
# via rich
Expand Down Expand Up @@ -287,13 +290,13 @@ msgpack==1.1.2
# via
# bravado
# bravado-core
mypy==1.20.1
mypy==1.20.2
# via mp-api (pyproject.toml)
mypy-extensions==1.1.0
# via
# mp-api (pyproject.toml)
# mypy
narwhals==2.19.0
narwhals==2.20.0
# via plotly
networkx==3.6.1
# via
Expand Down Expand Up @@ -349,7 +352,7 @@ parso==0.8.6
# via jedi
pathable==0.5.0
# via jsonschema-path
pathspec==1.0.4
pathspec==1.1.0
# via mypy
pexpect==4.9.0
# via ipython
Expand All @@ -374,7 +377,7 @@ pluggy==1.6.0
# via
# pytest
# pytest-cov
pre-commit==4.5.1
pre-commit==4.6.0
# via mp-api (pyproject.toml)
prompt-toolkit==3.0.52
# via ipython
Expand All @@ -388,7 +391,7 @@ pure-eval==0.2.3
# via stack-data
py-key-value-aio[filetree,keyring,memory]==0.4.4
# via fastmcp
pyarrow==23.0.1
pyarrow==24.0.0
# via
# emmet-core
# mp-api (pyproject.toml)
Expand All @@ -400,17 +403,17 @@ pycodestyle==2.14.0
# mp-api (pyproject.toml)
pycparser==3.0
# via cffi
pydantic[email]==2.13.1
pydantic[email]==2.13.3
# via
# emmet-core
# fastmcp
# mcp
# openapi-pydantic
# pydantic-settings
# pymatgen-io-validation
pydantic-core==2.46.1
pydantic-core==2.46.3
# via pydantic
pydantic-settings==2.13.1
pydantic-settings==2.14.0
# via
# emmet-core
# mcp
Expand Down Expand Up @@ -448,7 +451,7 @@ pymatgen-core==2026.4.16
# via pymatgen
pymatgen-io-validation==0.1.2
# via emmet-core
pymongo==4.16.0
pymongo==4.17.0
# via
# emmet-core
# mpcontribs-client
Expand Down Expand Up @@ -539,7 +542,7 @@ ruamel-yaml==0.19.1
# via
# custodian
# monty
s3transfer==0.16.0
s3transfer==0.16.1
# via boto3
scikit-image==0.26.0
# via pymatgen-analysis-defects
Expand All @@ -556,7 +559,7 @@ seekpath==2.2.1
# via emmet-core
shapely==2.1.2
# via pymatgen-analysis-alloys
simplejson==3.20.2
simplejson==4.1.0
# via
# bravado
# bravado-core
Expand Down Expand Up @@ -665,7 +668,7 @@ urllib3==2.6.3
# botocore
# requests
# types-requests
uvicorn==0.44.0
uvicorn==0.46.0
# via
# fastmcp
# mcp
Expand Down
Loading
Loading