Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command line interface #33

Merged
merged 26 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
54c83af
only detect Step in lammps get_thermo function
Yi-FanLi Nov 29, 2023
501c799
do not comment out dump in hti
Yi-FanLi Nov 29, 2023
d7dae1a
fix lammps thermo_modify format error
Yi-FanLi Nov 29, 2023
53c95f6
set if_dump_avg_posi default to be True
Yi-FanLi Nov 29, 2023
7587f25
make hti_water runnable
Yi-FanLi Nov 29, 2023
0420655
make DpFreeEnergyWater workflow runnable
Yi-FanLi Nov 29, 2023
20c6d94
add command line interface
Yi-FanLi Nov 29, 2023
fb6d54f
correct hti_water CLI name
Yi-FanLi Nov 29, 2023
2133aff
correct CLI name of ti_water
Yi-FanLi Dec 6, 2023
fff1a33
migrate setup.py to pyproject.toml
Yi-FanLi Dec 6, 2023
3a6b589
migrate to build in release.yml
Yi-FanLi Dec 6, 2023
4a5b7f1
recover exec_args function
Yi-FanLi Dec 11, 2023
fcd99f6
recover exec_args in hti_water
Yi-FanLi Dec 11, 2023
9452005
replace setup.py with pyproject.toml in test_lib_utils
Yi-FanLi Dec 11, 2023
102a025
recover exec_args in ti_water
Yi-FanLi Dec 11, 2023
c960398
update test_deepmd_deep_on in test_hti_gen_lammps_input
Yi-FanLi Dec 11, 2023
a0f5127
fix test_ti_gen_lammps_input thermo_modify format error
Yi-FanLi Dec 11, 2023
0bbf2fe
fix the other test_ti_gen_lammps_input thermo_modify format error
Yi-FanLi Dec 11, 2023
55cfcbb
uncomment dump line for test_spring_off in test_hti_gen_lammps_input
Yi-FanLi Dec 11, 2023
4049f63
uncomment dump lines
Yi-FanLi Dec 12, 2023
7c2e42c
fix UTs by updating benchmark scripts
Yi-FanLi Dec 12, 2023
d7fe43e
uncomment dump lines
Yi-FanLi Dec 12, 2023
f1fbc22
uncomment dump lines in unittests
Yi-FanLi Dec 12, 2023
ed56172
fix UT test_ti_water_gen_lammps_input
Yi-FanLi Dec 12, 2023
1b226a2
fix UTs
Yi-FanLi Dec 12, 2023
6d7fce5
always pass codecov status
Yi-FanLi Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
with:
python-version: 3.7
architecture: x64
- run: python setup.py sdist
- run: pipx run build
- name: Publish a Python distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ignore:
- "tests"
coverage:
status:
project:
default:
threshold: 100%
patch:
default:
threshold: 100%
24 changes: 13 additions & 11 deletions dpti/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# s.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
# import dpti
# from . import lib
# import .lib
# from . import equi
# from . import hti
# from . import hti_liq
# from . import ti
# from . import gdi
# from dpti import lib
import sys
import os

NAME = "dpti"
SHORT_CMD = "dpti"
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import dpti
from . import lib
from . import equi
from . import hti
from . import hti_liq
from . import ti
from . import gdi
77 changes: 44 additions & 33 deletions dpti/equi.py
Original file line number Diff line number Diff line change
@@ -315,9 +315,6 @@
# open(output, 'w').write(conf_lmp)

def make_task(iter_name, jdata, ens=None, temp=None, pres=None, if_dump_avg_posi=None, npt_dir=None):
# jfile_path = os.path.abspath(jfile)
# with open(jfile, 'r') as f:
# jdata = json.load(f)

