Skip to content

Commit 6da0231

Browse files
[pre-commit.ci] auto fixes from pre-commit hooks
1 parent 3280325 commit 6da0231

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

tests/test_reflectionprofile.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def setUp(self):
3838
self.profile = self.ppd.GetProfile()
3939

4040
def test_get_computed_profile(self):
41-
"""Sample a profile slice and verify broadening lowers the peak height."""
41+
"""Sample a profile slice and verify broadening lowers the peak
42+
height."""
4243
x = self.pp.GetPowderPatternX()
4344
hkl = (1, 0, 0)
4445
window = x[100:200]
@@ -58,7 +59,9 @@ def test_get_computed_profile(self):
5859

5960
def test_get_profile_width(self):
6061
"""Ensure full-width increases when W increases."""
61-
xcenter = float(self.pp.GetPowderPatternX()[len(self.pp.GetPowderPatternX()) // 4])
62+
xcenter = float(
63+
self.pp.GetPowderPatternX()[len(self.pp.GetPowderPatternX()) // 4]
64+
)
6265
width_default = self.profile.GetFullProfileWidth(0.5, xcenter, 1, 0, 0)
6366
self.assertGreater(width_default, 0)
6467

@@ -67,7 +70,8 @@ def test_get_profile_width(self):
6770
self.assertGreater(width_broader, width_default)
6871

6972
def test_create_copy(self):
70-
"""Ensure copy returns an independent profile with identical initial params."""
73+
"""Ensure copy returns an independent profile with identical
74+
initial params."""
7175
copy = self.profile.CreateCopy()
7276

7377
self.assertIsNot(copy, self.profile)
@@ -80,22 +84,32 @@ def test_create_copy(self):
8084
self.profile.GetPar("Eta0").SetValue(eta0_original + 0.1)
8185
copy.GetPar("Eta0").SetValue(eta0_copy + 0.2)
8286

83-
self.assertAlmostEqual(copy.GetPar("Eta0").GetValue(), eta0_original + 0.2)
84-
self.assertAlmostEqual(self.profile.GetPar("Eta0").GetValue(), eta0_original + 0.1)
87+
self.assertAlmostEqual(
88+
copy.GetPar("Eta0").GetValue(), eta0_original + 0.2
89+
)
90+
self.assertAlmostEqual(
91+
self.profile.GetPar("Eta0").GetValue(), eta0_original + 0.1
92+
)
8593

8694
def test_xml_input(self):
87-
"""Ensure XMLInput restores parameters previously serialized with xml()."""
95+
"""Ensure XMLInput restores parameters previously serialized
96+
with xml()."""
8897
xml_state = self.profile.xml()
8998
eta0_original = self.profile.GetPar("Eta0").GetValue()
9099

91100
self.profile.GetPar("Eta0").SetValue(eta0_original + 0.3)
92-
self.assertNotAlmostEqual(self.profile.GetPar("Eta0").GetValue(), eta0_original)
101+
self.assertNotAlmostEqual(
102+
self.profile.GetPar("Eta0").GetValue(), eta0_original
103+
)
93104

94105
RefinableObj.XMLInput(self.profile, xml_state)
95-
self.assertAlmostEqual(self.profile.GetPar("Eta0").GetValue(), eta0_original)
106+
self.assertAlmostEqual(
107+
self.profile.GetPar("Eta0").GetValue(), eta0_original
108+
)
96109

97110
def test_xml_output(self):
98-
"""Ensure XMLOutput emits parameter tags and the expected root element."""
111+
"""Ensure XMLOutput emits parameter tags and the expected root
112+
element."""
99113
xml_state = self.profile.xml()
100114

101115
self.assertIn("<ReflectionProfile", xml_state)

0 commit comments

Comments
 (0)