Skip to content

Commit

Permalink
Merge branch 'main' into neb_nn
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen authored Sep 17, 2024
2 parents d65aef9 + 4c15a3c commit 7bbff3b
Show file tree
Hide file tree
Showing 32 changed files with 77 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.10", "3.12"]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
python-version: "3.9"
python-version: "3.10"

runs-on: ${{ matrix.os }}
defaults:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project generally adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.5]

### Added

- Added support for atomate2>=0.0.15

### Changed

- The minimum supported Python version is now 3.10 in alignment with Pymatgen

## [0.11.4]

### Changed

- Put a `<=` version pin on Atomate2 to resolve upstream breaking change

## [0.11.3]

### Added
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "quacc"
description="A platform to enable high-throughput, database-driven quantum chemistry and computational materials science"
version = "0.11.4"
version = "0.11.5"
readme = "README.md"
license = { text = "BSD-3" }
authors = [{ name = "Andrew S. Rosen", email = "[email protected]" }]
Expand All @@ -15,7 +15,6 @@ classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -25,7 +24,7 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: MacOS",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"ase>=3.23.0", # for Atoms object and calculators
"custodian>=2024.3.12", # for automated error corrections
Expand All @@ -47,7 +46,7 @@ dask = ["dask[distributed]>=2023.12.1", "dask-jobqueue>=0.8.2"]
defects = ["pymatgen-analysis-defects>=2023.8.22", "shakenbreak>=3.2.0"]
jobflow = ["jobflow[fireworks]>=0.1.14", "jobflow-remote>=0.1.0"]
mlp = ["matgl>=1.1.2", "chgnet>=0.3.3", "mace-torch>=0.3.3", "torch-dftd>=0.4.0"]
mp = ["atomate2<=0.0.14"]
mp = ["atomate2>=0.0.14"]
newtonnet = ["newtonnet>=1.1"]
parsl = ["parsl[monitoring]>=2024.5.27; platform_system!='Windows'"]
phonons = ["phonopy>=2.20.0", "seekpath>=2.1.0"]
Expand Down
6 changes: 5 additions & 1 deletion src/quacc/calculators/vasp/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,11 @@ def convert_vasp_maker(self, VaspMaker: BaseVaspMaker) -> dict:
)
self.incar_dict = input_set.incar
self.pmg_kpts = input_set.kpoints
self.potcar_symbols = input_set.potcar
self.potcar_symbols = (
input_set.potcar.split("\n")
if isinstance(input_set.potcar, str)
else input_set.potcar
)
self.potcar_functional = input_set_generator.potcar_functional
self.poscar = input_set.poscar
return self._convert()
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/calculators/vasp/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _cleanup_params(self) -> None:
# Allow the user to use setups='mysetups.yaml' to load in a custom
# setups from a YAML file
if (
isinstance(self.user_calc_params.get("setups"), (str, Path))
isinstance(self.user_calc_params.get("setups"), str | Path)
and self.user_calc_params["setups"] not in ase_setups.setups_defaults
):
self.user_calc_params["setups"] = load_vasp_yaml_calc(
Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/emt/defects.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@


if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/emt/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/emt/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/emt/slabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
2 changes: 1 addition & 1 deletion src/quacc/recipes/espresso/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def prepare_copy(
dict
Dictionary of files to copy.
"""
if isinstance(copy_files, (str, Path)):
if isinstance(copy_files, str | Path):
copy_files = [copy_files]

if isinstance(copy_files, list):
Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/espresso/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/espresso/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/espresso/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

if TYPE_CHECKING:
from collections import UserDict
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from quacc.types import (
EspressoPhononDosSchema,
Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/mlp/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
has_seekpath = bool(find_spec("seekpath"))

if TYPE_CHECKING:
from typing import Any, Callable, Literal
from collections.abc import Callable
from typing import Any, Literal

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/tblite/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
has_seekpath = bool(find_spec("seekpath"))

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/vasp/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
)

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/recipes/vasp/slabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from quacc.wflow_tools.customizers import customize_funcs

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

from ase.atoms import Atoms

Expand Down
5 changes: 3 additions & 2 deletions src/quacc/runners/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
pass

if TYPE_CHECKING:
from collections.abc import Callable
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -206,7 +207,7 @@ def run_opt(

# Handle optimizer kwargs
if (
issubclass(optimizer, (SciPyOptimizer, MolecularDynamics))
issubclass(optimizer, SciPyOptimizer | MolecularDynamics)
or optimizer.__name__ == "IRC"
):
# https://gitlab.com/ase/ase/-/issues/1476
Expand All @@ -230,7 +231,7 @@ def run_opt(
full_run_kwargs.pop("fmax")
try:
with traj, optimizer(self.atoms, **merged_optimizer_kwargs) as dyn:
if issubclass(optimizer, (SciPyOptimizer, MolecularDynamics)):
if issubclass(optimizer, SciPyOptimizer | MolecularDynamics):
# https://gitlab.coms/ase/ase/-/issues/1475
# https://gitlab.com/ase/ase/-/issues/1497
dyn.run(**full_run_kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/runners/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def calc_setup(

# Copy files to tmpdir and decompress them if needed
if copy_files:
if isinstance(copy_files, (str, Path)):
if isinstance(copy_files, str | Path):
copy_files = {copy_files: "*"}

for source_directory, filenames in copy_files.items():
Expand Down
3 changes: 2 additions & 1 deletion src/quacc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from pydantic_settings import BaseSettings, SettingsConfigDict

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

_DEFAULT_CONFIG_FILE_PATH = Path("~", ".quacc.yaml").expanduser().resolve()

Expand Down
7 changes: 4 additions & 3 deletions src/quacc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ class DefaultSetting(BaseSettings):


if TYPE_CHECKING:
from collections.abc import Callable
from datetime import datetime
from pathlib import Path
from typing import Any, Callable, Literal, Union
from typing import Any, Literal

from ase.atoms import Atoms
from ase.md.md import MolecularDynamics
Expand All @@ -41,8 +42,8 @@ class DefaultSetting(BaseSettings):

# ----------- File handling -----------

Filenames = Union[str, Path, list[Union[str, Path]]]
SourceDirectory = Union[str, Path]
Filenames = str | Path | list[str | Path]
SourceDirectory = str | Path

# ----------- k-point handling -----------

Expand Down
9 changes: 5 additions & 4 deletions src/quacc/wflow_tools/customizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from quacc.utils.dicts import recursive_dict_merge

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any


def strip_decorator(func: Callable) -> Callable:
Expand Down Expand Up @@ -66,7 +67,7 @@ def strip_decorator(func: Callable) -> Callable:
from prefect import Flow as PrefectFlow
from prefect import Task

if isinstance(func, (Task, PrefectFlow)):
if isinstance(func, Task | PrefectFlow):
func = func.fn
elif hasattr(func, "__wrapped__"):
func = func.__wrapped__
Expand Down Expand Up @@ -182,9 +183,9 @@ def customize_funcs(
decorators = decorators or {}
updated_funcs = []

if not isinstance(names, (list, tuple)):
if not isinstance(names, list | tuple):
names = [names]
if not isinstance(funcs, (list, tuple)):
if not isinstance(funcs, list | tuple):
funcs = [funcs]

if "all" in names:
Expand Down
3 changes: 2 additions & 1 deletion src/quacc/wflow_tools/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from __future__ import annotations

from collections.abc import Callable
from functools import partial, wraps
from typing import Any, Callable
from typing import Any

from quacc.settings import change_settings_wrap

Expand Down
3 changes: 2 additions & 1 deletion src/quacc/wflow_tools/job_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from quacc.wflow_tools.decorators import job

if TYPE_CHECKING:
from typing import Any, Callable
from collections.abc import Callable
from typing import Any


@job
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/wflow_tools/prefect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _collect_futures(futures, expr, context):
result = result.get()
results.append(result)

states_by_future = dict(zip(futures, results))
states_by_future = dict(zip(futures, results, strict=False))

def replace_futures_with_states(expr, context):
# Expressions inside quotes should not be modified
Expand Down
1 change: 0 additions & 1 deletion tests/requirements-covalent.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
covalent==0.235.1rc0
covalent-cloud==0.73.0
covalent-hpc-plugin==0.0.8
covalent-slurm-plugin==0.18.0
2 changes: 1 addition & 1 deletion tests/requirements-dask.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dask[distributed]==2024.8.2
dask[distributed]==2024.9.0
dask-jobqueue==0.9.0
2 changes: 1 addition & 1 deletion tests/requirements-jobflow.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jobflow==0.1.18
jobflow-remote==0.1.3
jobflow-remote==0.1.4
fireworks==2.0.3
2 changes: 1 addition & 1 deletion tests/requirements-parsl.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parsl[monitoring]==2024.9.2
parsl[monitoring]==2024.9.16
2 changes: 1 addition & 1 deletion tests/requirements-phonons.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
phonopy==2.27.0
phonopy==2.28.0
seekpath==2.1.0
2 changes: 1 addition & 1 deletion tests/requirements-prefect.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dask-jobqueue==0.9.0
prefect[dask]==3.0.1
prefect[dask]==3.0.2
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ monty==2024.7.30
numpy==1.26.4
psutil==5.9.8
pydantic==2.9.1
pydantic-settings==2.4.0
pymatgen==2024.7.18
pydantic-settings==2.5.2
pymatgen==2024.9.17
ruamel.yaml==0.18.6
typer==0.12.5

0 comments on commit 7bbff3b

Please sign in to comment.