Skip to content

Commit 760bc0d

Browse files
committed
Merge branch 'pkg_resources' of github.com:sbillinge/diffpy.srfit into pkg_resources
2 parents 8e0376a + c2dc20e commit 760bc0d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/test_characteristicfunctions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import numpy
2020
import pytest
2121

22-
from diffpy.srfit.sas.sasimport import sasimport
2322
import diffpy.srfit.pdf.characteristicfunctions as cf
23+
from diffpy.srfit.sas.sasimport import sasimport
2424

2525
# Global variables to be assigned in setUp
2626
cf = None
@@ -48,6 +48,7 @@ def testSphere(sas_available):
4848
assert res == pytest.approx(0, abs=1e-4)
4949
return
5050

51+
5152
def testSpheroid(sas_available):
5253
if not sas_available:
5354
pytest.skip("sas package not available")
@@ -70,6 +71,7 @@ def testSpheroid(sas_available):
7071
assert res == pytest.approx(0, abs=1e-4)
7172
return
7273

74+
7375
def testShell(sas_available):
7476
if not sas_available:
7577
pytest.skip("sas package not available")
@@ -92,6 +94,7 @@ def testShell(sas_available):
9294
assert res == pytest.approx(0, abs=1e-4)
9395
return
9496

97+
9598
def testCylinder(sas_available):
9699
if not sas_available:
97100
pytest.skip("sas package not available")

tests/test_contribution.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def test_registerFunction(self):
183183
self.assertEqual(6, fc.evaluate())
184184
return
185185

186+
186187
def testResidual(noObserversInGlobalBuilders):
187188
"""Test the residual, which requires all other methods."""
188189
gen = ProfileGenerator("test")
@@ -244,9 +245,9 @@ def testResidual(noObserversInGlobalBuilders):
244245
fc.setEquation("2*I")
245246
fc.setResidualEquation("resv")
246247
chiv = fc.residual()
247-
assert (dot(chiv, chiv) ==
248-
pytest.approx(sum((2 * xobs - yobs) ** 2) / sum(yobs**2)))
249-
248+
assert dot(chiv, chiv) == pytest.approx(
249+
sum((2 * xobs - yobs) ** 2) / sum(yobs**2)
250+
)
250251

251252
# Make a custom residual.
252253
fc.setResidualEquation("abs(eq-y)**0.5")
@@ -265,6 +266,7 @@ def testResidual(noObserversInGlobalBuilders):
265266
assert noObserversInGlobalBuilders
266267
return
267268

269+
268270
def test_setEquation(noObserversInGlobalBuilders):
269271
"""Check replacement of removed parameters."""
270272
fc = FitContribution("test")
@@ -278,6 +280,7 @@ def test_setEquation(noObserversInGlobalBuilders):
278280
assert noObserversInGlobalBuilders
279281
return
280282

283+
281284
def test_getEquation(noObserversInGlobalBuilders):
282285
"""Check getting the current profile simulation formula."""
283286
fc = FitContribution("test")
@@ -288,6 +291,5 @@ def test_getEquation(noObserversInGlobalBuilders):
288291
return
289292

290293

291-
292294
if __name__ == "__main__":
293295
unittest.main()

0 commit comments

Comments
 (0)