Skip to content

Commit

Permalink
Merge pull request i-pi#406 from EliaStocco/elphmod
Browse files Browse the repository at this point in the history
Elphmod
  • Loading branch information
mahrossi authored Nov 14, 2024
2 parents 74c5cb2 + 92b7585 commit d3bdb50
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ipi/pes/elphmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ class ModelIIIDriver(Dummy_driver):
Example: python3 driver.py -u -m elphmod -o driver=driver.pickle
"""

def __init__(self, *args, **kwargs):
def __init__(self, driver, *args, **kwargs):
import elphmod

filename = kwargs["driver"]
if not os.path.exists(filename):
raise ValueError(f"File '{filename}' does not exist.")
self.driver = elphmod.md.Driver.load(filename)
if not os.path.exists(driver):
raise ValueError(f"File '{driver}' does not exist.")
self.driver = elphmod.md.Driver.load(driver)
if self.driver is None:
raise ValueError(
f"Some error occured within `ModelIIIDriver.__init__` when trying to load the driver from file '{filename}'."
f"Some error occured within `ModelIIIDriver.__init__` when trying to load the driver from file '{driver}'."
)
del kwargs["driver"]
super().__init__(*args, **kwargs)
pass

Expand Down

0 comments on commit d3bdb50

Please sign in to comment.