@@ -183,6 +183,7 @@ def test_registerFunction(self):
183
183
self .assertEqual (6 , fc .evaluate ())
184
184
return
185
185
186
+
186
187
def testResidual (noObserversInGlobalBuilders ):
187
188
"""Test the residual, which requires all other methods."""
188
189
gen = ProfileGenerator ("test" )
@@ -244,9 +245,9 @@ def testResidual(noObserversInGlobalBuilders):
244
245
fc .setEquation ("2*I" )
245
246
fc .setResidualEquation ("resv" )
246
247
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
+ )
250
251
251
252
# Make a custom residual.
252
253
fc .setResidualEquation ("abs(eq-y)**0.5" )
@@ -265,6 +266,7 @@ def testResidual(noObserversInGlobalBuilders):
265
266
assert noObserversInGlobalBuilders
266
267
return
267
268
269
+
268
270
def test_setEquation (noObserversInGlobalBuilders ):
269
271
"""Check replacement of removed parameters."""
270
272
fc = FitContribution ("test" )
@@ -278,6 +280,7 @@ def test_setEquation(noObserversInGlobalBuilders):
278
280
assert noObserversInGlobalBuilders
279
281
return
280
282
283
+
281
284
def test_getEquation (noObserversInGlobalBuilders ):
282
285
"""Check getting the current profile simulation formula."""
283
286
fc = FitContribution ("test" )
@@ -288,6 +291,5 @@ def test_getEquation(noObserversInGlobalBuilders):
288
291
return
289
292
290
293
291
-
292
294
if __name__ == "__main__" :
293
295
unittest .main ()
0 commit comments