Skip to content

Commit

Permalink
Added warning for all PES modules that have not been tested explicitly.
Browse files Browse the repository at this point in the history
Hopefully this will avoid too many problems the first time someone goes back to using them.
  • Loading branch information
ceriottm committed Nov 12, 2024
1 parent 1f19d59 commit f7dc29d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ipi/pes/bath.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class Harmonic_Bath_explicit(object):
"""Explicit description of an Harmonic bath"""

def __init__(self, nbath, m, eta0, eps1, eps2, deltaQ, w_c, *args, **kwargs):
warnings(

Check warning on line 13 in ipi/pes/bath.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'warnings'
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,

Check warning on line 15 in ipi/pes/bath.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'verbosity'
)
super().__init__(*args, **kwargs)

self.nbath = nbath
Expand Down
6 changes: 5 additions & 1 deletion ipi/pes/driverdipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,18 @@ class driverdipole_driver(Dummy_driver):
}

def __init__(self, *args, **kwargs):
warnings(
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,

Check warning on line 140 in ipi/pes/driverdipole.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'verbosity'
)
self.opts = dict()
self.count = 0
super().__init__(*args, **kwargs)

def check_parameters(self):
"""Check the arguments required to run the driver."""
try:
arglist = self.args.split(",")
arglist = self.args
except ValueError:
sys.exit(self.__doc__)

Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/elphmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class ModelIIIDriver(Dummy_driver):

def check_parameters(self):
"""Check arguments and load driver instance."""

warnings(

Check warning on line 19 in ipi/pes/elphmod.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'warnings'
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,

Check warning on line 21 in ipi/pes/elphmod.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'verbosity'
)
import elphmod

if len(self.args) != 1:
Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/mace.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ class MACE_driver(ASEDriver):
"""

def __init__(self, template, model, device="cpu", *args, **kwargs):

warnings(

Check warning on line 28 in ipi/pes/mace.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'warnings'
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,

Check warning on line 30 in ipi/pes/mace.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'verbosity'
)
global MACECalculator

try:
Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/rascal.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class Rascal_driver(Dummy_driver):

def __init__(self, model, template, *args, **kwargs):
global RascalCalc

warnings(

Check warning on line 32 in ipi/pes/rascal.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'warnings'
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,

Check warning on line 34 in ipi/pes/rascal.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'verbosity'
)
try:
from rascal.models.genericmd import GenericMDCalculator as RascalCalc
except:
Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/so3lr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class SO3LR_driver(ASEDriver):
"""

def __init__(self, *args, **kwargs):

warnings(

Check warning on line 21 in ipi/pes/so3lr.py

View workflow job for this annotation

GitHub Actions / lint

F821 undefined name 'warnings'
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,
)
global So3lrCalculator
try:
from so3lr import So3lrCalculator
Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class Spline_driver(Dummy_driver):
"""\nspline driver requires specification of filename that contains 5 columns (pos, f1,f2,f3,e) to perform 3x1D spline.\nExample: python driver.py -m spline -u -o <filename>\n"""

def __init__(self, data_file, *args, **kwargs):

warnings(
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,
)
self.data_file = data_file
super().__init__(*args, **kwargs)
self.get_spline()
Expand Down
5 changes: 4 additions & 1 deletion ipi/pes/xtb.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class TBLiteDriver(Dummy_driver):
"""

def __init__(self, json_input, *args, **kwargs):

warnings(
"THIS PES HAS NOT BEEN TESTED FOLLOWING CONVERSION TO THE NEW PES API.",
verbosity.low,
)
config = json.load(open(json_input))

global tb
Expand Down

0 comments on commit f7dc29d

Please sign in to comment.