Skip to content

Commit

Permalink
enforce ase v3.23 with castep calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
gelzinyte committed Aug 5, 2024
1 parent 7c910d7 commit e9086df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wfl/calculators/castep.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

from copy import deepcopy

from packaging.version import Version

import ase
from ase.calculators.calculator import all_changes
from ase.calculators.castep import Castep as ASE_Castep

Expand Down Expand Up @@ -51,6 +54,10 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_",
workdir=None, scratchdir=None,
calculator_exec=None, **kwargs):

if Version(ase.__version__) < Version("3.23"):
raise ImportError(f"The wfl CASTEP calculator is only compatible with ASE v3.23 and higher, "
f"but your ASE version is v{ase.__version__}. Please upgrade")

kwargs = deepcopy(kwargs)
if calculator_exec is not None:
if "castep_command" in kwargs:
Expand Down

0 comments on commit e9086df

Please sign in to comment.