Skip to content

Commit

Permalink
Force linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Nov 24, 2023
1 parent e31f872 commit 87c5e89
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ipi/engine/forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,14 +1120,17 @@ def forcesvirs_4th_order(self, index):
# calculates the finite displacement.
fbase = dstrip(self.f)
eps = self.mforces[index].epsilon
foverm = np.sqrt((fbase / self.beads.m3 * fbase / self.beads.m3).sum() / (self.nbeads * self.natoms))
if np.abs(foverm)>1e-20:
foverm = np.sqrt(
(fbase / self.beads.m3 * fbase / self.beads.m3).sum()
/ (self.nbeads * self.natoms)
)
if np.abs(foverm) > 1e-20:
delta = np.abs(eps) / np.sqrt(
(fbase / self.beads.m3 * fbase / self.beads.m3).sum()
/ (self.nbeads * self.natoms)
)
else: # defaults to eps if otherwise we'd get an 1/0
delta = np.abs(eps)
else: # defaults to eps if otherwise we'd get an 1/0
delta = np.abs(eps)
dq = delta * fbase / self.beads.m3

# stores the force component.
Expand Down

0 comments on commit 87c5e89

Please sign in to comment.