From 461b4d05804fc8d812fce57c7ec2b6a35b0bd165 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Thu, 14 Aug 2025 10:42:51 -0700 Subject: [PATCH 01/13] remove maggma dependencies --- LICENSE | 2 +- mp_api/client/core/utils.py | 2 +- mp_api/client/routes/materials/robocrys.py | 2 +- pyproject.toml | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 2ae1bd118..ee5ed1792 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -maggma Copyright (c) 2017, The Regents of the University of +Copyright (c) 2017, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. diff --git a/mp_api/client/core/utils.py b/mp_api/client/core/utils.py index fb25221ff..600c47e5b 100644 --- a/mp_api/client/core/utils.py +++ b/mp_api/client/core/utils.py @@ -4,7 +4,7 @@ from functools import cache from typing import Optional, get_args -from maggma.utils import get_flat_models_from_model +from emmet.core.utils import get_flat_models_from_model from monty.json import MSONable from pydantic import BaseModel from pydantic._internal._utils import lenient_issubclass diff --git a/mp_api/client/routes/materials/robocrys.py b/mp_api/client/routes/materials/robocrys.py index 829a78253..bf24ccc65 100644 --- a/mp_api/client/routes/materials/robocrys.py +++ b/mp_api/client/routes/materials/robocrys.py @@ -32,7 +32,7 @@ def search( robocrys_docs = self._query_resource( criteria={"keywords": keyword_string, "_limit": chunk_size}, suburl="text_search", - use_document_model=True, + use_document_model=self.use_document_model, chunk_size=chunk_size, num_chunks=num_chunks, ).get("data", None) diff --git a/pyproject.toml b/pyproject.toml index b75c1f67d..7960aa045 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ dependencies = [ "setuptools", "msgpack", - "maggma>=0.57.1", "pymatgen>=2022.3.7,!=2024.2.20", "typing-extensions>=3.7.4.1", "requests>=2.23.0", From 9682edc190fdb73465a89ee19c330192000e0c2f Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Aug 2025 17:46:31 +0000 Subject: [PATCH 02/13] Update ubuntu-latest dependencies for mp-api --- .../requirements-ubuntu-latest_py3.11.txt | 150 ++++------------ ...quirements-ubuntu-latest_py3.11_extras.txt | 166 +++++++----------- 2 files changed, 89 insertions(+), 227 deletions(-) diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index e35945bd7..14be0b6a3 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -4,214 +4,126 @@ # # pip-compile --output-file=requirements/requirements-ubuntu-latest_py3.11.txt pyproject.toml # -aioitertools==0.12.0 - # via maggma annotated-types==0.7.0 # via pydantic -attrs==25.3.0 - # via - # jsonlines - # jsonschema - # referencing -bcrypt==4.3.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -boto3==1.38.37 - # via maggma -botocore==1.38.37 - # via - # boto3 - # s3transfer -certifi==2025.6.15 +certifi==2025.8.3 # via requests -cffi==1.17.1 - # via - # cryptography - # pynacl -charset-normalizer==3.4.2 +charset-normalizer==3.4.3 # via requests -contourpy==1.3.2 +contourpy==1.3.3 # via matplotlib -cryptography==45.0.4 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.7.0 - # via - # maggma - # pymongo -emmet-core==0.84.8 +emmet-core==0.84.9 # via mp-api (pyproject.toml) -fonttools==4.58.4 +fonttools==4.59.1 # via matplotlib idna==3.10 # via requests -jmespath==1.0.1 - # via - # boto3 - # botocore joblib==1.5.1 # via pymatgen -jsonlines==4.0.0 - # via maggma -jsonschema==4.24.0 - # via maggma -jsonschema-specifications==2025.4.1 - # via jsonschema -kiwisolver==1.4.8 +kiwisolver==1.4.9 # via matplotlib -latexcodec==3.0.0 +latexcodec==3.0.1 # via pybtex -maggma==0.71.5 - # via mp-api (pyproject.toml) -matplotlib==3.10.3 +matplotlib==3.10.5 # via pymatgen -mongomock==4.3.0 - # via maggma monty==2025.3.3 # via # emmet-core - # maggma # mp-api (pyproject.toml) # pymatgen mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via - # maggma - # mp-api (pyproject.toml) -narwhals==1.43.0 + # via mp-api (pyproject.toml) +narwhals==2.1.1 # via plotly networkx==3.5 # via pymatgen -numpy==2.3.0 +numpy==2.3.2 # via # contourpy - # maggma # matplotlib # monty # pandas # pymatgen # scipy # spglib -orjson==3.10.18 - # via - # maggma - # pymatgen +orjson==3.11.2 + # via pymatgen packaging==25.0 # via # matplotlib - # mongomock # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.0 - # via - # maggma - # pymatgen -paramiko==3.5.1 - # via sshtunnel -pillow==11.2.1 +pandas==2.3.1 + # via pymatgen +pillow==11.3.0 # via matplotlib -plotly==6.1.2 +plotly==6.3.0 # via pymatgen -pybtex==0.24.0 +pybtex==0.25.1 # via emmet-core -pycparser==2.22 - # via cffi pydantic==2.11.7 # via # emmet-core - # maggma # pydantic-settings pydantic-core==2.33.2 # via pydantic -pydantic-settings==2.9.1 - # via - # emmet-core - # maggma -pydash==8.0.5 - # via maggma +pydantic-settings==2.10.1 + # via emmet-core pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) -pymongo==4.10.1 - # via maggma -pynacl==1.5.0 - # via paramiko pyparsing==3.2.3 # via # bibtexparser # matplotlib python-dateutil==2.9.0.post0 # via - # botocore - # maggma # matplotlib # pandas -python-dotenv==1.1.0 +python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 - # via - # mongomock - # pandas + # via pandas pyyaml==6.0.2 # via pybtex -pyzmq==27.0.0 - # via maggma -referencing==0.36.2 - # via - # jsonschema - # jsonschema-specifications requests==2.32.4 # via # mp-api (pyproject.toml) # pymatgen -rpds-py==0.25.1 - # via - # jsonschema - # referencing ruamel-yaml==0.18.14 # via - # maggma # monty # pymatgen ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.0 - # via boto3 -scipy==1.15.3 +scipy==1.16.1 # via pymatgen -sentinels==1.0.0 - # via mongomock six==1.17.0 - # via - # pybtex - # python-dateutil -smart-open==7.1.0 + # via python-dateutil +smart-open==7.3.0.post1 # via mp-api (pyproject.toml) spglib==2.6.0 # via pymatgen -sshtunnel==0.4.0 - # via maggma sympy==1.14.0 # via pymatgen tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via - # maggma - # pymatgen -typing-extensions==4.14.0 + # via pymatgen +typing-extensions==4.14.1 # via # emmet-core # mp-api (pyproject.toml) # pydantic # pydantic-core - # pydash - # referencing # spglib # typing-inspection typing-inspection==0.4.1 @@ -222,11 +134,9 @@ tzdata==2025.2 # via pandas uncertainties==3.2.3 # via pymatgen -urllib3==2.4.0 - # via - # botocore - # requests -wrapt==1.17.2 +urllib3==2.5.0 + # via requests +wrapt==1.17.3 # via smart-open # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/requirements-ubuntu-latest_py3.11_extras.txt b/requirements/requirements-ubuntu-latest_py3.11_extras.txt index f1584c710..197fcfcc3 100644 --- a/requirements/requirements-ubuntu-latest_py3.11_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.11_extras.txt @@ -4,36 +4,29 @@ # # pip-compile --all-extras --output-file=requirements/requirements-ubuntu-latest_py3.11_extras.txt pyproject.toml # -aioitertools==0.12.0 - # via maggma alabaster==1.0.0 # via sphinx annotated-types==0.7.0 # via pydantic arrow==1.3.0 # via isoduration -ase==3.25.0 +ase==3.26.0 # via pymatgen-analysis-diffusion asttokens==3.0.0 # via stack-data attrs==25.3.0 # via - # jsonlines # jsonschema # referencing babel==2.17.0 # via sphinx -bcrypt==4.3.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen boltons==25.0.0 # via mpcontribs-client -boto3==1.38.37 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.38.37 +boto3==1.40.9 + # via mp-api (pyproject.toml) +botocore==1.40.9 # via # boto3 # s3transfer @@ -43,48 +36,41 @@ bravado-core==6.1.1 # via bravado cachetools==6.1.0 # via mpcontribs-client -certifi==2025.6.15 +certifi==2025.8.3 # via requests -cffi==1.17.1 - # via - # cryptography - # pynacl cfgv==3.4.0 # via pre-commit -charset-normalizer==3.4.2 +charset-normalizer==3.4.3 # via requests -contourpy==1.3.2 +contourpy==1.3.3 # via matplotlib -coverage[toml]==7.9.1 +coverage[toml]==7.10.3 # via pytest-cov -cryptography==45.0.4 - # via paramiko -custodian==2025.5.12 +custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 # via matplotlib decorator==5.2.1 # via ipython -distlib==0.3.9 +distlib==0.4.0 # via virtualenv dnspython==2.7.0 # via - # maggma # pyisemail # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.8 +emmet-core[all]==0.84.9 # via mp-api (pyproject.toml) executing==2.2.0 # via stack-data -filelock==3.18.0 +filelock==3.19.1 # via # mdanalysis # virtualenv filetype==1.2.0 # via mpcontribs-client -flake8==7.2.0 +flake8==7.3.0 # via mp-api (pyproject.toml) flatten-dict==0.4.2 # via mpcontribs-client @@ -92,13 +78,13 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.58.4 +fonttools==4.59.1 # via matplotlib fqdn==1.5.1 # via jsonschema griddataformats==1.0.2 # via mdanalysis -identify==2.6.12 +identify==2.6.13 # via pre-commit idna==3.10 # via @@ -114,7 +100,7 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.3.0 +ipython==9.4.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -136,32 +122,29 @@ joblib==1.5.1 # scikit-learn json2html==1.3.0 # via mpcontribs-client -jsonlines==4.0.0 - # via maggma jsonpointer==3.0.0 # via jsonschema jsonref==1.1.0 # via bravado-core -jsonschema[format-nongpl]==4.24.0 +jsonschema[format-nongpl]==4.25.0 # via # bravado-core - # maggma # swagger-spec-validator jsonschema-specifications==2025.4.1 # via jsonschema -kiwisolver==1.4.8 +kiwisolver==1.4.9 # via matplotlib -latexcodec==3.0.0 +lark==1.2.2 + # via rfc3987-syntax +latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -maggma==0.71.5 - # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 # via robocrys -matplotlib==3.10.3 +matplotlib==3.10.5 # via # ase # mdanalysis @@ -181,15 +164,12 @@ mdanalysis==2.9.0 # transport-analysis mmtf-python==1.1.3 # via mdanalysis -mongomock==4.3.0 - # via maggma monotonic==1.6 # via bravado monty==2025.3.3 # via # custodian # emmet-core - # maggma # matminer # mp-api (pyproject.toml) # pymatgen @@ -208,16 +188,15 @@ msgpack==1.1.1 # via # bravado # bravado-core - # maggma # mmtf-python # mp-api (pyproject.toml) -mypy==1.16.1 +mypy==1.17.1 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==1.43.0 +narwhals==2.1.1 # via plotly networkx==3.5 # via @@ -232,7 +211,6 @@ numpy==1.26.4 # contourpy # griddataformats # imageio - # maggma # matminer # matplotlib # mdanalysis @@ -257,16 +235,13 @@ numpy==1.26.4 # statsmodels # tidynamics # tifffile -orjson==3.10.18 - # via - # maggma - # pymatgen +orjson==3.11.2 + # via pymatgen packaging==25.0 # via # lazy-loader # matplotlib # mdanalysis - # mongomock # plotly # pytest # scikit-image @@ -274,17 +249,14 @@ packaging==25.0 # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.0 +pandas==2.3.1 # via - # maggma # matminer # mpcontribs-client # pymatgen # seaborn # solvation-analysis # statsmodels -paramiko==3.5.1 - # via sshtunnel parso==0.8.4 # via jedi pathspec==0.12.1 @@ -293,7 +265,7 @@ patsy==1.0.1 # via statsmodels pexpect==4.9.0 # via ipython -pillow==11.2.1 +pillow==11.3.0 # via # imageio # matplotlib @@ -305,7 +277,7 @@ platformdirs==4.3.8 # via # pint # virtualenv -plotly==6.1.2 +plotly==6.3.0 # via # mpcontribs-client # pymatgen @@ -314,7 +286,7 @@ pluggy==1.6.0 # via # pytest # pytest-cov -pre-commit==4.2.0 +pre-commit==4.3.0 # via mp-api (pyproject.toml) prompt-toolkit==3.0.51 # via ipython @@ -326,34 +298,27 @@ pubchempy==1.0.4 # via robocrys pure-eval==0.2.3 # via stack-data -pyarrow==20.0.0 +pyarrow==21.0.0 # via emmet-core -pybtex==0.24.0 +pybtex==0.25.1 # via # emmet-core # robocrys -pycodestyle==2.13.0 +pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pycparser==2.22 - # via cffi pydantic==2.11.7 # via # emmet-core - # maggma # pydantic-settings pydantic-core==2.33.2 # via pydantic -pydantic-settings==2.9.1 - # via - # emmet-core - # maggma -pydash==8.0.5 - # via maggma -pyflakes==3.3.2 +pydantic-settings==2.10.1 + # via emmet-core +pyflakes==3.4.0 # via flake8 -pygments==2.19.1 +pygments==2.19.2 # via # ipython # ipython-pygments-lexers @@ -372,31 +337,28 @@ pymatgen==2025.6.14 # pymatgen-analysis-defects # pymatgen-analysis-diffusion # robocrys -pymatgen-analysis-alloys==0.0.7 +pymatgen-analysis-alloys==0.0.8 # via emmet-core pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymongo==4.10.1 +pymongo==4.14.0 # via - # maggma # matminer # mpcontribs-client -pynacl==1.5.0 - # via paramiko pyparsing==3.2.3 # via # bibtexparser # matplotlib -pytest==8.4.0 +pytest==8.4.1 # via # mp-api (pyproject.toml) # pytest-asyncio # pytest-cov # pytest-mock # solvation-analysis -pytest-asyncio==1.0.0 +pytest-asyncio==1.1.0 # via mp-api (pyproject.toml) pytest-cov==6.2.1 # via mp-api (pyproject.toml) @@ -408,15 +370,13 @@ python-dateutil==2.9.0.post0 # botocore # bravado # bravado-core - # maggma # matplotlib # pandas -python-dotenv==1.1.0 +python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 # via # bravado-core - # mongomock # pandas pyyaml==6.0.2 # via @@ -425,9 +385,7 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -pyzmq==27.0.0 - # via maggma -rdkit==2025.3.3 +rdkit==2025.3.5 # via solvation-analysis referencing==0.36.2 # via @@ -448,30 +406,31 @@ rfc3339-validator==0.1.4 # via jsonschema rfc3986-validator==0.1.1 # via jsonschema +rfc3987-syntax==1.1.0 + # via jsonschema robocrys==0.2.11 # via emmet-core roman-numerals-py==3.1.0 # via sphinx -rpds-py==0.25.1 +rpds-py==0.27.0 # via # jsonschema # referencing ruamel-yaml==0.18.14 # via # custodian - # maggma # monty # pymatgen # robocrys ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.0 +s3transfer==0.13.1 # via boto3 scikit-image==0.25.2 # via pymatgen-analysis-defects -scikit-learn==1.7.0 +scikit-learn==1.7.1 # via matminer -scipy==1.15.3 +scipy==1.16.1 # via # ase # griddataformats @@ -488,8 +447,6 @@ seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.0.0 - # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -501,10 +458,9 @@ six==1.17.0 # bravado # bravado-core # flatten-dict - # pybtex # python-dateutil # rfc3339-validator -smart-open==7.1.0 +smart-open==7.3.0.post1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx @@ -529,11 +485,9 @@ sphinxcontrib-qthelp==2.0.0 # via sphinx sphinxcontrib-serializinghtml==2.0.0 # via sphinx -sshtunnel==0.4.0 - # via maggma stack-data==0.6.3 # via ipython -statsmodels==0.14.4 +statsmodels==0.14.5 # via solvation-analysis swagger-spec-validator==3.0.4 # via @@ -555,7 +509,6 @@ tifffile==2025.6.11 # via scikit-image tqdm==4.67.1 # via - # maggma # matminer # mdanalysis # mpcontribs-client @@ -566,15 +519,15 @@ traitlets==5.14.3 # matplotlib-inline transport-analysis==0.1.2 # via emmet-core -typeguard==4.4.3 +typeguard==4.4.4 # via inflect -types-python-dateutil==2.9.0.20250516 +types-python-dateutil==2.9.0.20250809 # via arrow -types-requests==2.32.4.20250611 +types-requests==2.32.4.20250809 # via mp-api (pyproject.toml) -types-setuptools==80.9.0.20250529 +types-setuptools==80.9.0.20250809 # via mp-api (pyproject.toml) -typing-extensions==4.14.0 +typing-extensions==4.14.1 # via # bravado # emmet-core @@ -586,7 +539,6 @@ typing-extensions==4.14.0 # pint # pydantic # pydantic-core - # pydash # referencing # spglib # swagger-spec-validator @@ -604,18 +556,18 @@ uncertainties==3.2.3 # via pymatgen uri-template==1.3.0 # via jsonschema -urllib3==2.4.0 +urllib3==2.5.0 # via # botocore # requests # types-requests -virtualenv==20.31.2 +virtualenv==20.34.0 # via pre-commit wcwidth==0.2.13 # via prompt-toolkit webcolors==24.11.1 # via jsonschema -wrapt==1.17.2 +wrapt==1.17.3 # via smart-open # The following packages are considered to be unsafe in a requirements file: From 3c0d04053fae07570cd8151641cb3b0699bfaa5d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Aug 2025 17:46:28 +0000 Subject: [PATCH 03/13] Update ubuntu-latest dependencies for mp-api --- .../requirements-ubuntu-latest_py3.12.txt | 150 ++++------------ ...quirements-ubuntu-latest_py3.12_extras.txt | 166 +++++++----------- 2 files changed, 89 insertions(+), 227 deletions(-) diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index 8de2cc856..ad62ed61e 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -4,214 +4,126 @@ # # pip-compile --output-file=requirements/requirements-ubuntu-latest_py3.12.txt pyproject.toml # -aioitertools==0.12.0 - # via maggma annotated-types==0.7.0 # via pydantic -attrs==25.3.0 - # via - # jsonlines - # jsonschema - # referencing -bcrypt==4.3.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -boto3==1.38.37 - # via maggma -botocore==1.38.37 - # via - # boto3 - # s3transfer -certifi==2025.6.15 +certifi==2025.8.3 # via requests -cffi==1.17.1 - # via - # cryptography - # pynacl -charset-normalizer==3.4.2 +charset-normalizer==3.4.3 # via requests -contourpy==1.3.2 +contourpy==1.3.3 # via matplotlib -cryptography==45.0.4 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.7.0 - # via - # maggma - # pymongo -emmet-core==0.84.8 +emmet-core==0.84.9 # via mp-api (pyproject.toml) -fonttools==4.58.4 +fonttools==4.59.1 # via matplotlib idna==3.10 # via requests -jmespath==1.0.1 - # via - # boto3 - # botocore joblib==1.5.1 # via pymatgen -jsonlines==4.0.0 - # via maggma -jsonschema==4.24.0 - # via maggma -jsonschema-specifications==2025.4.1 - # via jsonschema -kiwisolver==1.4.8 +kiwisolver==1.4.9 # via matplotlib -latexcodec==3.0.0 +latexcodec==3.0.1 # via pybtex -maggma==0.71.5 - # via mp-api (pyproject.toml) -matplotlib==3.10.3 +matplotlib==3.10.5 # via pymatgen -mongomock==4.3.0 - # via maggma monty==2025.3.3 # via # emmet-core - # maggma # mp-api (pyproject.toml) # pymatgen mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via - # maggma - # mp-api (pyproject.toml) -narwhals==1.43.0 + # via mp-api (pyproject.toml) +narwhals==2.1.1 # via plotly networkx==3.5 # via pymatgen -numpy==2.3.0 +numpy==2.3.2 # via # contourpy - # maggma # matplotlib # monty # pandas # pymatgen # scipy # spglib -orjson==3.10.18 - # via - # maggma - # pymatgen +orjson==3.11.2 + # via pymatgen packaging==25.0 # via # matplotlib - # mongomock # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.0 - # via - # maggma - # pymatgen -paramiko==3.5.1 - # via sshtunnel -pillow==11.2.1 +pandas==2.3.1 + # via pymatgen +pillow==11.3.0 # via matplotlib -plotly==6.1.2 +plotly==6.3.0 # via pymatgen -pybtex==0.24.0 +pybtex==0.25.1 # via emmet-core -pycparser==2.22 - # via cffi pydantic==2.11.7 # via # emmet-core - # maggma # pydantic-settings pydantic-core==2.33.2 # via pydantic -pydantic-settings==2.9.1 - # via - # emmet-core - # maggma -pydash==8.0.5 - # via maggma +pydantic-settings==2.10.1 + # via emmet-core pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) -pymongo==4.10.1 - # via maggma -pynacl==1.5.0 - # via paramiko pyparsing==3.2.3 # via # bibtexparser # matplotlib python-dateutil==2.9.0.post0 # via - # botocore - # maggma # matplotlib # pandas -python-dotenv==1.1.0 +python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 - # via - # mongomock - # pandas + # via pandas pyyaml==6.0.2 # via pybtex -pyzmq==27.0.0 - # via maggma -referencing==0.36.2 - # via - # jsonschema - # jsonschema-specifications requests==2.32.4 # via # mp-api (pyproject.toml) # pymatgen -rpds-py==0.25.1 - # via - # jsonschema - # referencing ruamel-yaml==0.18.14 # via - # maggma # monty # pymatgen ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.0 - # via boto3 -scipy==1.15.3 +scipy==1.16.1 # via pymatgen -sentinels==1.0.0 - # via mongomock six==1.17.0 - # via - # pybtex - # python-dateutil -smart-open==7.1.0 + # via python-dateutil +smart-open==7.3.0.post1 # via mp-api (pyproject.toml) spglib==2.6.0 # via pymatgen -sshtunnel==0.4.0 - # via maggma sympy==1.14.0 # via pymatgen tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via - # maggma - # pymatgen -typing-extensions==4.14.0 + # via pymatgen +typing-extensions==4.14.1 # via # emmet-core # mp-api (pyproject.toml) # pydantic # pydantic-core - # pydash - # referencing # spglib # typing-inspection typing-inspection==0.4.1 @@ -222,11 +134,9 @@ tzdata==2025.2 # via pandas uncertainties==3.2.3 # via pymatgen -urllib3==2.4.0 - # via - # botocore - # requests -wrapt==1.17.2 +urllib3==2.5.0 + # via requests +wrapt==1.17.3 # via smart-open # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/requirements-ubuntu-latest_py3.12_extras.txt b/requirements/requirements-ubuntu-latest_py3.12_extras.txt index bf6951ce0..f3e283308 100644 --- a/requirements/requirements-ubuntu-latest_py3.12_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.12_extras.txt @@ -4,36 +4,29 @@ # # pip-compile --all-extras --output-file=requirements/requirements-ubuntu-latest_py3.12_extras.txt pyproject.toml # -aioitertools==0.12.0 - # via maggma alabaster==1.0.0 # via sphinx annotated-types==0.7.0 # via pydantic arrow==1.3.0 # via isoduration -ase==3.25.0 +ase==3.26.0 # via pymatgen-analysis-diffusion asttokens==3.0.0 # via stack-data attrs==25.3.0 # via - # jsonlines # jsonschema # referencing babel==2.17.0 # via sphinx -bcrypt==4.3.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen boltons==25.0.0 # via mpcontribs-client -boto3==1.38.37 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.38.37 +boto3==1.40.9 + # via mp-api (pyproject.toml) +botocore==1.40.9 # via # boto3 # s3transfer @@ -43,48 +36,41 @@ bravado-core==6.1.1 # via bravado cachetools==6.1.0 # via mpcontribs-client -certifi==2025.6.15 +certifi==2025.8.3 # via requests -cffi==1.17.1 - # via - # cryptography - # pynacl cfgv==3.4.0 # via pre-commit -charset-normalizer==3.4.2 +charset-normalizer==3.4.3 # via requests -contourpy==1.3.2 +contourpy==1.3.3 # via matplotlib -coverage[toml]==7.9.1 +coverage[toml]==7.10.3 # via pytest-cov -cryptography==45.0.4 - # via paramiko -custodian==2025.5.12 +custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 # via matplotlib decorator==5.2.1 # via ipython -distlib==0.3.9 +distlib==0.4.0 # via virtualenv dnspython==2.7.0 # via - # maggma # pyisemail # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.8 +emmet-core[all]==0.84.9 # via mp-api (pyproject.toml) executing==2.2.0 # via stack-data -filelock==3.18.0 +filelock==3.19.1 # via # mdanalysis # virtualenv filetype==1.2.0 # via mpcontribs-client -flake8==7.2.0 +flake8==7.3.0 # via mp-api (pyproject.toml) flatten-dict==0.4.2 # via mpcontribs-client @@ -92,13 +78,13 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.58.4 +fonttools==4.59.1 # via matplotlib fqdn==1.5.1 # via jsonschema griddataformats==1.0.2 # via mdanalysis -identify==2.6.12 +identify==2.6.13 # via pre-commit idna==3.10 # via @@ -114,7 +100,7 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.3.0 +ipython==9.4.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -136,32 +122,29 @@ joblib==1.5.1 # scikit-learn json2html==1.3.0 # via mpcontribs-client -jsonlines==4.0.0 - # via maggma jsonpointer==3.0.0 # via jsonschema jsonref==1.1.0 # via bravado-core -jsonschema[format-nongpl]==4.24.0 +jsonschema[format-nongpl]==4.25.0 # via # bravado-core - # maggma # swagger-spec-validator jsonschema-specifications==2025.4.1 # via jsonschema -kiwisolver==1.4.8 +kiwisolver==1.4.9 # via matplotlib -latexcodec==3.0.0 +lark==1.2.2 + # via rfc3987-syntax +latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -maggma==0.71.5 - # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 # via robocrys -matplotlib==3.10.3 +matplotlib==3.10.5 # via # ase # mdanalysis @@ -181,15 +164,12 @@ mdanalysis==2.9.0 # transport-analysis mmtf-python==1.1.3 # via mdanalysis -mongomock==4.3.0 - # via maggma monotonic==1.6 # via bravado monty==2025.3.3 # via # custodian # emmet-core - # maggma # matminer # mp-api (pyproject.toml) # pymatgen @@ -208,16 +188,15 @@ msgpack==1.1.1 # via # bravado # bravado-core - # maggma # mmtf-python # mp-api (pyproject.toml) -mypy==1.16.1 +mypy==1.17.1 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==1.43.0 +narwhals==2.1.1 # via plotly networkx==3.5 # via @@ -232,7 +211,6 @@ numpy==1.26.4 # contourpy # griddataformats # imageio - # maggma # matminer # matplotlib # mdanalysis @@ -257,16 +235,13 @@ numpy==1.26.4 # statsmodels # tidynamics # tifffile -orjson==3.10.18 - # via - # maggma - # pymatgen +orjson==3.11.2 + # via pymatgen packaging==25.0 # via # lazy-loader # matplotlib # mdanalysis - # mongomock # plotly # pytest # scikit-image @@ -274,17 +249,14 @@ packaging==25.0 # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.0 +pandas==2.3.1 # via - # maggma # matminer # mpcontribs-client # pymatgen # seaborn # solvation-analysis # statsmodels -paramiko==3.5.1 - # via sshtunnel parso==0.8.4 # via jedi pathspec==0.12.1 @@ -293,7 +265,7 @@ patsy==1.0.1 # via statsmodels pexpect==4.9.0 # via ipython -pillow==11.2.1 +pillow==11.3.0 # via # imageio # matplotlib @@ -305,7 +277,7 @@ platformdirs==4.3.8 # via # pint # virtualenv -plotly==6.1.2 +plotly==6.3.0 # via # mpcontribs-client # pymatgen @@ -314,7 +286,7 @@ pluggy==1.6.0 # via # pytest # pytest-cov -pre-commit==4.2.0 +pre-commit==4.3.0 # via mp-api (pyproject.toml) prompt-toolkit==3.0.51 # via ipython @@ -326,34 +298,27 @@ pubchempy==1.0.4 # via robocrys pure-eval==0.2.3 # via stack-data -pyarrow==20.0.0 +pyarrow==21.0.0 # via emmet-core -pybtex==0.24.0 +pybtex==0.25.1 # via # emmet-core # robocrys -pycodestyle==2.13.0 +pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pycparser==2.22 - # via cffi pydantic==2.11.7 # via # emmet-core - # maggma # pydantic-settings pydantic-core==2.33.2 # via pydantic -pydantic-settings==2.9.1 - # via - # emmet-core - # maggma -pydash==8.0.5 - # via maggma -pyflakes==3.3.2 +pydantic-settings==2.10.1 + # via emmet-core +pyflakes==3.4.0 # via flake8 -pygments==2.19.1 +pygments==2.19.2 # via # ipython # ipython-pygments-lexers @@ -372,31 +337,28 @@ pymatgen==2025.6.14 # pymatgen-analysis-defects # pymatgen-analysis-diffusion # robocrys -pymatgen-analysis-alloys==0.0.7 +pymatgen-analysis-alloys==0.0.8 # via emmet-core pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymongo==4.10.1 +pymongo==4.14.0 # via - # maggma # matminer # mpcontribs-client -pynacl==1.5.0 - # via paramiko pyparsing==3.2.3 # via # bibtexparser # matplotlib -pytest==8.4.0 +pytest==8.4.1 # via # mp-api (pyproject.toml) # pytest-asyncio # pytest-cov # pytest-mock # solvation-analysis -pytest-asyncio==1.0.0 +pytest-asyncio==1.1.0 # via mp-api (pyproject.toml) pytest-cov==6.2.1 # via mp-api (pyproject.toml) @@ -408,15 +370,13 @@ python-dateutil==2.9.0.post0 # botocore # bravado # bravado-core - # maggma # matplotlib # pandas -python-dotenv==1.1.0 +python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 # via # bravado-core - # mongomock # pandas pyyaml==6.0.2 # via @@ -425,9 +385,7 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -pyzmq==27.0.0 - # via maggma -rdkit==2025.3.3 +rdkit==2025.3.5 # via solvation-analysis referencing==0.36.2 # via @@ -448,30 +406,31 @@ rfc3339-validator==0.1.4 # via jsonschema rfc3986-validator==0.1.1 # via jsonschema +rfc3987-syntax==1.1.0 + # via jsonschema robocrys==0.2.11 # via emmet-core roman-numerals-py==3.1.0 # via sphinx -rpds-py==0.25.1 +rpds-py==0.27.0 # via # jsonschema # referencing ruamel-yaml==0.18.14 # via # custodian - # maggma # monty # pymatgen # robocrys ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.0 +s3transfer==0.13.1 # via boto3 scikit-image==0.25.2 # via pymatgen-analysis-defects -scikit-learn==1.7.0 +scikit-learn==1.7.1 # via matminer -scipy==1.15.3 +scipy==1.16.1 # via # ase # griddataformats @@ -488,8 +447,6 @@ seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.0.0 - # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -501,10 +458,9 @@ six==1.17.0 # bravado # bravado-core # flatten-dict - # pybtex # python-dateutil # rfc3339-validator -smart-open==7.1.0 +smart-open==7.3.0.post1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx @@ -529,11 +485,9 @@ sphinxcontrib-qthelp==2.0.0 # via sphinx sphinxcontrib-serializinghtml==2.0.0 # via sphinx -sshtunnel==0.4.0 - # via maggma stack-data==0.6.3 # via ipython -statsmodels==0.14.4 +statsmodels==0.14.5 # via solvation-analysis swagger-spec-validator==3.0.4 # via @@ -555,7 +509,6 @@ tifffile==2025.6.11 # via scikit-image tqdm==4.67.1 # via - # maggma # matminer # mdanalysis # mpcontribs-client @@ -566,15 +519,15 @@ traitlets==5.14.3 # matplotlib-inline transport-analysis==0.1.2 # via emmet-core -typeguard==4.4.3 +typeguard==4.4.4 # via inflect -types-python-dateutil==2.9.0.20250516 +types-python-dateutil==2.9.0.20250809 # via arrow -types-requests==2.32.4.20250611 +types-requests==2.32.4.20250809 # via mp-api (pyproject.toml) -types-setuptools==80.9.0.20250529 +types-setuptools==80.9.0.20250809 # via mp-api (pyproject.toml) -typing-extensions==4.14.0 +typing-extensions==4.14.1 # via # bravado # emmet-core @@ -585,7 +538,6 @@ typing-extensions==4.14.0 # pint # pydantic # pydantic-core - # pydash # referencing # spglib # swagger-spec-validator @@ -603,18 +555,18 @@ uncertainties==3.2.3 # via pymatgen uri-template==1.3.0 # via jsonschema -urllib3==2.4.0 +urllib3==2.5.0 # via # botocore # requests # types-requests -virtualenv==20.31.2 +virtualenv==20.34.0 # via pre-commit wcwidth==0.2.13 # via prompt-toolkit webcolors==24.11.1 # via jsonschema -wrapt==1.17.2 +wrapt==1.17.3 # via smart-open # The following packages are considered to be unsafe in a requirements file: From 07fcdab585de60269fd6ea0aa0aa1ff503ab6c85 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Wed, 20 Aug 2025 10:45:15 -0700 Subject: [PATCH 04/13] bump emmet core --- pyproject.toml | 4 ++-- requirements/requirements-ubuntu-latest_py3.11.txt | 2 +- requirements/requirements-ubuntu-latest_py3.12.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7960aa045..934b15c44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,13 +26,13 @@ dependencies = [ "typing-extensions>=3.7.4.1", "requests>=2.23.0", "monty>=2024.12.10", - "emmet-core>=0.84.3rc6", + "emmet-core>=0.84.10rc1", "smart_open", ] dynamic = ["version"] [project.optional-dependencies] -all = ["emmet-core[all]>=0.69.1", "custodian", "mpcontribs-client", "boto3"] +all = ["emmet-core[all]>=0.84.10rc1", "custodian", "mpcontribs-client", "boto3"] test = [ "pre-commit", "pytest", diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index 14be0b6a3..008bfd613 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -16,7 +16,7 @@ contourpy==1.3.3 # via matplotlib cycler==0.12.1 # via matplotlib -emmet-core==0.84.9 +emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) fonttools==4.59.1 # via matplotlib diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index ad62ed61e..9aa8cef4c 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -16,7 +16,7 @@ contourpy==1.3.3 # via matplotlib cycler==0.12.1 # via matplotlib -emmet-core==0.84.9 +emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) fonttools==4.59.1 # via matplotlib From d481afdf607836a30ea4115ebe2b8a0d2d74fb66 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Wed, 27 Aug 2025 13:50:15 -0700 Subject: [PATCH 05/13] Conversion electrode rester --- mp_api/client/mprester.py | 2 + mp_api/client/routes/materials/__init__.py | 2 +- mp_api/client/routes/materials/electrodes.py | 48 +++++++++++++++++--- mp_api/client/routes/materials/materials.py | 3 ++ tests/materials/core_function.py | 2 +- tests/materials/test_electrodes.py | 36 +++++++++++++-- 6 files changed, 80 insertions(+), 13 deletions(-) diff --git a/mp_api/client/mprester.py b/mp_api/client/mprester.py index 064550b98..5ed72aceb 100644 --- a/mp_api/client/mprester.py +++ b/mp_api/client/mprester.py @@ -35,6 +35,7 @@ BandStructureRester, BondsRester, ChemenvRester, + ConversionElectrodeRester, DielectricRester, DOIRester, DosRester, @@ -99,6 +100,7 @@ class MPRester: robocrys: RobocrysRester synthesis: SynthesisRester insertion_electrodes: ElectrodeRester + conversion_electrodes: ConversionElectrodeRester electronic_structure: ElectronicStructureRester electronic_structure_bandstructure: BandStructureRester electronic_structure_dos: DosRester diff --git a/mp_api/client/routes/materials/__init__.py b/mp_api/client/routes/materials/__init__.py index 382fb8f63..63fd0e3bd 100644 --- a/mp_api/client/routes/materials/__init__.py +++ b/mp_api/client/routes/materials/__init__.py @@ -6,7 +6,7 @@ from .dielectric import DielectricRester from .doi import DOIRester from .elasticity import ElasticityRester -from .electrodes import ElectrodeRester +from .electrodes import ConversionElectrodeRester, ElectrodeRester from .electronic_structure import ( BandStructureRester, DosRester, diff --git a/mp_api/client/routes/materials/electrodes.py b/mp_api/client/routes/materials/electrodes.py index e2555ac06..08432cf7b 100644 --- a/mp_api/client/routes/materials/electrodes.py +++ b/mp_api/client/routes/materials/electrodes.py @@ -1,18 +1,18 @@ from __future__ import annotations +import warnings from collections import defaultdict -from emmet.core.electrode import InsertionElectrodeDoc +from emmet.core.electrode import ConversionElectrodeDoc, InsertionElectrodeDoc from pymatgen.core.periodic_table import Element from mp_api.client.core import BaseRester from mp_api.client.core.utils import validate_ids -class ElectrodeRester(BaseRester[InsertionElectrodeDoc]): - suffix = "materials/insertion_electrodes" - document_model = InsertionElectrodeDoc # type: ignore +class BaseElectrodeRester(BaseRester): primary_key = "battery_id" + _exclude_search_fields: list[str] | None = None def search( # pragma: ignore self, @@ -39,7 +39,7 @@ def search( # pragma: ignore chunk_size: int = 1000, all_fields: bool = True, fields: list[str] | None = None, - ) -> list[InsertionElectrodeDoc] | list[dict]: + ) -> list[InsertionElectrodeDoc | ConversionElectrodeDoc] | list[dict]: """Query using a variety of search criteria. Arguments: @@ -77,11 +77,11 @@ def search( # pragma: ignore num_chunks (int): Maximum number of chunks of data to yield. None will yield all possible. chunk_size (int): Number of data entries per chunk. all_fields (bool): Whether to return all fields in the document. Defaults to True. - fields (List[str]): List of fields in InsertionElectrodeDoc to return data for. + fields (List[str]): List of fields in InsertionElectrodeDoc or ConversionElectrodeDoc to return data for. Default is battery_id and last_updated if all_fields is False. Returns: - ([InsertionElectrodeDoc], [dict]) List of insertion electrode documents or dictionaries. + ([InsertionElectrodeDoc or ConversionElectrodeDoc], [dict]) List of insertion/conversion electrode documents or dictionaries. """ query_params = defaultdict(dict) # type: dict @@ -143,6 +143,17 @@ def search( # pragma: ignore else: query_params.update({param: value}) + excluded_fields = self._exclude_search_fields or [] + ignored_fields = { + entry + for entry in excluded_fields + if query_params.pop(entry, None) is not None + } + if ignored_fields: + warnings.warn( + f"Ignoring fields {', '.join(ignored_fields)} which are not valid options for {self.__class__.__name__}" + ) + query_params = { entry: query_params[entry] for entry in query_params @@ -150,3 +161,26 @@ def search( # pragma: ignore } return super()._search(**query_params) + + +class ElectrodeRester(BaseElectrodeRester): + """Search insertion electrode documents.""" + + suffix = "materials/insertion_electrodes" + document_model = InsertionElectrodeDoc # type: ignore + + +class ConversionElectrodeRester(BaseElectrodeRester): + """Search conversion electrode documents.""" + + suffix = "materials/conversion_electrodes" + document_model = ConversionElectrodeDoc # type: ignore + # TODO: formula, chemsys, and elements do not appear to work in the API + _exclude_search_fields = [ + "material_ids", + "formula", + "chemsys", + "elements", + "stability_charge", + "stability_discharge", + ] diff --git a/mp_api/client/routes/materials/materials.py b/mp_api/client/routes/materials/materials.py index 1e8f0157a..a7bff5c46 100644 --- a/mp_api/client/routes/materials/materials.py +++ b/mp_api/client/routes/materials/materials.py @@ -13,6 +13,7 @@ BandStructureRester, BondsRester, ChemenvRester, + ConversionElectrodeRester, DielectricRester, DosRester, ElasticityRester, @@ -62,6 +63,7 @@ class MaterialsRester(BaseRester[MaterialsDoc]): "robocrys", "synthesis", "insertion_electrodes", + "conversion_electrodes", "electronic_structure", "electronic_structure_bandstructure", "electronic_structure_dos", @@ -92,6 +94,7 @@ class MaterialsRester(BaseRester[MaterialsDoc]): robocrys: RobocrysRester synthesis: SynthesisRester insertion_electrodes: ElectrodeRester + conversion_electrodes: ConversionElectrodeRester electronic_structure: ElectronicStructureRester electronic_structure_bandstructure: BandStructureRester electronic_structure_dos: DosRester diff --git a/tests/materials/core_function.py b/tests/materials/core_function.py index bb7138c62..c42b6324e 100644 --- a/tests/materials/core_function.py +++ b/tests/materials/core_function.py @@ -66,7 +66,7 @@ def client_search_testing( f"Parameter '{param}' with type '{param_type}' was not " "properly identified in the generic search method test." ) - + print(q) doc = search_method(**q)[0].model_dump() for sub_field in sub_doc_fields: diff --git a/tests/materials/test_electrodes.py b/tests/materials/test_electrodes.py index 14b28f684..dc0372ef0 100644 --- a/tests/materials/test_electrodes.py +++ b/tests/materials/test_electrodes.py @@ -4,16 +4,26 @@ import pytest from pymatgen.core.periodic_table import Element -from mp_api.client.routes.materials.electrodes import ElectrodeRester +from mp_api.client.routes.materials.electrodes import ( + ElectrodeRester, + ConversionElectrodeRester, +) @pytest.fixture -def rester(): +def insertion_rester(): rester = ElectrodeRester() yield rester rester.session.close() +@pytest.fixture +def conversion_rester(): + rester = ConversionElectrodeRester() + yield rester + rester.session.close() + + excluded_params = [ "sort_fields", "chunk_size", @@ -44,8 +54,8 @@ def rester(): @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") -def test_client(rester): - search_method = rester.search +def test_insertion_client(insertion_rester): + search_method = insertion_rester.search client_search_testing( search_method=search_method, @@ -54,3 +64,21 @@ def test_client(rester): custom_field_tests=custom_field_tests, sub_doc_fields=sub_doc_fields, ) + + +@pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") +def test_conversion_client(conversion_rester): + search_method = conversion_rester.search + + excl = ConversionElectrodeRester._exclude_search_fields + client_search_testing( + search_method=search_method, + excluded_params=excluded_params + excl, + alt_name_dict=alt_name_dict, + custom_field_tests={ + "battery_ids": ["mp-1067_Al"], + "working_ion": Element("Li"), + "exclude_elements": ["Co", "O"], + }, + sub_doc_fields=sub_doc_fields, + ) From eab7fc90244c99b43b7620141c69980c5a314290 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Thu, 4 Sep 2025 08:53:33 -0700 Subject: [PATCH 06/13] remove errant print --- .pre-commit-config.yaml | 4 ++-- tests/materials/core_function.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a3f20b1a0..d7983abcf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -default_stages: [commit] +default_stages: [pre-commit] default_install_hook_types: [pre-commit, commit-msg] ci: @@ -37,6 +37,6 @@ repos: rev: v2.2.6 hooks: - id: codespell - stages: [commit, commit-msg] + stages: [pre-commit, commit-msg] exclude_types: [json, bib, svg] args: [--ignore-words-list, "mater,fwe,te"] diff --git a/tests/materials/core_function.py b/tests/materials/core_function.py index c42b6324e..5d5226236 100644 --- a/tests/materials/core_function.py +++ b/tests/materials/core_function.py @@ -66,7 +66,6 @@ def client_search_testing( f"Parameter '{param}' with type '{param_type}' was not " "properly identified in the generic search method test." ) - print(q) doc = search_method(**q)[0].model_dump() for sub_field in sub_doc_fields: From 4cbd621afa3f8470eefd0d3dac99b2a3f4af67dc Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 09:48:19 -0700 Subject: [PATCH 07/13] sync main --- .github/workflows/testing.yml | 2 +- .github/workflows/upgrade_dependencies.yml | 2 + mp_api/client/core/client.py | 29 +++- mp_api/client/core/utils.py | 13 +- mp_api/client/routes/materials/electrodes.py | 9 -- pyproject.toml | 1 + .../requirements-ubuntu-latest_py3.11.txt | 113 +++++++++++--- ...quirements-ubuntu-latest_py3.11_extras.txt | 140 ++++++++++++------ .../requirements-ubuntu-latest_py3.12.txt | 113 +++++++++++--- ...quirements-ubuntu-latest_py3.12_extras.txt | 140 ++++++++++++------ tests/materials/test_electrodes.py | 1 - tests/materials/test_electronic_structure.py | 6 +- tests/materials/test_robocrys.py | 4 +- tests/test_client.py | 1 + tests/test_mprester.py | 7 +- 15 files changed, 415 insertions(+), 166 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c5e7328c8..788371ed0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -60,7 +60,7 @@ jobs: #MP_API_ENDPOINT: https://api-preview.materialsproject.org/ run: | pip install -e . - pytest -x --cov=mp_api --cov-report=xml + pytest -n auto -x --cov=mp_api --cov-report=xml - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/upgrade_dependencies.yml b/.github/workflows/upgrade_dependencies.yml index dfe6c45bc..565a0987f 100644 --- a/.github/workflows/upgrade_dependencies.yml +++ b/.github/workflows/upgrade_dependencies.yml @@ -68,6 +68,8 @@ jobs: git checkout -b auto-dependency-upgrades git branch -r | grep auto-dependency-upgrades- | xargs -I {} git merge {} git rebase ${GITHUB_REF##*/} + git reset $(git merge-base ${GITHUB_REF##*/} HEAD) + git commit -a -m "auto dependency upgrades" git push -f origin auto-dependency-upgrades git branch -r | grep auto-dependency-upgrades- | cut -d/ -f2 | xargs -I {} git push origin :{} - name: Open pull request if needed diff --git a/mp_api/client/core/client.py b/mp_api/client/core/client.py index 53024ca6d..3ee0b32e4 100644 --- a/mp_api/client/core/client.py +++ b/mp_api/client/core/client.py @@ -15,10 +15,17 @@ from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait from copy import copy from functools import cache +from importlib import import_module from importlib.metadata import PackageNotFoundError, version from json import JSONDecodeError from math import ceil -from typing import TYPE_CHECKING, Generic, TypeVar +from typing import ( + TYPE_CHECKING, + ForwardRef, + Generic, + TypeVar, + get_args, +) from urllib.parse import quote, urljoin import requests @@ -65,7 +72,7 @@ class BaseRester(Generic[T]): """Base client class with core stubs.""" suffix: str = "" - document_model: BaseModel = None # type: ignore + document_model: type[BaseModel] | None = None supports_versions: bool = False primary_key: str = "material_id" @@ -1070,10 +1077,24 @@ def _convert_to_model(self, data: list[dict]): def _generate_returned_model(self, doc): model_fields = self.document_model.model_fields + set_fields = doc.model_fields_set unset_fields = [field for field in model_fields if field not in set_fields] + + # Update with locals() from external module if needed + other_vars = {} + if any( + isinstance(typ, ForwardRef) + for field_meta in model_fields.values() + for typ in get_args(field_meta.annotation) + ): + other_vars = vars(import_module(self.document_model.__module__)) + include_fields = { - name: (model_fields[name].annotation, model_fields[name]) + name: ( + model_fields[name].annotation, + model_fields[name], + ) for name in set_fields } @@ -1085,6 +1106,8 @@ def _generate_returned_model(self, doc): fields_not_requested=(list[str], unset_fields), __base__=self.document_model, ) + if other_vars: + data_model.model_rebuild(_types_namespace=other_vars) def new_repr(self) -> str: extra = ",\n".join( diff --git a/mp_api/client/core/utils.py b/mp_api/client/core/utils.py index 600c47e5b..cf5f987d2 100644 --- a/mp_api/client/core/utils.py +++ b/mp_api/client/core/utils.py @@ -71,9 +71,7 @@ def api_sanitize( for model in models: model_fields_to_leave = {f[1] for f in fields_tuples if model.__name__ == f[0]} - for name in model.model_fields: - field = model.model_fields[name] - field_json_extra = field.json_schema_extra + for name, field in model.model_fields.items(): field_type = field.annotation if field_type is not None and allow_dict_msonable: @@ -88,7 +86,14 @@ def api_sanitize( new_field = FieldInfo.from_annotated_attribute( Optional[field_type], None ) - new_field.json_schema_extra = field_json_extra or {} + + for attr in ( + "json_schema_extra", + "exclude", + ): + if (val := getattr(field, attr)) is not None: + setattr(new_field, attr, val) + model.model_fields[name] = new_field model.model_rebuild(force=True) diff --git a/mp_api/client/routes/materials/electrodes.py b/mp_api/client/routes/materials/electrodes.py index 08432cf7b..83542003b 100644 --- a/mp_api/client/routes/materials/electrodes.py +++ b/mp_api/client/routes/materials/electrodes.py @@ -16,7 +16,6 @@ class BaseElectrodeRester(BaseRester): def search( # pragma: ignore self, - material_ids: str | list[str] | None = None, battery_ids: str | list[str] | None = None, average_voltage: tuple[float, float] | None = None, capacity_grav: tuple[float, float] | None = None, @@ -43,8 +42,6 @@ def search( # pragma: ignore """Query using a variety of search criteria. Arguments: - material_ids (str, List[str]): A single Material ID string or list of strings - (e.g., mp-149, [mp-149, mp-13]). battery_ids (str, List[str]): A single battery ID string or list of strings (e.g., mp-22526_Li, [mp-22526_Li, mp-22526_Ca]). average_voltage (Tuple[float,float]): Minimum and maximum value of the average voltage for a particular @@ -85,12 +82,6 @@ def search( # pragma: ignore """ query_params = defaultdict(dict) # type: dict - if material_ids: - if isinstance(material_ids, str): - material_ids = [material_ids] - - query_params.update({"material_ids": ",".join(validate_ids(material_ids))}) - if battery_ids: if isinstance(battery_ids, str): battery_ids = [battery_ids] diff --git a/pyproject.toml b/pyproject.toml index 934b15c44..f3f0bb2f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ test = [ "pytest-asyncio", "pytest-cov", "pytest-mock", + "pytest-xdist", "flake8", "pycodestyle", "mypy", diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index 008bfd613..4db2f70ee 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -8,27 +8,57 @@ annotated-types==0.7.0 # via pydantic bibtexparser==1.4.3 # via pymatgen +boto3==1.40.31 + # via maggma +botocore==1.40.31 + # via + # boto3 + # s3transfer certifi==2025.8.3 # via requests +cffi==2.0.0 + # via + # cryptography + # pynacl charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib +cryptography==45.0.7 + # via paramiko cycler==0.12.1 # via matplotlib +dnspython==2.8.0 + # via + # maggma + # pymongo emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) -fonttools==4.59.1 +fonttools==4.59.2 # via matplotlib idna==3.10 # via requests -joblib==1.5.1 +invoke==2.2.0 + # via paramiko +jmespath==1.0.1 + # via + # boto3 + # botocore +joblib==1.5.2 # via pymatgen +jsonlines==4.0.0 + # via maggma +jsonschema==4.25.1 + # via maggma +jsonschema-specifications==2025.9.1 + # via jsonschema kiwisolver==1.4.9 # via matplotlib latexcodec==3.0.1 # via pybtex -matplotlib==3.10.5 +maggma==0.72.0 + # via mp-api (pyproject.toml) +matplotlib==3.10.6 # via pymatgen monty==2025.3.3 # via @@ -38,49 +68,73 @@ monty==2025.3.3 mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via mp-api (pyproject.toml) -narwhals==2.1.1 + # via + # maggma + # mp-api (pyproject.toml) +narwhals==2.5.0 # via plotly networkx==3.5 # via pymatgen -numpy==2.3.2 +numpy==2.3.3 # via # contourpy # matplotlib # monty # pandas # pymatgen + # pymatgen-io-validation # scipy # spglib -orjson==3.11.2 - # via pymatgen +orjson==3.11.3 + # via + # maggma + # pymatgen packaging==25.0 # via # matplotlib # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.1 - # via pymatgen +pandas==2.3.2 + # via + # maggma + # pymatgen +paramiko==4.0.0 + # via sshtunnel pillow==11.3.0 # via matplotlib plotly==6.3.0 # via pymatgen pybtex==0.25.1 # via emmet-core -pydantic==2.11.7 +pycparser==2.23 + # via cffi +pydantic==2.11.9 # via # emmet-core # pydantic-settings + # pymatgen-io-validation pydantic-core==2.33.2 # via pydantic pydantic-settings==2.10.1 - # via emmet-core + # via + # emmet-core + # maggma + # pymatgen-io-validation +pydash==8.0.5 + # via maggma pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) -pyparsing==3.2.3 + # pymatgen-io-validation +pymatgen-io-validation==0.1.1 + # via emmet-core +pymongo==4.10.1 + # via maggma +pynacl==1.6.0 + # via paramiko +pyparsing==3.2.4 # via # bibtexparser # matplotlib @@ -94,21 +148,36 @@ pytz==2025.2 # via pandas pyyaml==6.0.2 # via pybtex -requests==2.32.4 +pyzmq==27.1.0 + # via maggma +referencing==0.36.2 + # via + # jsonschema + # jsonschema-specifications +requests==2.32.5 # via # mp-api (pyproject.toml) # pymatgen -ruamel-yaml==0.18.14 + # pymatgen-io-validation +rpds-py==0.27.1 + # via + # jsonschema + # referencing +ruamel-yaml==0.18.15 # via # monty # pymatgen ruamel-yaml-clib==0.2.12 # via ruamel-yaml -scipy==1.16.1 +s3transfer==0.14.0 + # via boto3 +scipy==1.16.2 # via pymatgen +sentinels==1.1.1 + # via mongomock six==1.17.0 # via python-dateutil -smart-open==7.3.0.post1 +smart-open==7.3.1 # via mp-api (pyproject.toml) spglib==2.6.0 # via pymatgen @@ -117,8 +186,10 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via pymatgen -typing-extensions==4.14.1 + # via + # maggma + # pymatgen +typing-extensions==4.15.0 # via # emmet-core # mp-api (pyproject.toml) @@ -135,7 +206,9 @@ tzdata==2025.2 uncertainties==3.2.3 # via pymatgen urllib3==2.5.0 - # via requests + # via + # botocore + # requests wrapt==1.17.3 # via smart-open diff --git a/requirements/requirements-ubuntu-latest_py3.11_extras.txt b/requirements/requirements-ubuntu-latest_py3.11_extras.txt index 197fcfcc3..2db1846bc 100644 --- a/requirements/requirements-ubuntu-latest_py3.11_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.11_extras.txt @@ -24,9 +24,11 @@ bibtexparser==1.4.3 # via pymatgen boltons==25.0.0 # via mpcontribs-client -boto3==1.40.9 - # via mp-api (pyproject.toml) -botocore==1.40.9 +boto3==1.40.31 + # via + # maggma + # mp-api (pyproject.toml) +botocore==1.40.31 # via # boto3 # s3transfer @@ -34,18 +36,24 @@ bravado==12.0.1 # via mpcontribs-client bravado-core==6.1.1 # via bravado -cachetools==6.1.0 +cachetools==6.2.0 # via mpcontribs-client certifi==2025.8.3 # via requests +cffi==2.0.0 + # via + # cryptography + # pynacl cfgv==3.4.0 # via pre-commit charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -coverage[toml]==7.10.3 +coverage[toml]==7.10.6 # via pytest-cov +cryptography==45.0.7 + # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -54,15 +62,17 @@ decorator==5.2.1 # via ipython distlib==0.4.0 # via virtualenv -dnspython==2.7.0 +dnspython==2.8.0 # via # pyisemail # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.9 +emmet-core[all]==0.84.10rc2 # via mp-api (pyproject.toml) -executing==2.2.0 +execnet==2.1.1 + # via pytest-xdist +executing==2.2.1 # via stack-data filelock==3.19.1 # via @@ -78,13 +88,13 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.59.1 +fonttools==4.59.2 # via matplotlib fqdn==1.5.1 # via jsonschema griddataformats==1.0.2 # via mdanalysis -identify==2.6.13 +identify==2.6.14 # via pre-commit idna==3.10 # via @@ -100,7 +110,9 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.4.0 +invoke==2.2.0 + # via paramiko +ipython==9.5.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -114,7 +126,7 @@ jmespath==1.0.1 # via # boto3 # botocore -joblib==1.5.1 +joblib==1.5.2 # via # mdanalysis # pymatgen @@ -126,11 +138,11 @@ jsonpointer==3.0.0 # via jsonschema jsonref==1.1.0 # via bravado-core -jsonschema[format-nongpl]==4.25.0 +jsonschema[format-nongpl]==4.25.1 # via # bravado-core # swagger-spec-validator -jsonschema-specifications==2025.4.1 +jsonschema-specifications==2025.9.1 # via jsonschema kiwisolver==1.4.9 # via matplotlib @@ -140,11 +152,13 @@ latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image +maggma==0.72.0 + # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 # via robocrys -matplotlib==3.10.5 +matplotlib==3.10.6 # via # ase # mdanalysis @@ -174,11 +188,11 @@ monty==2025.3.3 # mp-api (pyproject.toml) # pymatgen # robocrys -more-itertools==10.7.0 +more-itertools==10.8.0 # via inflect mp-pyrho==0.4.5 # via pymatgen-analysis-defects -mpcontribs-client==5.10.2 +mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy @@ -190,13 +204,13 @@ msgpack==1.1.1 # bravado-core # mmtf-python # mp-api (pyproject.toml) -mypy==1.17.1 +mypy==1.18.1 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==2.1.1 +narwhals==2.5.0 # via plotly networkx==3.5 # via @@ -222,6 +236,7 @@ numpy==1.26.4 # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion + # pymatgen-io-validation # rdkit # robocrys # scikit-image @@ -235,8 +250,10 @@ numpy==1.26.4 # statsmodels # tidynamics # tifffile -orjson==3.11.2 - # via pymatgen +orjson==3.11.3 + # via + # maggma + # pymatgen packaging==25.0 # via # lazy-loader @@ -249,7 +266,7 @@ packaging==25.0 # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.1 +pandas==2.3.2 # via # matminer # mpcontribs-client @@ -257,7 +274,9 @@ pandas==2.3.1 # seaborn # solvation-analysis # statsmodels -parso==0.8.4 +paramiko==4.0.0 + # via sshtunnel +parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy @@ -271,9 +290,9 @@ pillow==11.3.0 # matplotlib # rdkit # scikit-image -pint==0.24.4 +pint==0.25 # via mpcontribs-client -platformdirs==4.3.8 +platformdirs==4.4.0 # via # pint # virtualenv @@ -288,13 +307,13 @@ pluggy==1.6.0 # pytest-cov pre-commit==4.3.0 # via mp-api (pyproject.toml) -prompt-toolkit==3.0.51 +prompt-toolkit==3.0.52 # via ipython psutil==7.0.0 # via custodian ptyprocess==0.7.0 # via pexpect -pubchempy==1.0.4 +pubchempy==1.0.5 # via robocrys pure-eval==0.2.3 # via stack-data @@ -308,14 +327,22 @@ pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pydantic==2.11.7 +pycparser==2.23 + # via cffi +pydantic==2.11.9 # via # emmet-core # pydantic-settings + # pymatgen-io-validation pydantic-core==2.33.2 # via pydantic pydantic-settings==2.10.1 - # via emmet-core + # via + # emmet-core + # maggma + # pymatgen-io-validation +pydash==8.0.5 + # via maggma pyflakes==3.4.0 # via flake8 pygments==2.19.2 @@ -336,6 +363,7 @@ pymatgen==2025.6.14 # pymatgen-analysis-alloys # pymatgen-analysis-defects # pymatgen-analysis-diffusion + # pymatgen-io-validation # robocrys pymatgen-analysis-alloys==0.0.8 # via emmet-core @@ -343,26 +371,33 @@ pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymongo==4.14.0 +pymatgen-io-validation==0.1.1 + # via emmet-core +pymongo==4.10.1 # via # matminer # mpcontribs-client -pyparsing==3.2.3 +pynacl==1.6.0 + # via paramiko +pyparsing==3.2.4 # via # bibtexparser # matplotlib -pytest==8.4.1 +pytest==8.4.2 # via # mp-api (pyproject.toml) # pytest-asyncio # pytest-cov # pytest-mock + # pytest-xdist # solvation-analysis -pytest-asyncio==1.1.0 +pytest-asyncio==1.2.0 + # via mp-api (pyproject.toml) +pytest-cov==7.0.0 # via mp-api (pyproject.toml) -pytest-cov==6.2.1 +pytest-mock==3.15.0 # via mp-api (pyproject.toml) -pytest-mock==3.14.1 +pytest-xdist==3.8.0 # via mp-api (pyproject.toml) python-dateutil==2.9.0.post0 # via @@ -385,19 +420,22 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -rdkit==2025.3.5 +pyzmq==27.1.0 + # via maggma +rdkit==2025.3.6 # via solvation-analysis referencing==0.36.2 # via # jsonschema # jsonschema-specifications -requests==2.32.4 +requests==2.32.5 # via # bravado # bravado-core # matminer # mp-api (pyproject.toml) # pymatgen + # pymatgen-io-validation # requests-futures # sphinx requests-futures==1.0.2 @@ -412,11 +450,11 @@ robocrys==0.2.11 # via emmet-core roman-numerals-py==3.1.0 # via sphinx -rpds-py==0.27.0 +rpds-py==0.27.1 # via # jsonschema # referencing -ruamel-yaml==0.18.14 +ruamel-yaml==0.18.15 # via # custodian # monty @@ -424,13 +462,13 @@ ruamel-yaml==0.18.14 # robocrys ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.1 +s3transfer==0.14.0 # via boto3 scikit-image==0.25.2 # via pymatgen-analysis-defects -scikit-learn==1.7.1 +scikit-learn==1.7.2 # via matminer -scipy==1.16.1 +scipy==1.16.2 # via # ase # griddataformats @@ -447,6 +485,8 @@ seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client +sentinels==1.1.1 + # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -460,7 +500,7 @@ six==1.17.0 # flatten-dict # python-dateutil # rfc3339-validator -smart-open==7.3.0.post1 +smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx @@ -505,7 +545,7 @@ threadpoolctl==3.6.0 # scikit-learn tidynamics==1.1.2 # via transport-analysis -tifffile==2025.6.11 +tifffile==2025.9.9 # via scikit-image tqdm==4.67.1 # via @@ -521,13 +561,13 @@ transport-analysis==0.1.2 # via emmet-core typeguard==4.4.4 # via inflect -types-python-dateutil==2.9.0.20250809 +types-python-dateutil==2.9.0.20250822 # via arrow -types-requests==2.32.4.20250809 +types-requests==2.32.4.20250913 # via mp-api (pyproject.toml) -types-setuptools==80.9.0.20250809 +types-setuptools==80.9.0.20250822 # via mp-api (pyproject.toml) -typing-extensions==4.14.1 +typing-extensions==4.15.0 # via # bravado # emmet-core @@ -539,6 +579,8 @@ typing-extensions==4.14.1 # pint # pydantic # pydantic-core + # pydash + # pytest-asyncio # referencing # spglib # swagger-spec-validator @@ -550,7 +592,7 @@ typing-inspection==0.4.1 # pydantic-settings tzdata==2025.2 # via pandas -ujson==5.10.0 +ujson==5.11.0 # via mpcontribs-client uncertainties==3.2.3 # via pymatgen diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index 9aa8cef4c..282fa43a0 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -8,27 +8,57 @@ annotated-types==0.7.0 # via pydantic bibtexparser==1.4.3 # via pymatgen +boto3==1.40.31 + # via maggma +botocore==1.40.31 + # via + # boto3 + # s3transfer certifi==2025.8.3 # via requests +cffi==2.0.0 + # via + # cryptography + # pynacl charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib +cryptography==45.0.7 + # via paramiko cycler==0.12.1 # via matplotlib +dnspython==2.8.0 + # via + # maggma + # pymongo emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) -fonttools==4.59.1 +fonttools==4.59.2 # via matplotlib idna==3.10 # via requests -joblib==1.5.1 +invoke==2.2.0 + # via paramiko +jmespath==1.0.1 + # via + # boto3 + # botocore +joblib==1.5.2 # via pymatgen +jsonlines==4.0.0 + # via maggma +jsonschema==4.25.1 + # via maggma +jsonschema-specifications==2025.9.1 + # via jsonschema kiwisolver==1.4.9 # via matplotlib latexcodec==3.0.1 # via pybtex -matplotlib==3.10.5 +maggma==0.72.0 + # via mp-api (pyproject.toml) +matplotlib==3.10.6 # via pymatgen monty==2025.3.3 # via @@ -38,49 +68,73 @@ monty==2025.3.3 mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via mp-api (pyproject.toml) -narwhals==2.1.1 + # via + # maggma + # mp-api (pyproject.toml) +narwhals==2.5.0 # via plotly networkx==3.5 # via pymatgen -numpy==2.3.2 +numpy==2.3.3 # via # contourpy # matplotlib # monty # pandas # pymatgen + # pymatgen-io-validation # scipy # spglib -orjson==3.11.2 - # via pymatgen +orjson==3.11.3 + # via + # maggma + # pymatgen packaging==25.0 # via # matplotlib # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.1 - # via pymatgen +pandas==2.3.2 + # via + # maggma + # pymatgen +paramiko==4.0.0 + # via sshtunnel pillow==11.3.0 # via matplotlib plotly==6.3.0 # via pymatgen pybtex==0.25.1 # via emmet-core -pydantic==2.11.7 +pycparser==2.23 + # via cffi +pydantic==2.11.9 # via # emmet-core # pydantic-settings + # pymatgen-io-validation pydantic-core==2.33.2 # via pydantic pydantic-settings==2.10.1 - # via emmet-core + # via + # emmet-core + # maggma + # pymatgen-io-validation +pydash==8.0.5 + # via maggma pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) -pyparsing==3.2.3 + # pymatgen-io-validation +pymatgen-io-validation==0.1.1 + # via emmet-core +pymongo==4.10.1 + # via maggma +pynacl==1.6.0 + # via paramiko +pyparsing==3.2.4 # via # bibtexparser # matplotlib @@ -94,21 +148,36 @@ pytz==2025.2 # via pandas pyyaml==6.0.2 # via pybtex -requests==2.32.4 +pyzmq==27.1.0 + # via maggma +referencing==0.36.2 + # via + # jsonschema + # jsonschema-specifications +requests==2.32.5 # via # mp-api (pyproject.toml) # pymatgen -ruamel-yaml==0.18.14 + # pymatgen-io-validation +rpds-py==0.27.1 + # via + # jsonschema + # referencing +ruamel-yaml==0.18.15 # via # monty # pymatgen ruamel-yaml-clib==0.2.12 # via ruamel-yaml -scipy==1.16.1 +s3transfer==0.14.0 + # via boto3 +scipy==1.16.2 # via pymatgen +sentinels==1.1.1 + # via mongomock six==1.17.0 # via python-dateutil -smart-open==7.3.0.post1 +smart-open==7.3.1 # via mp-api (pyproject.toml) spglib==2.6.0 # via pymatgen @@ -117,8 +186,10 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via pymatgen -typing-extensions==4.14.1 + # via + # maggma + # pymatgen +typing-extensions==4.15.0 # via # emmet-core # mp-api (pyproject.toml) @@ -135,7 +206,9 @@ tzdata==2025.2 uncertainties==3.2.3 # via pymatgen urllib3==2.5.0 - # via requests + # via + # botocore + # requests wrapt==1.17.3 # via smart-open diff --git a/requirements/requirements-ubuntu-latest_py3.12_extras.txt b/requirements/requirements-ubuntu-latest_py3.12_extras.txt index f3e283308..250227318 100644 --- a/requirements/requirements-ubuntu-latest_py3.12_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.12_extras.txt @@ -24,9 +24,11 @@ bibtexparser==1.4.3 # via pymatgen boltons==25.0.0 # via mpcontribs-client -boto3==1.40.9 - # via mp-api (pyproject.toml) -botocore==1.40.9 +boto3==1.40.31 + # via + # maggma + # mp-api (pyproject.toml) +botocore==1.40.31 # via # boto3 # s3transfer @@ -34,18 +36,24 @@ bravado==12.0.1 # via mpcontribs-client bravado-core==6.1.1 # via bravado -cachetools==6.1.0 +cachetools==6.2.0 # via mpcontribs-client certifi==2025.8.3 # via requests +cffi==2.0.0 + # via + # cryptography + # pynacl cfgv==3.4.0 # via pre-commit charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -coverage[toml]==7.10.3 +coverage[toml]==7.10.6 # via pytest-cov +cryptography==45.0.7 + # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -54,15 +62,17 @@ decorator==5.2.1 # via ipython distlib==0.4.0 # via virtualenv -dnspython==2.7.0 +dnspython==2.8.0 # via # pyisemail # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.9 +emmet-core[all]==0.84.10rc2 # via mp-api (pyproject.toml) -executing==2.2.0 +execnet==2.1.1 + # via pytest-xdist +executing==2.2.1 # via stack-data filelock==3.19.1 # via @@ -78,13 +88,13 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.59.1 +fonttools==4.59.2 # via matplotlib fqdn==1.5.1 # via jsonschema griddataformats==1.0.2 # via mdanalysis -identify==2.6.13 +identify==2.6.14 # via pre-commit idna==3.10 # via @@ -100,7 +110,9 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.4.0 +invoke==2.2.0 + # via paramiko +ipython==9.5.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -114,7 +126,7 @@ jmespath==1.0.1 # via # boto3 # botocore -joblib==1.5.1 +joblib==1.5.2 # via # mdanalysis # pymatgen @@ -126,11 +138,11 @@ jsonpointer==3.0.0 # via jsonschema jsonref==1.1.0 # via bravado-core -jsonschema[format-nongpl]==4.25.0 +jsonschema[format-nongpl]==4.25.1 # via # bravado-core # swagger-spec-validator -jsonschema-specifications==2025.4.1 +jsonschema-specifications==2025.9.1 # via jsonschema kiwisolver==1.4.9 # via matplotlib @@ -140,11 +152,13 @@ latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image +maggma==0.72.0 + # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 # via robocrys -matplotlib==3.10.5 +matplotlib==3.10.6 # via # ase # mdanalysis @@ -174,11 +188,11 @@ monty==2025.3.3 # mp-api (pyproject.toml) # pymatgen # robocrys -more-itertools==10.7.0 +more-itertools==10.8.0 # via inflect mp-pyrho==0.4.5 # via pymatgen-analysis-defects -mpcontribs-client==5.10.2 +mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy @@ -190,13 +204,13 @@ msgpack==1.1.1 # bravado-core # mmtf-python # mp-api (pyproject.toml) -mypy==1.17.1 +mypy==1.18.1 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==2.1.1 +narwhals==2.5.0 # via plotly networkx==3.5 # via @@ -222,6 +236,7 @@ numpy==1.26.4 # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion + # pymatgen-io-validation # rdkit # robocrys # scikit-image @@ -235,8 +250,10 @@ numpy==1.26.4 # statsmodels # tidynamics # tifffile -orjson==3.11.2 - # via pymatgen +orjson==3.11.3 + # via + # maggma + # pymatgen packaging==25.0 # via # lazy-loader @@ -249,7 +266,7 @@ packaging==25.0 # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.1 +pandas==2.3.2 # via # matminer # mpcontribs-client @@ -257,7 +274,9 @@ pandas==2.3.1 # seaborn # solvation-analysis # statsmodels -parso==0.8.4 +paramiko==4.0.0 + # via sshtunnel +parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy @@ -271,9 +290,9 @@ pillow==11.3.0 # matplotlib # rdkit # scikit-image -pint==0.24.4 +pint==0.25 # via mpcontribs-client -platformdirs==4.3.8 +platformdirs==4.4.0 # via # pint # virtualenv @@ -288,13 +307,13 @@ pluggy==1.6.0 # pytest-cov pre-commit==4.3.0 # via mp-api (pyproject.toml) -prompt-toolkit==3.0.51 +prompt-toolkit==3.0.52 # via ipython psutil==7.0.0 # via custodian ptyprocess==0.7.0 # via pexpect -pubchempy==1.0.4 +pubchempy==1.0.5 # via robocrys pure-eval==0.2.3 # via stack-data @@ -308,14 +327,22 @@ pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pydantic==2.11.7 +pycparser==2.23 + # via cffi +pydantic==2.11.9 # via # emmet-core # pydantic-settings + # pymatgen-io-validation pydantic-core==2.33.2 # via pydantic pydantic-settings==2.10.1 - # via emmet-core + # via + # emmet-core + # maggma + # pymatgen-io-validation +pydash==8.0.5 + # via maggma pyflakes==3.4.0 # via flake8 pygments==2.19.2 @@ -336,6 +363,7 @@ pymatgen==2025.6.14 # pymatgen-analysis-alloys # pymatgen-analysis-defects # pymatgen-analysis-diffusion + # pymatgen-io-validation # robocrys pymatgen-analysis-alloys==0.0.8 # via emmet-core @@ -343,26 +371,33 @@ pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymongo==4.14.0 +pymatgen-io-validation==0.1.1 + # via emmet-core +pymongo==4.10.1 # via # matminer # mpcontribs-client -pyparsing==3.2.3 +pynacl==1.6.0 + # via paramiko +pyparsing==3.2.4 # via # bibtexparser # matplotlib -pytest==8.4.1 +pytest==8.4.2 # via # mp-api (pyproject.toml) # pytest-asyncio # pytest-cov # pytest-mock + # pytest-xdist # solvation-analysis -pytest-asyncio==1.1.0 +pytest-asyncio==1.2.0 + # via mp-api (pyproject.toml) +pytest-cov==7.0.0 # via mp-api (pyproject.toml) -pytest-cov==6.2.1 +pytest-mock==3.15.0 # via mp-api (pyproject.toml) -pytest-mock==3.14.1 +pytest-xdist==3.8.0 # via mp-api (pyproject.toml) python-dateutil==2.9.0.post0 # via @@ -385,19 +420,22 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -rdkit==2025.3.5 +pyzmq==27.1.0 + # via maggma +rdkit==2025.3.6 # via solvation-analysis referencing==0.36.2 # via # jsonschema # jsonschema-specifications -requests==2.32.4 +requests==2.32.5 # via # bravado # bravado-core # matminer # mp-api (pyproject.toml) # pymatgen + # pymatgen-io-validation # requests-futures # sphinx requests-futures==1.0.2 @@ -412,11 +450,11 @@ robocrys==0.2.11 # via emmet-core roman-numerals-py==3.1.0 # via sphinx -rpds-py==0.27.0 +rpds-py==0.27.1 # via # jsonschema # referencing -ruamel-yaml==0.18.14 +ruamel-yaml==0.18.15 # via # custodian # monty @@ -424,13 +462,13 @@ ruamel-yaml==0.18.14 # robocrys ruamel-yaml-clib==0.2.12 # via ruamel-yaml -s3transfer==0.13.1 +s3transfer==0.14.0 # via boto3 scikit-image==0.25.2 # via pymatgen-analysis-defects -scikit-learn==1.7.1 +scikit-learn==1.7.2 # via matminer -scipy==1.16.1 +scipy==1.16.2 # via # ase # griddataformats @@ -447,6 +485,8 @@ seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client +sentinels==1.1.1 + # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -460,7 +500,7 @@ six==1.17.0 # flatten-dict # python-dateutil # rfc3339-validator -smart-open==7.3.0.post1 +smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx @@ -505,7 +545,7 @@ threadpoolctl==3.6.0 # scikit-learn tidynamics==1.1.2 # via transport-analysis -tifffile==2025.6.11 +tifffile==2025.9.9 # via scikit-image tqdm==4.67.1 # via @@ -521,13 +561,13 @@ transport-analysis==0.1.2 # via emmet-core typeguard==4.4.4 # via inflect -types-python-dateutil==2.9.0.20250809 +types-python-dateutil==2.9.0.20250822 # via arrow -types-requests==2.32.4.20250809 +types-requests==2.32.4.20250913 # via mp-api (pyproject.toml) -types-setuptools==80.9.0.20250809 +types-setuptools==80.9.0.20250822 # via mp-api (pyproject.toml) -typing-extensions==4.14.1 +typing-extensions==4.15.0 # via # bravado # emmet-core @@ -538,6 +578,8 @@ typing-extensions==4.14.1 # pint # pydantic # pydantic-core + # pydash + # pytest-asyncio # referencing # spglib # swagger-spec-validator @@ -549,7 +591,7 @@ typing-inspection==0.4.1 # pydantic-settings tzdata==2025.2 # via pandas -ujson==5.10.0 +ujson==5.11.0 # via mpcontribs-client uncertainties==3.2.3 # via pymatgen diff --git a/tests/materials/test_electrodes.py b/tests/materials/test_electrodes.py index dc0372ef0..ff651cdca 100644 --- a/tests/materials/test_electrodes.py +++ b/tests/materials/test_electrodes.py @@ -43,7 +43,6 @@ def conversion_rester(): } # type: dict custom_field_tests = { - "material_ids": ["mp-16722"], "battery_ids": ["mp-16722_Al"], "working_ion": Element("Li"), "formula": "CoO2", diff --git a/tests/materials/test_electronic_structure.py b/tests/materials/test_electronic_structure.py index 576784258..99b2060ca 100644 --- a/tests/materials/test_electronic_structure.py +++ b/tests/materials/test_electronic_structure.py @@ -47,7 +47,7 @@ def es_rester(): @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") -@pytest.mark.skip(reason="magnetic ordering fields not build correctly") +@pytest.mark.skip(reason="magnetic ordering fields not built correctly") def test_es_client(es_rester): search_method = es_rester.search @@ -81,7 +81,7 @@ def bs_rester(): @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") -@pytest.mark.skip(reason="magnetic ordering fields not build correctly") +@pytest.mark.skip(reason="magnetic ordering fields not built correctly") def test_bs_client(bs_rester): # Get specific search method search_method = bs_rester.search @@ -127,7 +127,7 @@ def dos_rester(): @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") -@pytest.mark.skip(reason="magnetic ordering fields not build correctly") +@pytest.mark.skip(reason="magnetic ordering fields not built correctly") def test_dos_client(dos_rester): search_method = dos_rester.search diff --git a/tests/materials/test_robocrys.py b/tests/materials/test_robocrys.py index 2b04436a1..74abb4628 100644 --- a/tests/materials/test_robocrys.py +++ b/tests/materials/test_robocrys.py @@ -25,9 +25,7 @@ def test_client(rester): assert doc.condensed_structure is not None -# TODO: switch this to the skipif once emmet PR 1261 is deployed to production -# @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") -@pytest.mark.skip(reason="Query with large result set fails with faceted pipeline") +@pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.") def test_client_large_result_set(rester): search_method = rester.search diff --git a/tests/test_client.py b/tests/test_client.py index 4001b0234..25bf18124 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -36,6 +36,7 @@ # "tasks", # "bonds", "materials_xas", + "materials_tasks", "materials_elasticity", "materials_fermi", "materials_alloys", diff --git a/tests/test_mprester.py b/tests/test_mprester.py index 7c4127d11..8eb55ef02 100644 --- a/tests/test_mprester.py +++ b/tests/test_mprester.py @@ -27,8 +27,7 @@ from pymatgen.entries.computed_entries import ComputedEntry, GibbsComputedStructureEntry from pymatgen.io.cif import CifParser from pymatgen.io.vasp import Chgcar -from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine -from pymatgen.phonon.dos import PhononDos +from emmet.core.phonon import PhononDOS, PhononBS from mp_api.client import MPRester from mp_api.client.core.client import MPRestError @@ -291,10 +290,10 @@ def test_get_ion_entries(self, mpr): def test_get_phonon_data_by_material_id(self, mpr): bs = mpr.get_phonon_bandstructure_by_material_id("mp-2172") - assert isinstance(bs, PhononBandStructureSymmLine) + assert isinstance(bs, PhononBS) dos = mpr.get_phonon_dos_by_material_id("mp-2172") - assert isinstance(dos, PhononDos) + assert isinstance(dos, PhononDOS) def test_get_charge_density_from_material_id(self, mpr): chgcar = mpr.get_charge_density_from_material_id("mp-149") From b017f873631486522a847cd2fc9c666aae7d243c Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 10:38:43 -0700 Subject: [PATCH 08/13] standardize json loading --- mp_api/client/core/client.py | 44 +++++++------------ mp_api/client/core/utils.py | 11 ++++- mp_api/client/mprester.py | 10 ++--- .../routes/materials/electronic_structure.py | 6 --- mp_api/client/routes/materials/phonon.py | 8 ---- mp_api/client/routes/materials/thermo.py | 5 +-- tests/materials/test_electrodes.py | 4 +- 7 files changed, 33 insertions(+), 55 deletions(-) diff --git a/mp_api/client/core/client.py b/mp_api/client/core/client.py index 3ee0b32e4..34873b089 100644 --- a/mp_api/client/core/client.py +++ b/mp_api/client/core/client.py @@ -7,7 +7,6 @@ import inspect import itertools -import json import os import platform import sys @@ -29,9 +28,7 @@ from urllib.parse import quote, urljoin import requests -from bson import json_util from emmet.core.utils import jsanitize -from monty.json import MontyDecoder from pydantic import BaseModel, create_model from requests.adapters import HTTPAdapter from requests.exceptions import RequestException @@ -40,7 +37,7 @@ from urllib3.util.retry import Retry from mp_api.client.core.settings import MAPIClientSettings -from mp_api.client.core.utils import api_sanitize, validate_ids +from mp_api.client.core.utils import api_sanitize, load_json, validate_ids try: import boto3 @@ -270,11 +267,7 @@ def _post_resource( response = self.session.post(url, json=payload, verify=True, params=params) if response.status_code == 200: - if self.monty_decode: - data = json.loads(response.text, cls=MontyDecoder) - else: - data = json.loads(response.text) - + data = load_json(response.text, deser=self.monty_decode) if self.document_model and use_document_model: if isinstance(data["data"], dict): data["data"] = self.document_model.model_validate(data["data"]) # type: ignore @@ -287,7 +280,7 @@ def _post_resource( else: try: - data = json.loads(response.text)["detail"] + data = load_json(response.text)["detail"] except (JSONDecodeError, KeyError): data = f"Response {response.text}" if isinstance(data, str): @@ -342,11 +335,7 @@ def _patch_resource( response = self.session.patch(url, json=payload, verify=True, params=params) if response.status_code == 200: - if self.monty_decode: - data = json.loads(response.text, cls=MontyDecoder) - else: - data = json.loads(response.text) - + data = load_json(response.text, deser=self.monty_decode) if self.document_model and use_document_model: if isinstance(data["data"], dict): data["data"] = self.document_model.model_validate(data["data"]) # type: ignore @@ -359,7 +348,7 @@ def _patch_resource( else: try: - data = json.loads(response.text)["detail"] + data = load_json(response.text)["detail"] except (JSONDecodeError, KeyError): data = f"Response {response.text}" if isinstance(data, str): @@ -384,18 +373,24 @@ def _query_open_data( self, bucket: str, key: str, - decoder: Callable, + decoder: Callable | None = None, ) -> tuple[list[dict] | list[bytes], int]: """Query and deserialize Materials Project AWS open data s3 buckets. Args: bucket (str): Materials project bucket name key (str): Key for file including all prefixes - decoder(Callable): Callable used to deserialize data + decoder(Callable or None): Callable used to deserialize data. + Defaults to mp_api.core.utils.load_json Returns: dict: MontyDecoded data """ + if not decoder: + + def decoder(x): + return load_json(x, deser=self.monty_decode) + file = open( f"s3://{bucket}/{key}", encoding="utf-8", @@ -527,16 +522,11 @@ def _query_resource( "Ignoring `fields` argument: All fields are always included when no query is provided." ) - decoder = ( - MontyDecoder().decode if self.monty_decode else json_util.loads - ) - # Multithreaded function inputs s3_params_list = { key: { "bucket": bucket, "key": key, - "decoder": decoder, } for key in keys } @@ -1013,11 +1003,7 @@ def _submit_request_and_process( ) if response.status_code == 200: - if self.monty_decode: - data = json.loads(response.text, cls=MontyDecoder) - else: - data = json.loads(response.text) - + data = load_json(response.text, deser=self.monty_decode) # other sub-urls may use different document models # the client does not handle this in a particularly smart way currently if self.document_model and use_document_model: @@ -1029,7 +1015,7 @@ def _submit_request_and_process( else: try: - data = json.loads(response.text)["detail"] + data = load_json(response.text)["detail"] except (JSONDecodeError, KeyError): data = f"Response {response.text}" if isinstance(data, str): diff --git a/mp_api/client/core/utils.py b/mp_api/client/core/utils.py index cf5f987d2..67b6f5a81 100644 --- a/mp_api/client/core/utils.py +++ b/mp_api/client/core/utils.py @@ -4,8 +4,9 @@ from functools import cache from typing import Optional, get_args +import orjson from emmet.core.utils import get_flat_models_from_model -from monty.json import MSONable +from monty.json import MontyDecoder, MSONable from pydantic import BaseModel from pydantic._internal._utils import lenient_issubclass from pydantic.fields import FieldInfo @@ -13,6 +14,14 @@ from mp_api.client.core.settings import MAPIClientSettings +def load_json(json_like: str | bytes, deser: bool = False, encoding: str = "utf-8"): + """Utility to load json in consistent manner.""" + data = orjson.loads( + json_like if isinstance(json_like, bytes) else json_like.encode(encoding) + ) + return MontyDecoder().process_decoded(data) if deser else data + + def validate_ids(id_list: list[str]): """Function to validate material and task IDs. diff --git a/mp_api/client/mprester.py b/mp_api/client/mprester.py index 5ed72aceb..742818b5c 100644 --- a/mp_api/client/mprester.py +++ b/mp_api/client/mprester.py @@ -1,11 +1,9 @@ from __future__ import annotations import itertools -import json import os import warnings from functools import cache, lru_cache -from json import loads from typing import TYPE_CHECKING from emmet.core.electronic_structure import BSPathType @@ -14,7 +12,6 @@ from emmet.core.tasks import TaskDoc from emmet.core.thermo import ThermoType from emmet.core.vasp.calc_types import CalcType -from monty.json import MontyDecoder from packaging import version from pymatgen.analysis.phase_diagram import PhaseDiagram from pymatgen.analysis.pourbaix_diagram import IonEntry @@ -27,7 +24,7 @@ from mp_api.client.core import BaseRester, MPRestError from mp_api.client.core.settings import MAPIClientSettings -from mp_api.client.core.utils import validate_ids +from mp_api.client.core.utils import load_json, validate_ids from mp_api.client.routes import GeneralStoreRester, MessagesRester, UserSettingsRester from mp_api.client.routes.materials import ( AbsorptionRester, @@ -1340,11 +1337,10 @@ def get_charge_density_from_task_id( Returns: (Chgcar, (Chgcar, TaskDoc | dict), None): Pymatgen Chgcar object, or tuple with object and TaskDoc """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads kwargs = dict( bucket="materialsproject-parsed", key=f"chgcars/{str(task_id)}.json.gz", - decoder=decoder, + decoder=lambda x: load_json(x, deser=self.monty_decode), ) chgcar = self.materials.tasks._query_open_data(**kwargs)[0] if not chgcar: @@ -1478,7 +1474,7 @@ def _check_nomad_exist(url) -> bool: response = get(url=url) if response.status_code != 200: return False - content = loads(response.text) + content = load_json(response.text) if content["pagination"]["total"] == 0: return False return True diff --git a/mp_api/client/routes/materials/electronic_structure.py b/mp_api/client/routes/materials/electronic_structure.py index d7284712e..2fd487d07 100644 --- a/mp_api/client/routes/materials/electronic_structure.py +++ b/mp_api/client/routes/materials/electronic_structure.py @@ -1,6 +1,5 @@ from __future__ import annotations -import json import warnings from collections import defaultdict @@ -9,7 +8,6 @@ DOSProjectionType, ElectronicStructureDoc, ) -from monty.json import MontyDecoder from pymatgen.analysis.magnetism.analyzer import Ordering from pymatgen.core.periodic_table import Element from pymatgen.electronic_structure.core import OrbitalType, Spin @@ -234,11 +232,9 @@ def get_bandstructure_from_task_id(self, task_id: str): Returns: bandstructure (BandStructure): BandStructure or BandStructureSymmLine object """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads result = self._query_open_data( bucket="materialsproject-parsed", key=f"bandstructures/{task_id}.json.gz", - decoder=decoder, )[0] if result: @@ -430,11 +426,9 @@ def get_dos_from_task_id(self, task_id: str): Returns: bandstructure (CompleteDos): CompleteDos object """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads result = self._query_open_data( bucket="materialsproject-parsed", key=f"dos/{task_id}.json.gz", - decoder=decoder, )[0] if result: diff --git a/mp_api/client/routes/materials/phonon.py b/mp_api/client/routes/materials/phonon.py index 4ce52950e..605591048 100644 --- a/mp_api/client/routes/materials/phonon.py +++ b/mp_api/client/routes/materials/phonon.py @@ -1,11 +1,9 @@ from __future__ import annotations -import json from collections import defaultdict import numpy as np from emmet.core.phonon import PhononBS, PhononBSDOSDoc, PhononDOS -from monty.json import MontyDecoder from mp_api.client.core import BaseRester, MPRestError from mp_api.client.core.utils import validate_ids @@ -75,11 +73,9 @@ def get_bandstructure_from_material_id(self, material_id: str, phonon_method: st Returns: bandstructure (PhononBS): PhononBS object """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads result = self._query_open_data( bucket="materialsproject-parsed", key=f"ph-bandstructures/{phonon_method}/{material_id}.json.gz", - decoder=decoder, )[0] if not result or not result[0]: @@ -100,11 +96,9 @@ def get_dos_from_material_id(self, material_id: str, phonon_method: str): Returns: dos (PhononDOS): PhononDOS object """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads result = self._query_open_data( bucket="materialsproject-parsed", key=f"ph-dos/{phonon_method}/{material_id}.json.gz", - decoder=decoder, )[0] if not result or not result[0]: @@ -124,11 +118,9 @@ def get_forceconstants_from_material_id(self, material_id: str): Returns: force constants (list[list[Matrix3D]]): PhononDOS object """ - decoder = MontyDecoder().decode if self.monty_decode else json.loads result = self._query_open_data( bucket="materialsproject-parsed", key=f"ph-force-constants/{material_id}.json.gz", - decoder=decoder, )[0] if not result or not result[0]: diff --git a/mp_api/client/routes/materials/thermo.py b/mp_api/client/routes/materials/thermo.py index 4473900de..ae19a4900 100644 --- a/mp_api/client/routes/materials/thermo.py +++ b/mp_api/client/routes/materials/thermo.py @@ -4,12 +4,11 @@ import numpy as np from emmet.core.thermo import ThermoDoc, ThermoType -from monty.json import MontyDecoder from pymatgen.analysis.phase_diagram import PhaseDiagram from pymatgen.core import Element from mp_api.client.core import BaseRester -from mp_api.client.core.utils import validate_ids +from mp_api.client.core.utils import load_json, validate_ids class ThermoRester(BaseRester[ThermoDoc]): @@ -170,7 +169,7 @@ def get_phase_diagram_from_chemsys( pd = self._query_open_data( bucket="materialsproject-build", key=obj_key, - decoder=MontyDecoder().decode, + decoder=lambda x: load_json(x, deser=True), )[0][0].get("phase_diagram") # Ensure el_ref keys are Element objects for PDPlotter. diff --git a/tests/materials/test_electrodes.py b/tests/materials/test_electrodes.py index ff651cdca..d54cebe2a 100644 --- a/tests/materials/test_electrodes.py +++ b/tests/materials/test_electrodes.py @@ -19,7 +19,9 @@ def insertion_rester(): @pytest.fixture def conversion_rester(): - rester = ConversionElectrodeRester() + rester = ConversionElectrodeRester( + monty_decode=False # TODO: to fix in emmet-core 0.85.0 + ) yield rester rester.session.close() From a04cc7fc38128747481007fcbdce627192266478 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 10:43:00 -0700 Subject: [PATCH 09/13] remove material_ids from exclude fields --- mp_api/client/routes/materials/electrodes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mp_api/client/routes/materials/electrodes.py b/mp_api/client/routes/materials/electrodes.py index 83542003b..99ee01657 100644 --- a/mp_api/client/routes/materials/electrodes.py +++ b/mp_api/client/routes/materials/electrodes.py @@ -168,7 +168,6 @@ class ConversionElectrodeRester(BaseElectrodeRester): document_model = ConversionElectrodeDoc # type: ignore # TODO: formula, chemsys, and elements do not appear to work in the API _exclude_search_fields = [ - "material_ids", "formula", "chemsys", "elements", From 6d9622d74e40fc25da9857e5ffee862200127e3e Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 10:48:04 -0700 Subject: [PATCH 10/13] bump dep --- .../requirements-ubuntu-latest_py3.11.txt | 90 ++----------- ...quirements-ubuntu-latest_py3.11_extras.txt | 124 ++++-------------- .../requirements-ubuntu-latest_py3.12.txt | 89 ++----------- ...quirements-ubuntu-latest_py3.12_extras.txt | 123 ++++------------- 4 files changed, 72 insertions(+), 354 deletions(-) diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index 4db2f70ee..6d07eb1a9 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -2,62 +2,34 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --output-file=requirements/requirements-ubuntu-latest_py3.11.txt pyproject.toml +# pip-compile --cert=None --client-cert=None --index-url=None --output-file=requirements/requirements-ubuntu-latest_py3.11.txt --pip-args=None pyproject.toml # annotated-types==0.7.0 # via pydantic bibtexparser==1.4.3 # via pymatgen -boto3==1.40.31 - # via maggma -botocore==1.40.31 - # via - # boto3 - # s3transfer +blake3==1.0.6 + # via emmet-core certifi==2025.8.3 # via requests -cffi==2.0.0 - # via - # cryptography - # pynacl charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -cryptography==45.0.7 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.8.0 - # via - # maggma - # pymongo -emmet-core==0.84.10rc2 +emmet-core==0.85.0rc0 # via mp-api (pyproject.toml) -fonttools==4.59.2 +fonttools==4.60.0 # via matplotlib idna==3.10 # via requests -invoke==2.2.0 - # via paramiko -jmespath==1.0.1 - # via - # boto3 - # botocore joblib==1.5.2 # via pymatgen -jsonlines==4.0.0 - # via maggma -jsonschema==4.25.1 - # via maggma -jsonschema-specifications==2025.9.1 - # via jsonschema kiwisolver==1.4.9 # via matplotlib latexcodec==3.0.1 # via pybtex -maggma==0.72.0 - # via mp-api (pyproject.toml) matplotlib==3.10.6 # via pymatgen monty==2025.3.3 @@ -68,9 +40,7 @@ monty==2025.3.3 mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via - # maggma - # mp-api (pyproject.toml) + # via mp-api (pyproject.toml) narwhals==2.5.0 # via plotly networkx==3.5 @@ -86,9 +56,7 @@ numpy==2.3.3 # scipy # spglib orjson==3.11.3 - # via - # maggma - # pymatgen + # via pymatgen packaging==25.0 # via # matplotlib @@ -96,19 +64,13 @@ packaging==25.0 palettable==3.3.3 # via pymatgen pandas==2.3.2 - # via - # maggma - # pymatgen -paramiko==4.0.0 - # via sshtunnel + # via pymatgen pillow==11.3.0 # via matplotlib plotly==6.3.0 # via pymatgen pybtex==0.25.1 # via emmet-core -pycparser==2.23 - # via cffi pydantic==2.11.9 # via # emmet-core @@ -119,22 +81,15 @@ pydantic-core==2.33.2 pydantic-settings==2.10.1 # via # emmet-core - # maggma # pymatgen-io-validation -pydash==8.0.5 - # via maggma pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) # pymatgen-io-validation -pymatgen-io-validation==0.1.1 +pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 - # via maggma -pynacl==1.6.0 - # via paramiko -pyparsing==3.2.4 +pyparsing==3.2.5 # via # bibtexparser # matplotlib @@ -148,33 +103,19 @@ pytz==2025.2 # via pandas pyyaml==6.0.2 # via pybtex -pyzmq==27.1.0 - # via maggma -referencing==0.36.2 - # via - # jsonschema - # jsonschema-specifications requests==2.32.5 # via # mp-api (pyproject.toml) # pymatgen # pymatgen-io-validation -rpds-py==0.27.1 - # via - # jsonschema - # referencing ruamel-yaml==0.18.15 # via # monty # pymatgen -ruamel-yaml-clib==0.2.12 +ruamel-yaml-clib==0.2.13 # via ruamel-yaml -s3transfer==0.14.0 - # via boto3 scipy==1.16.2 # via pymatgen -sentinels==1.1.1 - # via mongomock six==1.17.0 # via python-dateutil smart-open==7.3.1 @@ -186,11 +127,10 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via - # maggma - # pymatgen + # via pymatgen typing-extensions==4.15.0 # via + # blake3 # emmet-core # mp-api (pyproject.toml) # pydantic @@ -206,9 +146,7 @@ tzdata==2025.2 uncertainties==3.2.3 # via pymatgen urllib3==2.5.0 - # via - # botocore - # requests + # via requests wrapt==1.17.3 # via smart-open diff --git a/requirements/requirements-ubuntu-latest_py3.11_extras.txt b/requirements/requirements-ubuntu-latest_py3.11_extras.txt index 2db1846bc..4c81c5c48 100644 --- a/requirements/requirements-ubuntu-latest_py3.11_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.11_extras.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --all-extras --output-file=requirements/requirements-ubuntu-latest_py3.11_extras.txt pyproject.toml +# pip-compile --all-extras --cert=None --client-cert=None --index-url=None --output-file=requirements/requirements-ubuntu-latest_py3.11_extras.txt --pip-args=None pyproject.toml # alabaster==1.0.0 # via sphinx @@ -22,13 +22,13 @@ babel==2.17.0 # via sphinx bibtexparser==1.4.3 # via pymatgen +blake3==1.0.6 + # via emmet-core boltons==25.0.0 # via mpcontribs-client -boto3==1.40.31 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.40.31 +boto3==1.40.35 + # via mp-api (pyproject.toml) +botocore==1.40.35 # via # boto3 # s3transfer @@ -40,20 +40,14 @@ cachetools==6.2.0 # via mpcontribs-client certifi==2025.8.3 # via requests -cffi==2.0.0 - # via - # cryptography - # pynacl cfgv==3.4.0 # via pre-commit charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -coverage[toml]==7.10.6 +coverage[toml]==7.10.7 # via pytest-cov -cryptography==45.0.7 - # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -68,16 +62,14 @@ dnspython==2.8.0 # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.10rc2 +emmet-core[all]==0.85.0rc0 # via mp-api (pyproject.toml) execnet==2.1.1 # via pytest-xdist executing==2.2.1 # via stack-data filelock==3.19.1 - # via - # mdanalysis - # virtualenv + # via virtualenv filetype==1.2.0 # via mpcontribs-client flake8==7.3.0 @@ -88,12 +80,10 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.59.2 +fonttools==4.60.0 # via matplotlib fqdn==1.5.1 # via jsonschema -griddataformats==1.0.2 - # via mdanalysis identify==2.6.14 # via pre-commit idna==3.10 @@ -110,8 +100,6 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -invoke==2.2.0 - # via paramiko ipython==9.5.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 @@ -128,7 +116,6 @@ jmespath==1.0.1 # botocore joblib==1.5.2 # via - # mdanalysis # pymatgen # pymatgen-analysis-diffusion # scikit-learn @@ -146,14 +133,12 @@ jsonschema-specifications==2025.9.1 # via jsonschema kiwisolver==1.4.9 # via matplotlib -lark==1.2.2 +lark==1.3.0 # via rfc3987-syntax latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -maggma==0.72.0 - # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 @@ -161,23 +146,12 @@ matminer==0.9.3 matplotlib==3.10.6 # via # ase - # mdanalysis # pymatgen # seaborn - # solvation-analysis matplotlib-inline==0.1.7 # via ipython mccabe==0.7.0 # via flake8 -mda-xdrlib==0.2.0 - # via mdanalysis -mdanalysis==2.9.0 - # via - # emmet-core - # solvation-analysis - # transport-analysis -mmtf-python==1.1.3 - # via mdanalysis monotonic==1.6 # via bravado monty==2025.3.3 @@ -196,15 +170,12 @@ mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy -mrcfile==1.5.4 - # via griddataformats msgpack==1.1.1 # via # bravado # bravado-core - # mmtf-python # mp-api (pyproject.toml) -mypy==1.18.1 +mypy==1.18.2 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via @@ -223,21 +194,16 @@ numpy==1.26.4 # via # ase # contourpy - # griddataformats # imageio # matminer # matplotlib - # mdanalysis # monty # mpcontribs-client - # mrcfile # pandas - # patsy # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion # pymatgen-io-validation - # rdkit # robocrys # scikit-image # scikit-learn @@ -245,25 +211,18 @@ numpy==1.26.4 # seaborn # seekpath # shapely - # solvation-analysis # spglib - # statsmodels - # tidynamics # tifffile orjson==3.11.3 - # via - # maggma - # pymatgen + # via pymatgen packaging==25.0 # via # lazy-loader # matplotlib - # mdanalysis # plotly # pytest # scikit-image # sphinx - # statsmodels palettable==3.3.3 # via pymatgen pandas==2.3.2 @@ -272,23 +231,16 @@ pandas==2.3.2 # mpcontribs-client # pymatgen # seaborn - # solvation-analysis - # statsmodels -paramiko==4.0.0 - # via sshtunnel parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy -patsy==1.0.1 - # via statsmodels pexpect==4.9.0 # via ipython pillow==11.3.0 # via # imageio # matplotlib - # rdkit # scikit-image pint==0.25 # via mpcontribs-client @@ -300,7 +252,6 @@ plotly==6.3.0 # via # mpcontribs-client # pymatgen - # solvation-analysis pluggy==1.6.0 # via # pytest @@ -309,7 +260,7 @@ pre-commit==4.3.0 # via mp-api (pyproject.toml) prompt-toolkit==3.0.52 # via ipython -psutil==7.0.0 +psutil==7.1.0 # via custodian ptyprocess==0.7.0 # via pexpect @@ -327,8 +278,6 @@ pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pycparser==2.23 - # via cffi pydantic==2.11.9 # via # emmet-core @@ -339,10 +288,7 @@ pydantic-core==2.33.2 pydantic-settings==2.10.1 # via # emmet-core - # maggma # pymatgen-io-validation -pydash==8.0.5 - # via maggma pyflakes==3.4.0 # via flake8 pygments==2.19.2 @@ -371,15 +317,13 @@ pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymatgen-io-validation==0.1.1 +pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 +pymongo==4.15.1 # via # matminer # mpcontribs-client -pynacl==1.6.0 - # via paramiko -pyparsing==3.2.4 +pyparsing==3.2.5 # via # bibtexparser # matplotlib @@ -390,12 +334,11 @@ pytest==8.4.2 # pytest-cov # pytest-mock # pytest-xdist - # solvation-analysis pytest-asyncio==1.2.0 # via mp-api (pyproject.toml) pytest-cov==7.0.0 # via mp-api (pyproject.toml) -pytest-mock==3.15.0 +pytest-mock==3.15.1 # via mp-api (pyproject.toml) pytest-xdist==3.8.0 # via mp-api (pyproject.toml) @@ -420,10 +363,6 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -pyzmq==27.1.0 - # via maggma -rdkit==2025.3.6 - # via solvation-analysis referencing==0.36.2 # via # jsonschema @@ -460,7 +399,7 @@ ruamel-yaml==0.18.15 # monty # pymatgen # robocrys -ruamel-yaml-clib==0.2.12 +ruamel-yaml-clib==0.2.13 # via ruamel-yaml s3transfer==0.14.0 # via boto3 @@ -471,22 +410,16 @@ scikit-learn==1.7.2 scipy==1.16.2 # via # ase - # griddataformats - # mdanalysis # pymatgen # robocrys # scikit-image # scikit-learn - # solvation-analysis - # statsmodels seaborn==0.13.2 # via pymatgen-analysis-diffusion seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.1.1 - # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -504,8 +437,6 @@ smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx -solvation-analysis==0.4.1 - # via emmet-core spglib==2.6.0 # via # pymatgen @@ -527,8 +458,6 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx stack-data==0.6.3 # via ipython -statsmodels==0.14.5 - # via solvation-analysis swagger-spec-validator==3.0.4 # via # bravado-core @@ -540,25 +469,18 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen threadpoolctl==3.6.0 - # via - # mdanalysis - # scikit-learn -tidynamics==1.1.2 - # via transport-analysis -tifffile==2025.9.9 + # via scikit-learn +tifffile==2025.9.20 # via scikit-image tqdm==4.67.1 # via # matminer - # mdanalysis # mpcontribs-client # pymatgen traitlets==5.14.3 # via # ipython # matplotlib-inline -transport-analysis==0.1.2 - # via emmet-core typeguard==4.4.4 # via inflect types-python-dateutil==2.9.0.20250822 @@ -569,6 +491,7 @@ types-setuptools==80.9.0.20250822 # via mp-api (pyproject.toml) typing-extensions==4.15.0 # via + # blake3 # bravado # emmet-core # flexcache @@ -579,7 +502,6 @@ typing-extensions==4.15.0 # pint # pydantic # pydantic-core - # pydash # pytest-asyncio # referencing # spglib @@ -605,7 +527,7 @@ urllib3==2.5.0 # types-requests virtualenv==20.34.0 # via pre-commit -wcwidth==0.2.13 +wcwidth==0.2.14 # via prompt-toolkit webcolors==24.11.1 # via jsonschema diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index 282fa43a0..0834d6482 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -2,62 +2,34 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --output-file=requirements/requirements-ubuntu-latest_py3.12.txt pyproject.toml +# pip-compile --cert=None --client-cert=None --index-url=None --output-file=requirements/requirements-ubuntu-latest_py3.12.txt --pip-args=None pyproject.toml # annotated-types==0.7.0 # via pydantic bibtexparser==1.4.3 # via pymatgen -boto3==1.40.31 - # via maggma -botocore==1.40.31 - # via - # boto3 - # s3transfer +blake3==1.0.6 + # via emmet-core certifi==2025.8.3 # via requests -cffi==2.0.0 - # via - # cryptography - # pynacl charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -cryptography==45.0.7 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.8.0 - # via - # maggma - # pymongo -emmet-core==0.84.10rc2 +emmet-core==0.85.0rc0 # via mp-api (pyproject.toml) -fonttools==4.59.2 +fonttools==4.60.0 # via matplotlib idna==3.10 # via requests -invoke==2.2.0 - # via paramiko -jmespath==1.0.1 - # via - # boto3 - # botocore joblib==1.5.2 # via pymatgen -jsonlines==4.0.0 - # via maggma -jsonschema==4.25.1 - # via maggma -jsonschema-specifications==2025.9.1 - # via jsonschema kiwisolver==1.4.9 # via matplotlib latexcodec==3.0.1 # via pybtex -maggma==0.72.0 - # via mp-api (pyproject.toml) matplotlib==3.10.6 # via pymatgen monty==2025.3.3 @@ -68,9 +40,7 @@ monty==2025.3.3 mpmath==1.3.0 # via sympy msgpack==1.1.1 - # via - # maggma - # mp-api (pyproject.toml) + # via mp-api (pyproject.toml) narwhals==2.5.0 # via plotly networkx==3.5 @@ -86,9 +56,7 @@ numpy==2.3.3 # scipy # spglib orjson==3.11.3 - # via - # maggma - # pymatgen + # via pymatgen packaging==25.0 # via # matplotlib @@ -96,19 +64,13 @@ packaging==25.0 palettable==3.3.3 # via pymatgen pandas==2.3.2 - # via - # maggma - # pymatgen -paramiko==4.0.0 - # via sshtunnel + # via pymatgen pillow==11.3.0 # via matplotlib plotly==6.3.0 # via pymatgen pybtex==0.25.1 # via emmet-core -pycparser==2.23 - # via cffi pydantic==2.11.9 # via # emmet-core @@ -119,22 +81,15 @@ pydantic-core==2.33.2 pydantic-settings==2.10.1 # via # emmet-core - # maggma # pymatgen-io-validation -pydash==8.0.5 - # via maggma pymatgen==2025.6.14 # via # emmet-core # mp-api (pyproject.toml) # pymatgen-io-validation -pymatgen-io-validation==0.1.1 +pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 - # via maggma -pynacl==1.6.0 - # via paramiko -pyparsing==3.2.4 +pyparsing==3.2.5 # via # bibtexparser # matplotlib @@ -148,33 +103,19 @@ pytz==2025.2 # via pandas pyyaml==6.0.2 # via pybtex -pyzmq==27.1.0 - # via maggma -referencing==0.36.2 - # via - # jsonschema - # jsonschema-specifications requests==2.32.5 # via # mp-api (pyproject.toml) # pymatgen # pymatgen-io-validation -rpds-py==0.27.1 - # via - # jsonschema - # referencing ruamel-yaml==0.18.15 # via # monty # pymatgen -ruamel-yaml-clib==0.2.12 +ruamel-yaml-clib==0.2.13 # via ruamel-yaml -s3transfer==0.14.0 - # via boto3 scipy==1.16.2 # via pymatgen -sentinels==1.1.1 - # via mongomock six==1.17.0 # via python-dateutil smart-open==7.3.1 @@ -186,9 +127,7 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen tqdm==4.67.1 - # via - # maggma - # pymatgen + # via pymatgen typing-extensions==4.15.0 # via # emmet-core @@ -206,9 +145,7 @@ tzdata==2025.2 uncertainties==3.2.3 # via pymatgen urllib3==2.5.0 - # via - # botocore - # requests + # via requests wrapt==1.17.3 # via smart-open diff --git a/requirements/requirements-ubuntu-latest_py3.12_extras.txt b/requirements/requirements-ubuntu-latest_py3.12_extras.txt index 250227318..54df16a1b 100644 --- a/requirements/requirements-ubuntu-latest_py3.12_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.12_extras.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --all-extras --output-file=requirements/requirements-ubuntu-latest_py3.12_extras.txt pyproject.toml +# pip-compile --all-extras --cert=None --client-cert=None --index-url=None --output-file=requirements/requirements-ubuntu-latest_py3.12_extras.txt --pip-args=None pyproject.toml # alabaster==1.0.0 # via sphinx @@ -22,13 +22,13 @@ babel==2.17.0 # via sphinx bibtexparser==1.4.3 # via pymatgen +blake3==1.0.6 + # via emmet-core boltons==25.0.0 # via mpcontribs-client -boto3==1.40.31 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.40.31 +boto3==1.40.35 + # via mp-api (pyproject.toml) +botocore==1.40.35 # via # boto3 # s3transfer @@ -40,20 +40,14 @@ cachetools==6.2.0 # via mpcontribs-client certifi==2025.8.3 # via requests -cffi==2.0.0 - # via - # cryptography - # pynacl cfgv==3.4.0 # via pre-commit charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -coverage[toml]==7.10.6 +coverage[toml]==7.10.7 # via pytest-cov -cryptography==45.0.7 - # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -68,16 +62,14 @@ dnspython==2.8.0 # pymongo docutils==0.21.2 # via sphinx -emmet-core[all]==0.84.10rc2 +emmet-core[all]==0.85.0rc0 # via mp-api (pyproject.toml) execnet==2.1.1 # via pytest-xdist executing==2.2.1 # via stack-data filelock==3.19.1 - # via - # mdanalysis - # virtualenv + # via virtualenv filetype==1.2.0 # via mpcontribs-client flake8==7.3.0 @@ -88,12 +80,10 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.59.2 +fonttools==4.60.0 # via matplotlib fqdn==1.5.1 # via jsonschema -griddataformats==1.0.2 - # via mdanalysis identify==2.6.14 # via pre-commit idna==3.10 @@ -110,8 +100,6 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -invoke==2.2.0 - # via paramiko ipython==9.5.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 @@ -128,7 +116,6 @@ jmespath==1.0.1 # botocore joblib==1.5.2 # via - # mdanalysis # pymatgen # pymatgen-analysis-diffusion # scikit-learn @@ -146,14 +133,12 @@ jsonschema-specifications==2025.9.1 # via jsonschema kiwisolver==1.4.9 # via matplotlib -lark==1.2.2 +lark==1.3.0 # via rfc3987-syntax latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -maggma==0.72.0 - # via mp-api (pyproject.toml) markupsafe==3.0.2 # via jinja2 matminer==0.9.3 @@ -161,23 +146,12 @@ matminer==0.9.3 matplotlib==3.10.6 # via # ase - # mdanalysis # pymatgen # seaborn - # solvation-analysis matplotlib-inline==0.1.7 # via ipython mccabe==0.7.0 # via flake8 -mda-xdrlib==0.2.0 - # via mdanalysis -mdanalysis==2.9.0 - # via - # emmet-core - # solvation-analysis - # transport-analysis -mmtf-python==1.1.3 - # via mdanalysis monotonic==1.6 # via bravado monty==2025.3.3 @@ -196,15 +170,12 @@ mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy -mrcfile==1.5.4 - # via griddataformats msgpack==1.1.1 # via # bravado # bravado-core - # mmtf-python # mp-api (pyproject.toml) -mypy==1.18.1 +mypy==1.18.2 # via mp-api (pyproject.toml) mypy-extensions==1.1.0 # via @@ -223,21 +194,16 @@ numpy==1.26.4 # via # ase # contourpy - # griddataformats # imageio # matminer # matplotlib - # mdanalysis # monty # mpcontribs-client - # mrcfile # pandas - # patsy # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion # pymatgen-io-validation - # rdkit # robocrys # scikit-image # scikit-learn @@ -245,25 +211,18 @@ numpy==1.26.4 # seaborn # seekpath # shapely - # solvation-analysis # spglib - # statsmodels - # tidynamics # tifffile orjson==3.11.3 - # via - # maggma - # pymatgen + # via pymatgen packaging==25.0 # via # lazy-loader # matplotlib - # mdanalysis # plotly # pytest # scikit-image # sphinx - # statsmodels palettable==3.3.3 # via pymatgen pandas==2.3.2 @@ -272,23 +231,16 @@ pandas==2.3.2 # mpcontribs-client # pymatgen # seaborn - # solvation-analysis - # statsmodels -paramiko==4.0.0 - # via sshtunnel parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy -patsy==1.0.1 - # via statsmodels pexpect==4.9.0 # via ipython pillow==11.3.0 # via # imageio # matplotlib - # rdkit # scikit-image pint==0.25 # via mpcontribs-client @@ -300,7 +252,6 @@ plotly==6.3.0 # via # mpcontribs-client # pymatgen - # solvation-analysis pluggy==1.6.0 # via # pytest @@ -309,7 +260,7 @@ pre-commit==4.3.0 # via mp-api (pyproject.toml) prompt-toolkit==3.0.52 # via ipython -psutil==7.0.0 +psutil==7.1.0 # via custodian ptyprocess==0.7.0 # via pexpect @@ -327,8 +278,6 @@ pycodestyle==2.14.0 # via # flake8 # mp-api (pyproject.toml) -pycparser==2.23 - # via cffi pydantic==2.11.9 # via # emmet-core @@ -339,10 +288,7 @@ pydantic-core==2.33.2 pydantic-settings==2.10.1 # via # emmet-core - # maggma # pymatgen-io-validation -pydash==8.0.5 - # via maggma pyflakes==3.4.0 # via flake8 pygments==2.19.2 @@ -371,15 +317,13 @@ pymatgen-analysis-defects==2025.1.18 # via emmet-core pymatgen-analysis-diffusion==2024.7.15 # via emmet-core -pymatgen-io-validation==0.1.1 +pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 +pymongo==4.15.1 # via # matminer # mpcontribs-client -pynacl==1.6.0 - # via paramiko -pyparsing==3.2.4 +pyparsing==3.2.5 # via # bibtexparser # matplotlib @@ -390,12 +334,11 @@ pytest==8.4.2 # pytest-cov # pytest-mock # pytest-xdist - # solvation-analysis pytest-asyncio==1.2.0 # via mp-api (pyproject.toml) pytest-cov==7.0.0 # via mp-api (pyproject.toml) -pytest-mock==3.15.0 +pytest-mock==3.15.1 # via mp-api (pyproject.toml) pytest-xdist==3.8.0 # via mp-api (pyproject.toml) @@ -420,10 +363,6 @@ pyyaml==6.0.2 # pre-commit # pybtex # swagger-spec-validator -pyzmq==27.1.0 - # via maggma -rdkit==2025.3.6 - # via solvation-analysis referencing==0.36.2 # via # jsonschema @@ -460,7 +399,7 @@ ruamel-yaml==0.18.15 # monty # pymatgen # robocrys -ruamel-yaml-clib==0.2.12 +ruamel-yaml-clib==0.2.13 # via ruamel-yaml s3transfer==0.14.0 # via boto3 @@ -471,22 +410,16 @@ scikit-learn==1.7.2 scipy==1.16.2 # via # ase - # griddataformats - # mdanalysis # pymatgen # robocrys # scikit-image # scikit-learn - # solvation-analysis - # statsmodels seaborn==0.13.2 # via pymatgen-analysis-diffusion seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.1.1 - # via mongomock shapely==2.1.1 # via pymatgen-analysis-alloys simplejson==3.20.1 @@ -504,8 +437,6 @@ smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx -solvation-analysis==0.4.1 - # via emmet-core spglib==2.6.0 # via # pymatgen @@ -527,8 +458,6 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx stack-data==0.6.3 # via ipython -statsmodels==0.14.5 - # via solvation-analysis swagger-spec-validator==3.0.4 # via # bravado-core @@ -540,25 +469,18 @@ sympy==1.14.0 tabulate==0.9.0 # via pymatgen threadpoolctl==3.6.0 - # via - # mdanalysis - # scikit-learn -tidynamics==1.1.2 - # via transport-analysis -tifffile==2025.9.9 + # via scikit-learn +tifffile==2025.9.20 # via scikit-image tqdm==4.67.1 # via # matminer - # mdanalysis # mpcontribs-client # pymatgen traitlets==5.14.3 # via # ipython # matplotlib-inline -transport-analysis==0.1.2 - # via emmet-core typeguard==4.4.4 # via inflect types-python-dateutil==2.9.0.20250822 @@ -578,7 +500,6 @@ typing-extensions==4.15.0 # pint # pydantic # pydantic-core - # pydash # pytest-asyncio # referencing # spglib @@ -604,7 +525,7 @@ urllib3==2.5.0 # types-requests virtualenv==20.34.0 # via pre-commit -wcwidth==0.2.13 +wcwidth==0.2.14 # via prompt-toolkit webcolors==24.11.1 # via jsonschema From f6dc8df27c1498d8faa9a06db76a9696bb8d2621 Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 15:23:13 -0700 Subject: [PATCH 11/13] bump down emmet core prior to 85 --- requirements/requirements-ubuntu-latest_py3.11.txt | 2 +- requirements/requirements-ubuntu-latest_py3.12.txt | 2 +- tests/materials/test_electrodes.py | 2 +- tests/materials/test_tasks.py | 4 ++-- tests/test_client.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index 6d07eb1a9..4fc033259 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -18,7 +18,7 @@ contourpy==1.3.3 # via matplotlib cycler==0.12.1 # via matplotlib -emmet-core==0.85.0rc0 +emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) fonttools==4.60.0 # via matplotlib diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index 0834d6482..61b6f316e 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -18,7 +18,7 @@ contourpy==1.3.3 # via matplotlib cycler==0.12.1 # via matplotlib -emmet-core==0.85.0rc0 +emmet-core==0.84.10rc2 # via mp-api (pyproject.toml) fonttools==4.60.0 # via matplotlib diff --git a/tests/materials/test_electrodes.py b/tests/materials/test_electrodes.py index d54cebe2a..2a7ec7ef5 100644 --- a/tests/materials/test_electrodes.py +++ b/tests/materials/test_electrodes.py @@ -20,7 +20,7 @@ def insertion_rester(): @pytest.fixture def conversion_rester(): rester = ConversionElectrodeRester( - monty_decode=False # TODO: to fix in emmet-core 0.85.0 + monty_decode=False # TODO: to fix in data + emmet-core 0.85.0 ) yield rester rester.session.close() diff --git a/tests/materials/test_tasks.py b/tests/materials/test_tasks.py index 2cb27031c..b35dfd938 100644 --- a/tests/materials/test_tasks.py +++ b/tests/materials/test_tasks.py @@ -1,8 +1,8 @@ import os from core_function import client_search_testing -from datetime import datetime import pytest +from emmet.core.utils import utcnow from mp_api.client.routes.materials.tasks import TaskRester @@ -34,7 +34,7 @@ def rester(): custom_field_tests = { "chemsys": "Si-O", - "last_updated": (None, datetime.utcnow()), + "last_updated": (None, utcnow()), "task_ids": ["mp-149"], } # type: dict diff --git a/tests/test_client.py b/tests/test_client.py index 25bf18124..49a775048 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -25,6 +25,7 @@ "materials_substrates", "materials_synthesis", "materials_similarity", + "materials_tasks", ] special_resters = ["materials_charge_density", "doi"] @@ -36,7 +37,6 @@ # "tasks", # "bonds", "materials_xas", - "materials_tasks", "materials_elasticity", "materials_fermi", "materials_alloys", From 85e672fccc0b332ee9fd91c32435f1f11d914a8d Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Mon, 22 Sep 2025 17:10:06 -0700 Subject: [PATCH 12/13] monty decode in test --- tests/materials/test_electrodes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/materials/test_electrodes.py b/tests/materials/test_electrodes.py index 2a7ec7ef5..ff651cdca 100644 --- a/tests/materials/test_electrodes.py +++ b/tests/materials/test_electrodes.py @@ -19,9 +19,7 @@ def insertion_rester(): @pytest.fixture def conversion_rester(): - rester = ConversionElectrodeRester( - monty_decode=False # TODO: to fix in data + emmet-core 0.85.0 - ) + rester = ConversionElectrodeRester() yield rester rester.session.close() From ca4972652d25e788973b520200c2070ad607c497 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 1 Oct 2025 23:18:59 +0000 Subject: [PATCH 13/13] auto dependency upgrades --- .../requirements-ubuntu-latest_py3.11.txt | 39 ++------- ...quirements-ubuntu-latest_py3.11_extras.txt | 86 +++++++++++++------ .../requirements-ubuntu-latest_py3.12.txt | 38 ++------ ...quirements-ubuntu-latest_py3.12_extras.txt | 85 ++++++++++++------ 4 files changed, 132 insertions(+), 116 deletions(-) diff --git a/requirements/requirements-ubuntu-latest_py3.11.txt b/requirements/requirements-ubuntu-latest_py3.11.txt index a00e9e970..754502940 100644 --- a/requirements/requirements-ubuntu-latest_py3.11.txt +++ b/requirements/requirements-ubuntu-latest_py3.11.txt @@ -6,38 +6,19 @@ # annotated-types==0.7.0 # via pydantic -attrs==25.3.0 - # via - # jsonlines - # jsonschema - # referencing -bcrypt==5.0.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -boto3==1.40.40 - # via maggma -botocore==1.40.40 - # via - # boto3 - # s3transfer certifi==2025.8.3 # via requests charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -cryptography==46.0.1 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.8.0 - # via - # maggma - # pymongo emmet-core==0.84.10 # via mp-api (pyproject.toml) -fonttools==4.60.0 +fonttools==4.60.1 # via matplotlib idna==3.10 # via requests @@ -58,7 +39,7 @@ mpmath==1.3.0 # via sympy msgpack==1.1.1 # via mp-api (pyproject.toml) -narwhals==2.5.0 +narwhals==2.6.0 # via plotly networkx==3.5 # via pymatgen @@ -80,7 +61,7 @@ packaging==25.0 # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.2 +pandas==2.3.3 # via pymatgen pillow==11.3.0 # via matplotlib @@ -106,10 +87,6 @@ pymatgen==2025.6.14 # pymatgen-io-validation pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 - # via maggma -pynacl==1.6.0 - # via paramiko pyparsing==3.2.5 # via # bibtexparser @@ -121,9 +98,7 @@ python-dateutil==2.9.0.post0 python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 - # via - # mongomock - # pandas + # via pandas pyyaml==6.0.3 # via pybtex requests==2.32.5 @@ -153,14 +128,13 @@ tqdm==4.67.1 # via pymatgen typing-extensions==4.15.0 # via - # blake3 # emmet-core # mp-api (pyproject.toml) # pydantic # pydantic-core # spglib # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via # pydantic # pydantic-settings @@ -172,6 +146,3 @@ urllib3==2.5.0 # via requests wrapt==1.17.3 # via smart-open - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/requirements-ubuntu-latest_py3.11_extras.txt b/requirements/requirements-ubuntu-latest_py3.11_extras.txt index 86e7e2ac0..7e348baef 100644 --- a/requirements/requirements-ubuntu-latest_py3.11_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.11_extras.txt @@ -20,19 +20,13 @@ attrs==25.3.0 # referencing babel==2.17.0 # via sphinx -bcrypt==5.0.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -blake3==1.0.6 - # via emmet-core boltons==25.0.0 # via mpcontribs-client -boto3==1.40.40 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.40.40 +boto3==1.40.43 + # via mp-api (pyproject.toml) +botocore==1.40.43 # via # boto3 # s3transfer @@ -52,8 +46,6 @@ contourpy==1.3.3 # via matplotlib coverage[toml]==7.10.7 # via pytest-cov -cryptography==46.0.1 - # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -75,7 +67,9 @@ execnet==2.1.1 executing==2.2.1 # via stack-data filelock==3.19.1 - # via virtualenv + # via + # mdanalysis + # virtualenv filetype==1.2.0 # via mpcontribs-client flake8==7.3.0 @@ -86,10 +80,12 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.60.0 +fonttools==4.60.1 # via matplotlib fqdn==1.5.1 # via jsonschema +griddataformats==1.0.2 + # via mdanalysis identify==2.6.14 # via pre-commit idna==3.10 @@ -106,7 +102,7 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.5.0 +ipython==9.6.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -122,6 +118,7 @@ jmespath==1.0.1 # botocore joblib==1.5.2 # via + # mdanalysis # pymatgen # pymatgen-analysis-diffusion # scikit-learn @@ -145,19 +142,30 @@ latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -markupsafe==3.0.2 +markupsafe==3.0.3 # via jinja2 matminer==0.9.3 # via robocrys matplotlib==3.10.6 # via # ase + # mdanalysis # pymatgen # seaborn + # solvation-analysis matplotlib-inline==0.1.7 # via ipython mccabe==0.7.0 # via flake8 +mda-xdrlib==0.2.0 + # via mdanalysis +mdanalysis==2.9.0 + # via + # emmet-core + # solvation-analysis + # transport-analysis +mmtf-python==1.1.3 + # via mdanalysis monotonic==1.6 # via bravado monty==2025.3.3 @@ -176,10 +184,13 @@ mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy +mrcfile==1.5.4 + # via griddataformats msgpack==1.1.1 # via # bravado # bravado-core + # mmtf-python # mp-api (pyproject.toml) mypy==1.18.2 # via mp-api (pyproject.toml) @@ -187,7 +198,7 @@ mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==2.5.0 +narwhals==2.6.0 # via plotly networkx==3.5 # via @@ -200,16 +211,21 @@ numpy==1.26.4 # via # ase # contourpy + # griddataformats # imageio # matminer # matplotlib + # mdanalysis # monty # mpcontribs-client + # mrcfile # pandas + # patsy # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion # pymatgen-io-validation + # rdkit # robocrys # scikit-image # scikit-learn @@ -217,7 +233,10 @@ numpy==1.26.4 # seaborn # seekpath # shapely + # solvation-analysis # spglib + # statsmodels + # tidynamics # tifffile orjson==3.11.3 # via pymatgen @@ -225,28 +244,35 @@ packaging==25.0 # via # lazy-loader # matplotlib + # mdanalysis # plotly # pytest # scikit-image # sphinx + # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.2 +pandas==2.3.3 # via # matminer # mpcontribs-client # pymatgen # seaborn + # solvation-analysis + # statsmodels parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy +patsy==1.0.1 + # via statsmodels pexpect==4.9.0 # via ipython pillow==11.3.0 # via # imageio # matplotlib + # rdkit # scikit-image pint==0.25 # via mpcontribs-client @@ -258,6 +284,7 @@ plotly==6.3.0 # via # mpcontribs-client # pymatgen + # solvation-analysis pluggy==1.6.0 # via # pytest @@ -325,12 +352,10 @@ pymatgen-analysis-diffusion==2024.7.15 # via emmet-core pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.15.1 +pymongo==4.15.2 # via # matminer # mpcontribs-client -pynacl==1.6.0 - # via paramiko pyparsing==3.2.5 # via # bibtexparser @@ -342,6 +367,7 @@ pytest==8.4.2 # pytest-cov # pytest-mock # pytest-xdist + # solvation-analysis pytest-asyncio==1.2.0 # via mp-api (pyproject.toml) pytest-cov==7.0.0 @@ -371,6 +397,8 @@ pyyaml==6.0.3 # pre-commit # pybtex # swagger-spec-validator +rdkit==2025.3.6 + # via solvation-analysis referencing==0.36.2 # via # jsonschema @@ -418,18 +446,20 @@ scikit-learn==1.7.2 scipy==1.16.2 # via # ase + # griddataformats + # mdanalysis # pymatgen # robocrys # scikit-image # scikit-learn + # solvation-analysis + # statsmodels seaborn==0.13.2 # via pymatgen-analysis-diffusion seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.1.1 - # via mongomock shapely==2.1.2 # via pymatgen-analysis-alloys simplejson==3.20.2 @@ -447,6 +477,8 @@ smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx +solvation-analysis==0.4.1 + # via emmet-core spglib==2.6.0 # via # pymatgen @@ -468,6 +500,8 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx stack-data==0.6.3 # via ipython +statsmodels==0.14.5 + # via solvation-analysis swagger-spec-validator==3.0.4 # via # bravado-core @@ -484,17 +518,20 @@ threadpoolctl==3.6.0 # scikit-learn tidynamics==1.1.2 # via transport-analysis -tifffile==2025.9.20 +tifffile==2025.9.30 # via scikit-image tqdm==4.67.1 # via # matminer + # mdanalysis # mpcontribs-client # pymatgen traitlets==5.14.3 # via # ipython # matplotlib-inline +transport-analysis==0.1.2 + # via emmet-core typeguard==4.4.4 # via inflect types-python-dateutil==2.9.0.20250822 @@ -505,7 +542,6 @@ types-setuptools==80.9.0.20250822 # via mp-api (pyproject.toml) typing-extensions==4.15.0 # via - # blake3 # bravado # emmet-core # flexcache @@ -522,7 +558,7 @@ typing-extensions==4.15.0 # swagger-spec-validator # typeguard # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via # pydantic # pydantic-settings diff --git a/requirements/requirements-ubuntu-latest_py3.12.txt b/requirements/requirements-ubuntu-latest_py3.12.txt index 401da11cd..226fda301 100644 --- a/requirements/requirements-ubuntu-latest_py3.12.txt +++ b/requirements/requirements-ubuntu-latest_py3.12.txt @@ -6,38 +6,19 @@ # annotated-types==0.7.0 # via pydantic -attrs==25.3.0 - # via - # jsonlines - # jsonschema - # referencing -bcrypt==5.0.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -boto3==1.40.40 - # via maggma -botocore==1.40.40 - # via - # boto3 - # s3transfer certifi==2025.8.3 # via requests charset-normalizer==3.4.3 # via requests contourpy==1.3.3 # via matplotlib -cryptography==46.0.1 - # via paramiko cycler==0.12.1 # via matplotlib -dnspython==2.8.0 - # via - # maggma - # pymongo emmet-core==0.84.10 # via mp-api (pyproject.toml) -fonttools==4.60.0 +fonttools==4.60.1 # via matplotlib idna==3.10 # via requests @@ -58,7 +39,7 @@ mpmath==1.3.0 # via sympy msgpack==1.1.1 # via mp-api (pyproject.toml) -narwhals==2.5.0 +narwhals==2.6.0 # via plotly networkx==3.5 # via pymatgen @@ -80,7 +61,7 @@ packaging==25.0 # plotly palettable==3.3.3 # via pymatgen -pandas==2.3.2 +pandas==2.3.3 # via pymatgen pillow==11.3.0 # via matplotlib @@ -106,10 +87,6 @@ pymatgen==2025.6.14 # pymatgen-io-validation pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.10.1 - # via maggma -pynacl==1.6.0 - # via paramiko pyparsing==3.2.5 # via # bibtexparser @@ -121,9 +98,7 @@ python-dateutil==2.9.0.post0 python-dotenv==1.1.1 # via pydantic-settings pytz==2025.2 - # via - # mongomock - # pandas + # via pandas pyyaml==6.0.3 # via pybtex requests==2.32.5 @@ -159,7 +134,7 @@ typing-extensions==4.15.0 # pydantic-core # spglib # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via # pydantic # pydantic-settings @@ -171,6 +146,3 @@ urllib3==2.5.0 # via requests wrapt==1.17.3 # via smart-open - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/requirements-ubuntu-latest_py3.12_extras.txt b/requirements/requirements-ubuntu-latest_py3.12_extras.txt index 648b3e546..805c128e6 100644 --- a/requirements/requirements-ubuntu-latest_py3.12_extras.txt +++ b/requirements/requirements-ubuntu-latest_py3.12_extras.txt @@ -20,19 +20,13 @@ attrs==25.3.0 # referencing babel==2.17.0 # via sphinx -bcrypt==5.0.0 - # via paramiko bibtexparser==1.4.3 # via pymatgen -blake3==1.0.6 - # via emmet-core boltons==25.0.0 # via mpcontribs-client -boto3==1.40.40 - # via - # maggma - # mp-api (pyproject.toml) -botocore==1.40.40 +boto3==1.40.43 + # via mp-api (pyproject.toml) +botocore==1.40.43 # via # boto3 # s3transfer @@ -52,8 +46,6 @@ contourpy==1.3.3 # via matplotlib coverage[toml]==7.10.7 # via pytest-cov -cryptography==46.0.1 - # via paramiko custodian==2025.8.13 # via mp-api (pyproject.toml) cycler==0.12.1 @@ -75,7 +67,9 @@ execnet==2.1.1 executing==2.2.1 # via stack-data filelock==3.19.1 - # via virtualenv + # via + # mdanalysis + # virtualenv filetype==1.2.0 # via mpcontribs-client flake8==7.3.0 @@ -86,10 +80,12 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.60.0 +fonttools==4.60.1 # via matplotlib fqdn==1.5.1 # via jsonschema +griddataformats==1.0.2 + # via mdanalysis identify==2.6.14 # via pre-commit idna==3.10 @@ -106,7 +102,7 @@ inflect==7.5.0 # via robocrys iniconfig==2.1.0 # via pytest -ipython==9.5.0 +ipython==9.6.0 # via mpcontribs-client ipython-pygments-lexers==1.1.1 # via ipython @@ -122,6 +118,7 @@ jmespath==1.0.1 # botocore joblib==1.5.2 # via + # mdanalysis # pymatgen # pymatgen-analysis-diffusion # scikit-learn @@ -145,19 +142,30 @@ latexcodec==3.0.1 # via pybtex lazy-loader==0.4 # via scikit-image -markupsafe==3.0.2 +markupsafe==3.0.3 # via jinja2 matminer==0.9.3 # via robocrys matplotlib==3.10.6 # via # ase + # mdanalysis # pymatgen # seaborn + # solvation-analysis matplotlib-inline==0.1.7 # via ipython mccabe==0.7.0 # via flake8 +mda-xdrlib==0.2.0 + # via mdanalysis +mdanalysis==2.9.0 + # via + # emmet-core + # solvation-analysis + # transport-analysis +mmtf-python==1.1.3 + # via mdanalysis monotonic==1.6 # via bravado monty==2025.3.3 @@ -176,10 +184,13 @@ mpcontribs-client==5.10.4 # via mp-api (pyproject.toml) mpmath==1.3.0 # via sympy +mrcfile==1.5.4 + # via griddataformats msgpack==1.1.1 # via # bravado # bravado-core + # mmtf-python # mp-api (pyproject.toml) mypy==1.18.2 # via mp-api (pyproject.toml) @@ -187,7 +198,7 @@ mypy-extensions==1.1.0 # via # mp-api (pyproject.toml) # mypy -narwhals==2.5.0 +narwhals==2.6.0 # via plotly networkx==3.5 # via @@ -200,16 +211,21 @@ numpy==1.26.4 # via # ase # contourpy + # griddataformats # imageio # matminer # matplotlib + # mdanalysis # monty # mpcontribs-client + # mrcfile # pandas + # patsy # pymatgen # pymatgen-analysis-defects # pymatgen-analysis-diffusion # pymatgen-io-validation + # rdkit # robocrys # scikit-image # scikit-learn @@ -217,7 +233,10 @@ numpy==1.26.4 # seaborn # seekpath # shapely + # solvation-analysis # spglib + # statsmodels + # tidynamics # tifffile orjson==3.11.3 # via pymatgen @@ -225,28 +244,35 @@ packaging==25.0 # via # lazy-loader # matplotlib + # mdanalysis # plotly # pytest # scikit-image # sphinx + # statsmodels palettable==3.3.3 # via pymatgen -pandas==2.3.2 +pandas==2.3.3 # via # matminer # mpcontribs-client # pymatgen # seaborn + # solvation-analysis + # statsmodels parso==0.8.5 # via jedi pathspec==0.12.1 # via mypy +patsy==1.0.1 + # via statsmodels pexpect==4.9.0 # via ipython pillow==11.3.0 # via # imageio # matplotlib + # rdkit # scikit-image pint==0.25 # via mpcontribs-client @@ -258,6 +284,7 @@ plotly==6.3.0 # via # mpcontribs-client # pymatgen + # solvation-analysis pluggy==1.6.0 # via # pytest @@ -325,12 +352,10 @@ pymatgen-analysis-diffusion==2024.7.15 # via emmet-core pymatgen-io-validation==0.1.2 # via emmet-core -pymongo==4.15.1 +pymongo==4.15.2 # via # matminer # mpcontribs-client -pynacl==1.6.0 - # via paramiko pyparsing==3.2.5 # via # bibtexparser @@ -342,6 +367,7 @@ pytest==8.4.2 # pytest-cov # pytest-mock # pytest-xdist + # solvation-analysis pytest-asyncio==1.2.0 # via mp-api (pyproject.toml) pytest-cov==7.0.0 @@ -371,6 +397,8 @@ pyyaml==6.0.3 # pre-commit # pybtex # swagger-spec-validator +rdkit==2025.3.6 + # via solvation-analysis referencing==0.36.2 # via # jsonschema @@ -418,18 +446,20 @@ scikit-learn==1.7.2 scipy==1.16.2 # via # ase + # griddataformats + # mdanalysis # pymatgen # robocrys # scikit-image # scikit-learn + # solvation-analysis + # statsmodels seaborn==0.13.2 # via pymatgen-analysis-diffusion seekpath==2.1.0 # via emmet-core semantic-version==2.10.0 # via mpcontribs-client -sentinels==1.1.1 - # via mongomock shapely==2.1.2 # via pymatgen-analysis-alloys simplejson==3.20.2 @@ -447,6 +477,8 @@ smart-open==7.3.1 # via mp-api (pyproject.toml) snowballstemmer==3.0.1 # via sphinx +solvation-analysis==0.4.1 + # via emmet-core spglib==2.6.0 # via # pymatgen @@ -468,6 +500,8 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx stack-data==0.6.3 # via ipython +statsmodels==0.14.5 + # via solvation-analysis swagger-spec-validator==3.0.4 # via # bravado-core @@ -484,17 +518,20 @@ threadpoolctl==3.6.0 # scikit-learn tidynamics==1.1.2 # via transport-analysis -tifffile==2025.9.20 +tifffile==2025.9.30 # via scikit-image tqdm==4.67.1 # via # matminer + # mdanalysis # mpcontribs-client # pymatgen traitlets==5.14.3 # via # ipython # matplotlib-inline +transport-analysis==0.1.2 + # via emmet-core typeguard==4.4.4 # via inflect types-python-dateutil==2.9.0.20250822 @@ -520,7 +557,7 @@ typing-extensions==4.15.0 # swagger-spec-validator # typeguard # typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via # pydantic # pydantic-settings