Skip to content

Commit

Permalink
Fix to ams calculator for ase>=3.23 SCMSUITE-10090 SO107
Browse files Browse the repository at this point in the history
  • Loading branch information
dormrod committed Nov 19, 2024
1 parent e48be41 commit 94546dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions interfaces/adfsuite/ase_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", [])
Expand All @@ -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]
Expand All @@ -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:
Expand Down

0 comments on commit 94546dd

Please sign in to comment.