Skip to content

Commit

Permalink
Ti change e0 default value to None (#75)
Browse files Browse the repository at this point in the history
* fix hti's output of Helmholtz free energy for water

* correct error estimation: divide natoms in stead of np.sqrt(natoms)

* Change E0 default value to None and change the warning to valueerror.

---------

Co-authored-by: Yifan Li <[email protected]>
  • Loading branch information
GEODONG and Yi-FanLi authored Aug 6, 2024
1 parent 66b9b3b commit 1183ca8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dpti/ti.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,13 @@ def add_module_subparsers(main_subparsers):
help="the method of thermodynamic integration",
)
parser_compute.add_argument(
"-e", "--Eo", type=float, default=0, help="free energy of starting point"
"-e", "--Eo", type=float, default=None, help="free energy of starting point"
)
parser_compute.add_argument(
"-E",
"--Eo-err",
type=float,
default=0,
default=None,
help="The statistical error of the starting free energy",
)
parser_compute.add_argument(
Expand Down Expand Up @@ -1028,7 +1028,7 @@ def handle_compute(args):
hti_dir = args.hti
jdata_hti = json.load(open(os.path.join(hti_dir, "result.json")))
if args.Eo is not None and args.hti is not None:
raise Warning(
raise ValueError(
"Both Eo and hti are provided. Eo will be overrided by the e1 value in hti's result.json file. Make sure this is what you want."
)
if args.Eo is None:
Expand Down

0 comments on commit 1183ca8

Please sign in to comment.