diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e362429ea..7f31e5bc6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,9 @@ # The ext package is also only tested in this workflow. Coverage is also computed based on this platform. name: Testing +permissions: + contents: read + env: PYTEST_ADDOPTS: "--color=yes" diff --git a/.gitignore b/.gitignore index b32a3093b..d3b12e816 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ docs/_build/*/*/* # C extensions *.so +.DS_Store + # Packages *.egg *.egg-info diff --git a/matminer/datasets/tests/test_datasets.py b/matminer/datasets/tests/test_datasets.py index 5c75dfa0c..ea3e108fb 100644 --- a/matminer/datasets/tests/test_datasets.py +++ b/matminer/datasets/tests/test_datasets.py @@ -1,5 +1,6 @@ import os import unittest +from time import sleep import numpy as np import requests @@ -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 @@ -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) diff --git a/matminer/featurizers/structure/bonding.py b/matminer/featurizers/structure/bonding.py index f22a3cdbc..69b1ecc9e 100644 --- a/matminer/featurizers/structure/bonding.py +++ b/matminer/featurizers/structure/bonding.py @@ -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 = getattr(sym_data, "equivalent_atoms", sym_data["equivalent_atoms"]) + wyckoffs = getattr(sym_data, "wyckoffs", sym_data["wyckoffs"]) sym_struct = SymmetrizedStructure(s, sg, equiv_atoms, wyckoffs) equivs = sym_struct.find_equivalent_sites(site) return equivs diff --git a/pyproject.toml b/pyproject.toml index 71ec89d26..77d85ff41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ # pin NumPy version used in the build - "numpy>=1.20.1", - "setuptools>=43.0.0" + "numpy>=1.20.1, <2", + "setuptools>=43.0.0", ] build-backend = "setuptools.build_meta" diff --git a/requirements/ubuntu-latest_py3.10.txt b/requirements/ubuntu-latest_py3.10.txt index ab2cbb6cc..86761133c 100644 --- a/requirements/ubuntu-latest_py3.10.txt +++ b/requirements/ubuntu-latest_py3.10.txt @@ -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) diff --git a/requirements/ubuntu-latest_py3.11.txt b/requirements/ubuntu-latest_py3.11.txt index 7b8853fc1..5da474efe 100644 --- a/requirements/ubuntu-latest_py3.11.txt +++ b/requirements/ubuntu-latest_py3.11.txt @@ -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) diff --git a/requirements/ubuntu-latest_py3.9.txt b/requirements/ubuntu-latest_py3.9.txt index be66219ba..e5a6d6891 100644 --- a/requirements/ubuntu-latest_py3.9.txt +++ b/requirements/ubuntu-latest_py3.9.txt @@ -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)