Skip to content

Commit

Permalink
bug in metadynamics parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Jun 7, 2024
1 parent 9681561 commit f1965f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions psiflow/sampling/metadynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def __init__(
_plumed_input = remove_comments_printflush(plumed_input)
assert "METAD" in _plumed_input
if "RESTART" not in _plumed_input:
_plumed_input = "RESTART\n" + _plumed_input
_plumed_input = "\nRESTART\n" + _plumed_input
if "FLUSH" not in _plumed_input: # add at the end!
_plumed_input = _plumed_input + "FLUSH STRIDE=1\nPRINT"
_plumed_input = _plumed_input + "\nFLUSH STRIDE=1\nPRINT"

# PLUMED + WQ cannot deal with nonexisting hills files!
if type(external) in [str, Path]:
Expand Down
1 change: 1 addition & 0 deletions tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ def test_order_parameter(dataset):
state = simulation_output.state.result()
CV = state.order["CV"]
assert state.energy is None
assert np.all(np.isnan(state.per_atom.forces))
assert np.allclose(CV, np.linalg.det(dataset[3].result().cell))

# test batch evaluation of order parameter
Expand Down

0 comments on commit f1965f9

Please sign in to comment.