From 94546dd7567da0bd1d7d5d3a0756204a56a5ca71 Mon Sep 17 00:00:00 2001 From: David Ormrod Morley Date: Wed, 13 Nov 2024 17:00:22 +0100 Subject: [PATCH] Fix to ams calculator for ase>=3.23 SCMSUITE-10090 SO107 --- interfaces/adfsuite/ase_calculator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interfaces/adfsuite/ase_calculator.py b/interfaces/adfsuite/ase_calculator.py index ee1da567..fcd334d9 100644 --- a/interfaces/adfsuite/ase_calculator.py +++ b/interfaces/adfsuite/ase_calculator.py @@ -184,7 +184,7 @@ def __init__(self, settings=None, name="", amsworker=False, restart=True, molecu self.settings = settings.copy() self.amsworker = amsworker - self.name = name + self._name = name self.restart = restart self.molecule = molecule extractors = settings.pop("Extractors", []) @@ -209,7 +209,7 @@ def __init__(self, settings=None, name="", amsworker=False, restart=True, molecu @property def counter(self): # this is needed for deepcopy/pickling etc - if not self.name in self._counter: + if self.name not in self._counter: self.set_counter() self._counter[self.name] += 1 return self._counter[self.name] @@ -222,6 +222,10 @@ def implemented_properties(self): """Returns the list of properties that this calculator has implemented""" return [extractor.name for extractor in self.extractors if extractor.check_settings(self.settings)] + @property + def name(self): + return self._name + def calculate(self, atoms=None, properties=["energy"], system_changes=all_changes): """Calculate the requested properties. If atoms is not set, it will reuse the last known Atoms object.""" if atoms is not None: