Skip to content

Commit

Permalink
pre-commit auto-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent d5f01ee commit 3fdc20f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/pymatgen/analysis/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4095,12 +4095,12 @@ def _quadrant_integral(dist_bins, idx):

areaquarter = 0.25 * math.pi * radius**2

area1 = areaquarter - 0.5 * (radius**2 * math.acos(
1 - x1 / radius) - (radius - x1) * math.sqrt(
2 * radius * x1 - x1**2))
area2 = areaquarter - 0.5 * (radius**2 * math.acos(
1 - x2 / radius) - (radius - x2) * math.sqrt(
2 * radius * x2 - x2**2))
area1 = areaquarter - 0.5 * (
radius**2 * math.acos(1 - x1 / radius) - (radius - x1) * math.sqrt(2 * radius * x1 - x1**2)
)
area2 = areaquarter - 0.5 * (
radius**2 * math.acos(1 - x2 / radius) - (radius - x2) * math.sqrt(2 * radius * x2 - x2**2)
)

return (area2 - area1) / areaquarter

Expand Down
6 changes: 2 additions & 4 deletions tests/analysis/test_local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,8 @@ def test_all_nn_classes(self):
assert voronoi_nn.get_cn(self.cscl, 0) == 8
assert voronoi_nn.get_cn(self.lifepo4, 0) == 6

assert CrystalNN._quadrant_integral([1,0.36], 0) == approx(
0.7551954297486029)
assert CrystalNN._quadrant_integral([1,0.36,0], 1) == approx(
1 - 0.7551954297486029)
assert CrystalNN._quadrant_integral([1, 0.36], 0) == approx(0.7551954297486029)
assert CrystalNN._quadrant_integral([1, 0.36, 0], 1) == approx(1 - 0.7551954297486029)
crystal_nn = CrystalNN()
assert crystal_nn.get_cn(self.diamond, 0) == 4
assert crystal_nn.get_cn(self.nacl, 0) == 6
Expand Down

0 comments on commit 3fdc20f

Please sign in to comment.