Skip to content

Commit 3fdc20f

Browse files
pre-commit auto-fixes
1 parent d5f01ee commit 3fdc20f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/pymatgen/analysis/local_env.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4095,12 +4095,12 @@ def _quadrant_integral(dist_bins, idx):
40954095

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

4098-
area1 = areaquarter - 0.5 * (radius**2 * math.acos(
4099-
1 - x1 / radius) - (radius - x1) * math.sqrt(
4100-
2 * radius * x1 - x1**2))
4101-
area2 = areaquarter - 0.5 * (radius**2 * math.acos(
4102-
1 - x2 / radius) - (radius - x2) * math.sqrt(
4103-
2 * radius * x2 - x2**2))
4098+
area1 = areaquarter - 0.5 * (
4099+
radius**2 * math.acos(1 - x1 / radius) - (radius - x1) * math.sqrt(2 * radius * x1 - x1**2)
4100+
)
4101+
area2 = areaquarter - 0.5 * (
4102+
radius**2 * math.acos(1 - x2 / radius) - (radius - x2) * math.sqrt(2 * radius * x2 - x2**2)
4103+
)
41044104

41054105
return (area2 - area1) / areaquarter
41064106

tests/analysis/test_local_env.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,8 @@ def test_all_nn_classes(self):
444444
assert voronoi_nn.get_cn(self.cscl, 0) == 8
445445
assert voronoi_nn.get_cn(self.lifepo4, 0) == 6
446446

447-
assert CrystalNN._quadrant_integral([1,0.36], 0) == approx(
448-
0.7551954297486029)
449-
assert CrystalNN._quadrant_integral([1,0.36,0], 1) == approx(
450-
1 - 0.7551954297486029)
447+
assert CrystalNN._quadrant_integral([1, 0.36], 0) == approx(0.7551954297486029)
448+
assert CrystalNN._quadrant_integral([1, 0.36, 0], 1) == approx(1 - 0.7551954297486029)
451449
crystal_nn = CrystalNN()
452450
assert crystal_nn.get_cn(self.diamond, 0) == 4
453451
assert crystal_nn.get_cn(self.nacl, 0) == 6

0 commit comments

Comments
 (0)