equi_args = [
Argument("equi_conf", str),
@@ -577,12 +574,13 @@
# open(, 'w').write(json.dumps(info)).close()
return info_dict

def _main ():
parser = argparse.ArgumentParser(
description="Equilibrium simulation")
subparsers = parser.add_subparsers(title='Valid subcommands', dest='command')
def add_module_subparsers(main_subparsers):
module_parser = main_subparsers.add_parser('equi', help='equilibration simulations')
module_subparsers = module_parser.add_subparsers(help='commands for equilibration simulations', dest='command', required=True)
add_subparsers(module_subparsers)

Check warning on line 580 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L578-L580

Added lines #L578 - L580 were not covered by tests

parser_gen = subparsers.add_parser('gen', help='Generate a job')
def add_subparsers(module_subparsers):
parser_gen = module_subparsers.add_parser('gen', help='generate a job')

Check warning on line 583 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L583

Added line #L583 was not covered by tests
parser_gen.add_argument('PARAM', type=str ,
help='json parameter file')
parser_gen.add_argument('-e','--ensemble', type=str,
@@ -597,42 +595,55 @@
help='use conf computed from NPT simulation')
parser_gen.add_argument('-o','--output', type=str, default = 'new_job',
help='the output folder for the job')
# parser_gen.add_argument("-z", "--meam", help="whether use meam instead of dp", action="store_true")
parser_gen.set_defaults(func=handle_gen)

Check warning on line 598 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L598

Added line #L598 was not covered by tests

parser_comp = subparsers.add_parser('extract', help= 'Extract the conf')
parser_comp.add_argument('JOB', type=str ,
parser_extract = module_subparsers.add_parser('extract', help= 'extract the conf')
parser_extract.add_argument('JOB', type=str ,

Check warning on line 601 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L600-L601

Added lines #L600 - L601 were not covered by tests
help='folder of the job')
parser_comp.add_argument('-o','--output', type=str, default = 'conf.lmp',
parser_extract.add_argument('-o','--output', type=str, default = 'conf.lmp',

Check warning on line 603 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L603

Added line #L603 was not covered by tests
help='output conf file name')
parser_extract.set_defaults(func=handle_extract)

Check warning on line 605 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L605

Added line #L605 was not covered by tests

parser_stat = subparsers.add_parser('stat-bond', help= 'Statistic of the bonds')
parser_stat = module_subparsers.add_parser('stat-bond', help= 'Statistic of the bonds')

Check warning on line 607 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L607

Added line #L607 was not covered by tests
parser_stat.add_argument('JOB', type=str ,
help='folder of the job')
parser_stat.add_argument('-s','--skip', type=int, default = 1,
help='skip this number of frames')
parser_stat.set_defaults(func=handle_stat_bond)

Check warning on line 612 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L612

Added line #L612 was not covered by tests

parser_stat = subparsers.add_parser('compute', help= 'Compute thermodynamics')
parser_stat.add_argument('JOB', type=str ,
parser_compute = module_subparsers.add_parser('compute', help= 'Compute thermodynamics')
parser_compute.add_argument('JOB', type=str ,

Check warning on line 615 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L614-L615

Added lines #L614 - L615 were not covered by tests
help='folder of the job')
parser_compute.set_defaults(func=handle_compute)

Check warning on line 617 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L617

Added line #L617 was not covered by tests

def handle_gen(args):
jdata = json.load(open(args.PARAM, 'r'))

Check warning on line 620 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L620

Added line #L620 was not covered by tests
# jfile = os.path.abspath(args.PARAM)
make_task(args.output, jdata, args.ensemble, args.temperature, args.pressure, args.avg_posi, args.conf_npt,)

Check warning on line 622 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L622

Added line #L622 was not covered by tests

def handle_extract(args):
extract(args.JOB, args.output)

Check warning on line 625 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L625

Added line #L625 was not covered by tests

def handle_stat_bond(args):
b, a = water_bond(args.JOB, args.skip)
print(b, a/np.pi*180)

Check warning on line 629 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L628-L629

Added lines #L628 - L629 were not covered by tests

def handle_compute(args):
post_task(args.JOB)

Check warning on line 632 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L632

Added line #L632 was not covered by tests

def _main ():
parser = argparse.ArgumentParser(

Check warning on line 635 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L635

Added line #L635 was not covered by tests
description="equilibration simulations")
main_subparsers = parser.add_subparsers(title='modules', description='the subcommands of dpti', help='module-level help', dest='module', required=True)
add_subparsers(main_subparsers)

Check warning on line 638 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L637-L638

Added lines #L637 - L638 were not covered by tests
args = parser.parse_args()
exec_args(args, parser)

Check warning on line 640 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L640

Added line #L640 was not covered by tests


if args.command is None :
def exec_args(args, parser):
if hasattr(args, 'func'):
args.func(args)

Check warning on line 644 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L643-L644

Added lines #L643 - L644 were not covered by tests
else:
parser.print_help()
exit
if args.command == 'gen' :
jdata = json.load(open(args.PARAM, 'r'))
# jfile = os.path.abspath(args.PARAM)
make_task(args.output, jdata, args.ensemble, args.temperature, args.pressure, args.avg_posi, args.conf_npt,)
elif args.command == 'extract' :
extract(args.JOB, args.output)
elif args.command == 'stat-bond' :
b, a = water_bond(args.JOB, args.skip)
print(b, a/np.pi*180)
elif args.command == 'compute' :
post_task(args.JOB)


if __name__ == '__main__' :
_main()

if __name__ == '__main__':
_main()

Check warning on line 649 in dpti/equi.py

Codecov / codecov/patch

dpti/equi.py#L649

Added line #L649 was not covered by tests
86 changes: 43 additions & 43 deletions dpti/gdi.py
Original file line number Diff line number Diff line change
@@ -478,42 +478,64 @@
np.savetxt(os.path.join(gdidata['output'], 'pb.out'), tmp.T)
return True

def _main () :
parser = argparse.ArgumentParser(
description="Compute the phase boundary via Gibbs-Duhem integration")
parser.add_argument('PARAM', type=str,
def add_module_subparsers(main_subparsers):
module_parser = main_subparsers.add_parser('gdi', help='compute the phase boundary via Gibbs-Duhem integration')

Check warning on line 482 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L482

Added line #L482 was not covered by tests
# module_subparsers = module_parser.add_subparsers(help='commands of Gibbs-Duhem integration', dest='command', required=True)

module_parser.add_argument('PARAM', type=str,

Check warning on line 485 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L485

Added line #L485 was not covered by tests
help='json parameter file')
parser.add_argument('MACHINE', type=str,
module_parser.add_argument('MACHINE', type=str,

Check warning on line 487 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L487

Added line #L487 was not covered by tests
help='json machine file')
parser.add_argument('-g', '--gdidata-json', type=str, default=None,
module_parser.add_argument('-g', '--gdidata-json', type=str, default=None,

Check warning on line 489 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L489

Added line #L489 was not covered by tests
help='json gdi integration file')
parser.add_argument('-b','--begin', type=float, default=None,
module_parser.add_argument('-b','--begin', type=float, default=None,

Check warning on line 491 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L491

Added line #L491 was not covered by tests
help='start of the integration')
parser.add_argument('-e','--end', type=float, default=None,
module_parser.add_argument('-e','--end', type=float, default=None,

Check warning on line 493 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L493

Added line #L493 was not covered by tests
help='end of the integration')
parser.add_argument('-d','--direction', type=str, choices=['t','p'], default=None,
module_parser.add_argument('-d','--direction', type=str, choices=['t','p'], default=None,

Check warning on line 495 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L495

Added line #L495 was not covered by tests
help='direction of the integration, along T or P')
parser.add_argument('-i','--initial-value', type=float, default=None,
module_parser.add_argument('-i','--initial-value', type=float, default=None,

Check warning on line 497 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L497

Added line #L497 was not covered by tests
help='the initial value of T (direction=p) or P (direction=t)')
parser.add_argument('-s','--step-value', type=float, nargs = '+',
module_parser.add_argument('-s','--step-value', type=float, nargs = '+',

Check warning on line 499 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L499

Added line #L499 was not covered by tests
help='the T (direction=t) or P (direction=p) values must be evaluated')
parser.add_argument('-a','--abs-tol', type=float, default = 10,
module_parser.add_argument('-a','--abs-tol', type=float, default = 10,

Check warning on line 501 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L501

Added line #L501 was not covered by tests
help='the absolute tolerance of the integration')
parser.add_argument('-r','--rel-tol', type=float, default = 1e-2,
module_parser.add_argument('-r','--rel-tol', type=float, default = 1e-2,

Check warning on line 503 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L503

Added line #L503 was not covered by tests
help='the relative tolerance of the integration')
parser.add_argument('-w','--if-water', action = 'store_true',
module_parser.add_argument('-w','--if-water', action = 'store_true',

Check warning on line 505 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L505

Added line #L505 was not covered by tests
help='assumes water molecules: nmols = natoms//3')
parser.add_argument('-o','--output', type=str, default = 'new_job',
module_parser.add_argument('-o','--output', type=str, default = 'new_job',

Check warning on line 507 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L507

Added line #L507 was not covered by tests
help='the output folder for the job')
parser.add_argument('-f','--first-step', type=float, default=None,
module_parser.add_argument('-f','--first-step', type=float, default=None,

Check warning on line 509 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L509

Added line #L509 was not covered by tests
help='the first step size of the integrator')
parser.add_argument('-S','--shift', type=float, nargs = 2, default = [0.0, 0.0],
module_parser.add_argument('-S','--shift', type=float, nargs = 2, default = [0.0, 0.0],

Check warning on line 511 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L511

Added line #L511 was not covered by tests
help='the output folder for the job')
parser.add_argument('-v','--verbose', action = 'store_true',
module_parser.add_argument('-v','--verbose', action = 'store_true',

Check warning on line 513 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L513

Added line #L513 was not covered by tests
help='print detailed infomation')
parser.add_argument("-z", "--if-meam", help="whether use meam instead of dp", action="store_true")
args = parser.parse_args()
module_parser.add_argument("-z", "--if-meam", help="whether use meam instead of dp", action="store_true")
module_parser.set_defaults(func=handle_gdi)

Check warning on line 516 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L515-L516

Added lines #L515 - L516 were not covered by tests



# mdata = json.load(open('machine.json'))
# jdata = json.load(open('in.json'))
# # ssh_sess = SSHSession(mdata['machine'])
# # if not os.path.isdir('gdi_test') :
# # _setup_dpdt('gdi_test', jdata)
# # make_dpdt(100, 1, 'gdi_test', mdata, ssh_sess, natoms = [96, 128])
# # make_dpdt(100, 20, 'gdi_test', mdata, ssh_sess, natoms = [96, 128])

# gdf = GibbsDuhemFunc(jdata, mdata, 'gdi_test', 'p', natoms = [96, 128], verbose = True)

# sol = solve_ivp(gdf, [1, 20000], [363], method = 'RK23', atol=10, rtol=1e-2)
# print(sol.t)
# print(sol.y)
# np.savetxt('t.out', sol.t)
# np.savetxt('p.out', sol.y)
# # print(gdf(100, 1))
# # print(gdf(100, 1))
# # print(gdf(200, 20))
def handle_gdi(args):
with open(args.PARAM) as j:
jdata = json.load(j)
with open(args.MACHINE) as m:
@@ -545,26 +567,4 @@
# abs_tol=args.abs_tol, rel_tol=args.rel_tol, if_water=args.if_water, output=args.output,
# first_step=args.first_step, shift=args.shift, verbose=args.verbose, if_meam=args.if_meam, workflow=None)

return return_value

if __name__ == '__main__' :
_main()

# mdata = json.load(open('machine.json'))
# jdata = json.load(open('in.json'))
# # ssh_sess = SSHSession(mdata['machine'])
# # if not os.path.isdir('gdi_test') :
# # _setup_dpdt('gdi_test', jdata)
# # make_dpdt(100, 1, 'gdi_test', mdata, ssh_sess, natoms = [96, 128])
# # make_dpdt(100, 20, 'gdi_test', mdata, ssh_sess, natoms = [96, 128])

# gdf = GibbsDuhemFunc(jdata, mdata, 'gdi_test', 'p', natoms = [96, 128], verbose = True)

# sol = solve_ivp(gdf, [1, 20000], [363], method = 'RK23', atol=10, rtol=1e-2)
# print(sol.t)
# print(sol.y)
# np.savetxt('t.out', sol.t)
# np.savetxt('p.out', sol.y)
# # print(gdf(100, 1))
# # print(gdf(100, 1))
# # print(gdf(200, 20))
return return_value

Check warning on line 570 in dpti/gdi.py

Codecov / codecov/patch

dpti/gdi.py#L570

Added line #L570 was not covered by tests
60 changes: 27 additions & 33 deletions dpti/hti.py
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@
ret += 'thermo_style custom step ke pe etotal enthalpy temp press vol c_e_deep c_e_deep c_allmsd[*]\n'
ret += 'thermo_modify format 9 %.16e\n'
ret += 'thermo_modify format 10 %.16e\n'
ret += '# dump 1 all custom ${DUMP_FREQ} dump.hti id type x y z vx vy vz\n'
ret += 'dump 1 all custom ${DUMP_FREQ} dump.hti id type x y z vx vy vz\n'
if ens == 'nvt' :
ret += 'fix 1 all nvt temp ${TEMP} ${TEMP} ${TAU_T}\n'
elif ens == 'nvt-langevin' :
@@ -1187,12 +1187,11 @@

return if_phase_trans

def _main ():
parser = argparse.ArgumentParser(
description="Compute free energy by Hamiltonian TI")
subparsers = parser.add_subparsers(title='Valid subcommands', dest='command')
def add_module_subparsers(main_subparsers):
module_parser = main_subparsers.add_parser('hti', help='Hamiltonian thermodynamic integration for atomic solid')
module_subparsers = module_parser.add_subparsers(help='commands of Hamiltonian thermodynamic integration for atomic solid', dest='command', required=True)

Check warning on line 1192 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1191-L1192

Added lines #L1191 - L1192 were not covered by tests

parser_gen = subparsers.add_parser('gen', help='Generate a job')
parser_gen = module_subparsers.add_parser('gen', help='generate a job')

Check warning on line 1194 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1194

Added line #L1194 was not covered by tests
parser_gen.add_argument('PARAM', type=str ,
help='json parameter file')
parser_gen.add_argument('-o','--output', type=str, default = 'new_job',
@@ -1203,40 +1202,35 @@
two-step: 1 switching on DP, 2 switching off spring.\
three-step: 1 switching on soft LJ, 2 switching on DP, 3 switching off spring and soft LJ.')
parser_gen.add_argument("-z", "--meam", help="whether use meam instead of dp", action="store_true")
parser_gen.set_defaults(func=handle_gen)

Check warning on line 1205 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1205

Added line #L1205 was not covered by tests

parser_comp = subparsers.add_parser('compute', help= 'Compute the result of a job')
parser_comp.add_argument('JOB', type=str ,
parser_compute = module_subparsers.add_parser('compute', help= 'Compute the result of a job')
parser_compute.add_argument('JOB', type=str ,

Check warning on line 1208 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1207-L1208

Added lines #L1207 - L1208 were not covered by tests
help='folder of the job')
parser_comp.add_argument('-t','--type', type=str, default = 'helmholtz',
parser_compute.add_argument('-t','--type', type=str, default = 'helmholtz',

Check warning on line 1210 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1210

Added line #L1210 was not covered by tests
choices=['helmholtz', 'gibbs'],
help='the type of free energy')
parser_comp.add_argument('-m','--inte-method', type=str, default = 'inte',
parser_compute.add_argument('-m','--inte-method', type=str, default = 'inte',

Check warning on line 1213 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1213

Added line #L1213 was not covered by tests
choices=['inte', 'mbar'],
help='the method of thermodynamic integration')
parser_comp.add_argument('-s','--scheme', type=str, default = 'simpson',
parser_compute.add_argument('-s','--scheme', type=str, default = 'simpson',

Check warning on line 1216 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1216

Added line #L1216 was not covered by tests
help='the numeric integration scheme')
parser_comp.add_argument('-g', '--pv', type=float, default = None,
parser_compute.add_argument('-g', '--pv', type=float, default = None,

Check warning on line 1218 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1218

Added line #L1218 was not covered by tests
help='press*vol value override to calculate Gibbs free energy')
parser_comp.add_argument('-G', '--pv-err', type=float, default = None,
parser_compute.add_argument('-G', '--pv-err', type=float, default = None,

Check warning on line 1220 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1220

Added line #L1220 was not covered by tests
help='press*vol error')
args = parser.parse_args()

if args.command is None :
parser.print_help()
exit
if args.command == 'gen' :
output = args.output
jdata = json.load(open(args.PARAM, 'r'))
if 'crystal' in jdata and jdata['crystal'] == 'frenkel' :
print('# gen task with Frenkel\'s Einstein crystal')
else :
print('# gen task with Vega\'s Einstein molecule')
print('output:', output)
make_tasks(output, jdata, ref='einstein', switch=args.switch, if_meam=args.meam)
elif args.command == 'compute' :
compute_task(job=args.JOB, free_energy_type=args.type, method=args.inte_method, scheme=args.scheme, manual_pv=args.pv, manual_pv_err=args.pv_err)
# if 'reference' not in jdata :
# jdata['reference'] = 'einstein'
parser_compute.set_defaults(func=handle_compute)

Check warning on line 1222 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1222

Added line #L1222 was not covered by tests

if __name__ == '__main__' :
_main()
def handle_gen(args):
jdata = json.load(open(args.PARAM, 'r'))
if 'crystal' in jdata and jdata['crystal'] == 'frenkel' :
print('# gen task with Frenkel\'s Einstein crystal')

Check warning on line 1227 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1225-L1227

Added lines #L1225 - L1227 were not covered by tests
else :
print('# gen task with Vega\'s Einstein molecule')
print('output:', args.output)
make_tasks(args.output, jdata, ref='einstein', switch=args.switch, if_meam=args.meam)

Check warning on line 1231 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1229-L1231

Added lines #L1229 - L1231 were not covered by tests

def handle_compute(args):
compute_task(job=args.JOB, free_energy_type=args.type, method=args.inte_method, scheme=args.scheme, manual_pv=args.pv, manual_pv_err=args.pv_err)

Check warning on line 1234 in dpti/hti.py

Codecov / codecov/patch

dpti/hti.py#L1234

Added line #L1234 was not covered by tests
# if 'reference' not in jdata :
# jdata['reference'] = 'einstein'
Loading