Skip to content

Commit

Permalink
Revert "Do not skip first step when logging energy and xyz"
Browse files Browse the repository at this point in the history
This reverts commit 046bfaf.
  • Loading branch information
kzinovjev committed Feb 12, 2025
1 parent fc7ba72 commit 23da2ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions emle/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ def run(self, path=None):
# Log energies to file.
if (
self._energy_frequency > 0
and not self._is_first_step
and self._step % self._energy_frequency == 0
):
with open(self._energy_file, "a+") as f:
Expand Down Expand Up @@ -1067,8 +1068,11 @@ def run(self, path=None):
f.write("\n")

# Increment the step counter.
self._step += 1
_logger.info(f"Step: {self._step}")
if self._is_first_step:
self._is_first_step = False
else:
self._step += 1
_logger.info(f"Step: {self._step}")

def _calculate_energy_and_gradients(
self,
Expand Down

0 comments on commit 23da2ad

Please sign in to comment.