mirror of
https://github.com/LCPQ/EMSL_Basis_Set_Exchange_Local
synced 2025-01-03 01:55:54 +01:00
Add --check for checking the output
This commit is contained in:
parent
18bc6bf347
commit
a8c430d669
@ -14,6 +14,7 @@ Usage:
|
||||
[--atom=<atom_name>...]
|
||||
[--db_path=<db_path>]
|
||||
[(--save [--path=<path>])]
|
||||
[--check=<format>]
|
||||
EMSL_api.py list_formats
|
||||
EMSL_api.py create_db --db_path=<db_path>
|
||||
--format=<format>
|
||||
@ -115,8 +116,9 @@ if __name__ == '__main__':
|
||||
basis_name = arguments["--basis"][0]
|
||||
elts = arguments["--atom"]
|
||||
|
||||
l = e.get_basis(basis_name, elts)
|
||||
str_ = "\n\n".join(l) + "\n"
|
||||
l_atom_basis = e.get_basis(basis_name, elts, arguments["--check"])
|
||||
# Add separation between atoms, and a empty last line
|
||||
str_ = "\n\n".join(l_atom_basis) + "\n"
|
||||
|
||||
if arguments["--save"]:
|
||||
|
||||
|
@ -298,7 +298,7 @@ class EMSL_local:
|
||||
|
||||
return [str(i[0]) for i in c.fetchall()]
|
||||
|
||||
def get_basis(self, basis_name, elts=None, checking=None):
|
||||
def get_basis(self, basis_name, elts=None, check_format=None):
|
||||
"""
|
||||
Return the data from the basis set
|
||||
"""
|
||||
@ -329,12 +329,20 @@ class EMSL_local:
|
||||
# C h e c k #
|
||||
# ~#~#~#~#~ #
|
||||
|
||||
checking = False
|
||||
d_check = {"gamess": check_gamess,
|
||||
"NWChem": check_NWChem}
|
||||
|
||||
if check_format:
|
||||
try:
|
||||
f = d_check[check_format]
|
||||
except KeyError:
|
||||
str_ = """This format is not handle. Chose one of : {}"""
|
||||
print >>sys.stderr, str_.format(format(str(d_check.keys())))
|
||||
sys.exit(1)
|
||||
|
||||
if checking:
|
||||
for atom_basis in l_atom_basis:
|
||||
for type_, _, _ in self.get_list_type(atom_basis.split("\n")):
|
||||
check_gamess(type_)
|
||||
f(type_)
|
||||
|
||||
# ~#~#~#~#~#~ #
|
||||
# R e t u r n #
|
||||
|
Loading…
Reference in New Issue
Block a user