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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ all = [
"emmet-core[all]>=0.86.4rc1,<0.86.5",
"fastmcp",
"flask",
"matminer>=0.10.0",
"mpcontribs-client>=5.10",
]
test = [
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-ubuntu-latest_py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ bibtexparser==1.4.4
# via pymatgen-core
blake3==1.0.8
# via emmet-core
boto3==1.42.89
boto3==1.42.90
# via mp-api (pyproject.toml)
botocore==1.42.89
botocore==1.42.90
# via
# boto3
# s3transfer
Expand Down
35 changes: 6 additions & 29 deletions requirements/requirements-ubuntu-latest_py3.11_extras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ blinker==1.9.0
# via flask
boltons==25.0.0
# via mpcontribs-client
boto3==1.42.89
boto3==1.42.90
# via mp-api (pyproject.toml)
botocore==1.42.89
botocore==1.42.90
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -213,7 +213,6 @@ joblib==1.5.3
# via
# pymatgen-analysis-diffusion
# pymatgen-core
# scikit-learn
json2html==1.3.0
# via mpcontribs-client
jsonpointer==3.1.1
Expand Down Expand Up @@ -252,8 +251,6 @@ markupsafe==3.0.3
# flask
# jinja2
# werkzeug
matminer==0.10.1
# via mp-api (pyproject.toml)
matplotlib==3.10.8
# via
# ase
Expand All @@ -273,7 +270,6 @@ monty==2026.2.18
# via
# custodian
# emmet-core
# matminer
# mp-api (pyproject.toml)
# pymatgen-core
more-itertools==11.0.2
Expand Down Expand Up @@ -310,7 +306,6 @@ numpy==2.4.4
# ase
# contourpy
# imageio
# matminer
# matplotlib
# monty
# mpcontribs-client
Expand All @@ -320,7 +315,6 @@ numpy==2.4.4
# pymatgen-core
# pymatgen-io-validation
# scikit-image
# scikit-learn
# scipy
# seaborn
# seekpath
Expand All @@ -346,9 +340,8 @@ packaging==26.1
# sphinx
palettable==3.3.3
# via pymatgen-core
pandas==2.3.3
pandas==3.0.2
# via
# matminer
# mpcontribs-client
# pymatgen-core
# seaborn
Expand Down Expand Up @@ -438,7 +431,6 @@ pyjwt[crypto]==2.12.1
pymatgen==2026.3.23
# via
# emmet-core
# matminer
# mp-api (pyproject.toml)
# mp-pyrho
# mpcontribs-client
Expand All @@ -459,7 +451,6 @@ pymatgen-io-validation==0.1.2
pymongo==4.16.0
# via
# emmet-core
# matminer
# mpcontribs-client
pyparsing==3.3.2
# via
Expand Down Expand Up @@ -499,9 +490,7 @@ python-dotenv==1.2.2
python-multipart==0.0.26
# via mcp
pytz==2026.1.post1
# via
# bravado-core
# pandas
# via bravado-core
pyyaml==6.0.3
# via
# bravado
Expand All @@ -520,7 +509,6 @@ requests==2.33.1
# via
# bravado
# bravado-core
# matminer
# mp-api (pyproject.toml)
# pymatgen-core
# pymatgen-io-validation
Expand Down Expand Up @@ -555,15 +543,11 @@ s3transfer==0.16.0
# via boto3
scikit-image==0.26.0
# via pymatgen-analysis-defects
scikit-learn==1.8.0
# via matminer
scipy==1.17.1
# via
# ase
# matminer
# pymatgen-core
# scikit-image
# scikit-learn
seaborn==0.13.2
# via pymatgen-analysis-diffusion
secretstorage==3.5.0
Expand Down Expand Up @@ -616,18 +600,13 @@ swagger-spec-validator==3.0.4
# bravado-core
# mpcontribs-client
sympy==1.14.0
# via
# matminer
# pymatgen-core
# via pymatgen-core
tabulate==0.10.0
# via pymatgen-core
threadpoolctl==3.6.0
# via scikit-learn
tifffile==2026.3.3
# via scikit-image
tqdm==4.67.3
# via
# matminer
# mpcontribs-client
# pymatgen-core
traitlets==5.14.3
Expand Down Expand Up @@ -672,9 +651,7 @@ typing-inspection==0.4.2
# pydantic
# pydantic-settings
tzdata==2026.1
# via
# arrow
# pandas
# via arrow
ujson==5.12.0
# via mpcontribs-client
uncalled-for==0.3.1
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-ubuntu-latest_py3.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ bibtexparser==1.4.4
# via pymatgen-core
blake3==1.0.8
# via emmet-core
boto3==1.42.89
boto3==1.42.90
# via mp-api (pyproject.toml)
botocore==1.42.89
botocore==1.42.90
# via
# boto3
# s3transfer
Expand Down
35 changes: 6 additions & 29 deletions requirements/requirements-ubuntu-latest_py3.12_extras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ blinker==1.9.0
# via flask
boltons==25.0.0
# via mpcontribs-client
boto3==1.42.89
boto3==1.42.90
# via mp-api (pyproject.toml)
botocore==1.42.89
botocore==1.42.90
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -209,7 +209,6 @@ joblib==1.5.3
# via
# pymatgen-analysis-diffusion
# pymatgen-core
# scikit-learn
json2html==1.3.0
# via mpcontribs-client
jsonpointer==3.1.1
Expand Down Expand Up @@ -248,8 +247,6 @@ markupsafe==3.0.3
# flask
# jinja2
# werkzeug
matminer==0.10.1
# via mp-api (pyproject.toml)
matplotlib==3.10.8
# via
# ase
Expand All @@ -269,7 +266,6 @@ monty==2026.2.18
# via
# custodian
# emmet-core
# matminer
# mp-api (pyproject.toml)
# pymatgen-core
more-itertools==11.0.2
Expand Down Expand Up @@ -306,7 +302,6 @@ numpy==2.4.4
# ase
# contourpy
# imageio
# matminer
# matplotlib
# monty
# mpcontribs-client
Expand All @@ -316,7 +311,6 @@ numpy==2.4.4
# pymatgen-core
# pymatgen-io-validation
# scikit-image
# scikit-learn
# scipy
# seaborn
# seekpath
Expand All @@ -342,9 +336,8 @@ packaging==26.1
# sphinx
palettable==3.3.3
# via pymatgen-core
pandas==2.3.3
pandas==3.0.2
# via
# matminer
# mpcontribs-client
# pymatgen-core
# seaborn
Expand Down Expand Up @@ -434,7 +427,6 @@ pyjwt[crypto]==2.12.1
pymatgen==2026.3.23
# via
# emmet-core
# matminer
# mp-api (pyproject.toml)
# mp-pyrho
# mpcontribs-client
Expand All @@ -455,7 +447,6 @@ pymatgen-io-validation==0.1.2
pymongo==4.16.0
# via
# emmet-core
# matminer
# mpcontribs-client
pyparsing==3.3.2
# via
Expand Down Expand Up @@ -495,9 +486,7 @@ python-dotenv==1.2.2
python-multipart==0.0.26
# via mcp
pytz==2026.1.post1
# via
# bravado-core
# pandas
# via bravado-core
pyyaml==6.0.3
# via
# bravado
Expand All @@ -516,7 +505,6 @@ requests==2.33.1
# via
# bravado
# bravado-core
# matminer
# mp-api (pyproject.toml)
# pymatgen-core
# pymatgen-io-validation
Expand Down Expand Up @@ -551,15 +539,11 @@ s3transfer==0.16.0
# via boto3
scikit-image==0.26.0
# via pymatgen-analysis-defects
scikit-learn==1.8.0
# via matminer
scipy==1.17.1
# via
# ase
# matminer
# pymatgen-core
# scikit-image
# scikit-learn
seaborn==0.13.2
# via pymatgen-analysis-diffusion
secretstorage==3.5.0
Expand Down Expand Up @@ -612,18 +596,13 @@ swagger-spec-validator==3.0.4
# bravado-core
# mpcontribs-client
sympy==1.14.0
# via
# matminer
# pymatgen-core
# via pymatgen-core
tabulate==0.10.0
# via pymatgen-core
threadpoolctl==3.6.0
# via scikit-learn
tifffile==2026.4.11
# via scikit-image
tqdm==4.67.3
# via
# matminer
# mpcontribs-client
# pymatgen-core
traitlets==5.14.3
Expand Down Expand Up @@ -665,9 +644,7 @@ typing-inspection==0.4.2
# pydantic
# pydantic-settings
tzdata==2026.1
# via
# arrow
# pandas
# via arrow
ujson==5.12.0
# via mpcontribs-client
uncalled-for==0.3.1
Expand Down
31 changes: 11 additions & 20 deletions tests/client/materials/test_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
from mp_api.client.routes.materials.similarity import SimilarityRester


try:
import matminer
except ImportError:
matminer = None


@pytest.fixture(scope="module")
def test_struct():
poscar = """Al2
Expand Down Expand Up @@ -59,21 +53,18 @@ def test_similarity_search():
def test_similarity_vector_search(test_struct):
rester = SimilarityRester()

# skip these tests if `matminer` is not installed
if matminer is not None:
fv = rester.fingerprint_structure(test_struct)
assert isinstance(fv, np.ndarray)
assert len(fv) == 122
assert isinstance(rester._fingerprinter, SimilarityScorer)

assert all(
isinstance(entry, SimilarityEntry)
and isinstance(entry.dissimilarity, float)
for entry in rester.find_similar(
test_struct,
top=2,
)
fv = rester.fingerprint_structure(test_struct)
assert isinstance(fv, np.ndarray)
assert len(fv) == 122
assert isinstance(rester._fingerprinter, SimilarityScorer)

assert all(
isinstance(entry, SimilarityEntry) and isinstance(entry.dissimilarity, float)
for entry in rester.find_similar(
test_struct,
top=2,
)
)

get_top = 5
sim_entries = rester.find_similar("mp-149", top=get_top)
Expand Down
Loading