Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spglib 2.5 compatibility #943

Merged
merged 11 commits into from
Oct 2, 2024
Merged
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ docs/_build/*/*/*
# C extensions
*.so

.DS_Store

# Packages
*.egg
*.egg-info
Expand Down
11 changes: 10 additions & 1 deletion matminer/datasets/tests/test_datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import unittest
from time import sleep

import numpy as np
import requests
Expand All @@ -20,6 +21,7 @@ def universal_dataset_check(
numeric_headers=None,
bool_headers=None,
test_func=None,
max_connect_attempts: int = 5,
):
# "Hard" integrity checks that take a long time.
# These tests only run if the MATMINER_DATASET_FULL_TEST
Expand Down Expand Up @@ -75,7 +77,14 @@ def universal_dataset_check(
# This runs when on a system with the CI environment var present
# (e.g. when running a continuous integration VCS system)
else:
download_page = requests.head(self.dataset_dict[dataset_name]["url"])
# try to be lenient in connecting to DB, in case a request fails once
for iconnect in range(max_connect_attempts):
download_page = requests.head(self.dataset_dict[dataset_name]["url"])
if download_page.ok:
break
if iconnect < max_connect_attempts - 1:
sleep(5)

self.assertTrue(download_page.ok)


Expand Down
4 changes: 2 additions & 2 deletions matminer/featurizers/structure/bonding.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ def get_equiv_sites(self, s, site):
sga = SpacegroupAnalyzer(s, symprec=0.01)
sg = sga.get_space_group_operations
sym_data = sga.get_symmetry_dataset()
equiv_atoms = sym_data["equivalent_atoms"]
wyckoffs = sym_data["wyckoffs"]
equiv_atoms = sym_data.equivalent_atoms
wyckoffs = sym_data.wyckoffs
ml-evs marked this conversation as resolved.
Show resolved Hide resolved
sym_struct = SymmetrizedStructure(s, sg, equiv_atoms, wyckoffs)
equivs = sym_struct.find_equivalent_sites(site)
return equivs
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
# pin NumPy version used in the build
"numpy>=1.20.1",
ml-evs marked this conversation as resolved.
Show resolved Hide resolved
"setuptools>=43.0.0"
"setuptools>=43.0.0",
]
build-backend = "setuptools.build_meta"

Expand Down
2 changes: 1 addition & 1 deletion requirements/ubuntu-latest_py3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ soupsieve==2.5
# via beautifulsoup4
sparse==0.15.4
# via dscribe
spglib==2.4.0
spglib==2.5.0
# via pymatgen
sphinx==7.3.7
# via matminer (setup.py)
Expand Down
2 changes: 1 addition & 1 deletion requirements/ubuntu-latest_py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ soupsieve==2.5
# via beautifulsoup4
sparse==0.15.4
# via dscribe
spglib==2.4.0
spglib==2.5.0
# via pymatgen
sphinx==7.3.7
# via matminer (setup.py)
Expand Down
2 changes: 1 addition & 1 deletion requirements/ubuntu-latest_py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ soupsieve==2.5
# via beautifulsoup4
sparse==0.15.4
# via dscribe
spglib==2.4.0
spglib==2.5.0
# via pymatgen
sphinx==7.3.7
# via matminer (setup.py)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def local_version(version):
"sympy ~= 1.11",
"monty >= 2023",
"pymatgen >= 2023",
"spglib>=2.5.0",
],
extras_require=extras_require,
classifiers=[
Expand Down
Loading