diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be5dbbeb..0e1a186b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: compiler: gnu version: 8 - - os: macos-latest + - os: macos-12 build: cmake build-type: debug compiler: gnu @@ -36,7 +36,7 @@ jobs: compiler: gnu version: 9 - - os: macos-latest + - os: macos-12 build: meson build-type: debug compiler: gnu @@ -242,7 +242,7 @@ jobs: matrix: os: [ubuntu-latest] gcc_v: [10] - python_v: ['3.7', '3.8', '3.9', '3.10'] + python_v: ['3.8', '3.9', '3.10', '3.11', '3.12'] env: FC: gfortran diff --git a/python/dftd3/test_ase.py b/python/dftd3/test_ase.py index 080a76e1..52bc393b 100644 --- a/python/dftd3/test_ase.py +++ b/python/dftd3/test_ase.py @@ -14,6 +14,8 @@ # You should have received a copy of the Lesser GNU General Public License # along with s-dftd3. If not, see . +from typing import Iterator + import numpy as np import pytest from pytest import approx, raises @@ -27,6 +29,12 @@ ase = None +def get_calcs(calc) -> Iterator[ase.calculators.calculator.Calculator]: + if hasattr(calc, "mixer"): + calc = calc.mixer + yield from calc.calcs + + @pytest.mark.skipif(ase is None, reason="requires ase") def test_ase_scand4(): thr = 1.0e-6 @@ -54,7 +62,7 @@ def test_ase_scand4(): atoms.calc = DFTD3(method="SCAN", damping="d3bj").add_calculator(EMT()) assert atoms.get_potential_energy() == approx(3.6452960962398406, abs=thr) - energies = [calc.get_potential_energy() for calc in atoms.calc.calcs] + energies = [calc.get_potential_energy() for calc in get_calcs(atoms.calc)] assert energies == approx([-0.03880921894019244, 3.684105315180033], abs=thr) @@ -87,5 +95,5 @@ def test_ase_tpssd4(): atoms.calc = DFTD3(method="TPSS", damping="d3zero").add_calculator(EMT()) assert atoms.get_potential_energy() == approx(4.963774668847532, abs=thr) - energies = [calc.get_potential_energy() for calc in atoms.calc.calcs] + energies = [calc.get_potential_energy() for calc in get_calcs(atoms.calc)] assert energies == approx([-0.14230914516094673, 5.106083814008478], abs=thr) diff --git a/python/mesonpep517.toml b/python/mesonpep517.toml index fc1c92b6..6ed23feb 100644 --- a/python/mesonpep517.toml +++ b/python/mesonpep517.toml @@ -14,11 +14,11 @@ classifiers = [ "Intended Audience :: Science/Research", "Programming Language :: Fortran", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Chemistry", "Topic :: Scientific/Engineering :: Physics", ] diff --git a/python/setup.cfg b/python/setup.cfg index 82d41c7d..e5eb76ef 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -18,11 +18,11 @@ classifiers = Programming Language :: Fortran Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Scientific/Engineering :: Chemistry [options] @@ -36,7 +36,7 @@ tests_require = ase pyscf qcelemental -python_requires = >=3.7 +python_requires = >=3.8 [options.extras_require] ase = ase