@@ -209,16 +209,20 @@ def test_stationary_mean(self):
209
209
210
210
# Since the fits use different algorithms and starting points,
211
211
# we should be more lenient with the comparison
212
- # Some datasets may converge to very different solutions due to numerical issues
213
- # Check if the fits look reasonable (not extreme values) before comparing
212
+ # Some datasets may converge to very different solutions due to
213
+ # numerical issues
214
+ # Check if the fits look reasonable (not extreme values) before
215
+ # comparing
214
216
215
- # Skip comparison if either fit resulted in extreme values (likely convergence failure)
217
+ # Skip comparison if either fit resulted in extreme values
218
+ # (likely convergence failure)
216
219
extreme_manual = any (abs (val ) > 1e6 for val in popt )
217
220
extreme_mre = any (abs (val ) > 1e6 for val in res_mre .popt )
218
221
219
222
if extreme_manual or extreme_mre :
220
223
print (
221
- f"Skipping comparison for { name_data } due to extreme parameter values"
224
+ f"Skipping comparison for { name_data } due to "
225
+ "extreme parameter values"
222
226
)
223
227
continue
224
228
@@ -231,15 +235,17 @@ def test_stationary_mean(self):
231
235
# For small values, use absolute difference
232
236
self .assertTrue (
233
237
abs (manual_val - mre_val ) < 1e-2 ,
234
- f"Parameter { i } : { manual_val } vs { mre_val } (absolute diff too large)" ,
238
+ f"Parameter { i } : { manual_val } vs { mre_val } "
239
+ "(absolute diff too large)" ,
235
240
)
236
241
else :
237
242
# For larger values, use relative difference
238
243
self .assertTrue (
239
244
check_similarity (
240
245
manual_val , mre_val , ratio_different = 2e-1
241
246
),
242
- f"Parameter { i } : { manual_val } vs { mre_val } (relative diff too large)" ,
247
+ f"Parameter { i } : { manual_val } vs { mre_val } "
248
+ "(relative diff too large)" ,
243
249
)
244
250
# plt.plot(k_arr, corr_arr)
245
251
# plt.plot(k_arr, fitfunction_complex(k_arr, *popt))
@@ -267,16 +273,20 @@ def test_stationary_mean(self):
267
273
268
274
# Since the fits use different algorithms and starting points,
269
275
# we should be more lenient with the comparison
270
- # Some datasets may converge to very different solutions due to numerical issues
271
- # Check if the fits look reasonable (not extreme values) before comparing
276
+ # Some datasets may converge to very different solutions due to
277
+ # numerical issues
278
+ # Check if the fits look reasonable (not extreme values) before
279
+ # comparing
272
280
273
- # Skip comparison if either fit resulted in extreme values (likely convergence failure)
281
+ # Skip comparison if either fit resulted in extreme values
282
+ # (likely convergence failure)
274
283
extreme_manual = any (abs (val ) > 1e6 for val in popt )
275
284
extreme_mre = any (abs (val ) > 1e6 for val in res_mre .popt )
276
285
277
286
if extreme_manual or extreme_mre :
278
287
print (
279
- f"Skipping comparison for { name_data } due to extreme parameter values"
288
+ f"Skipping comparison for { name_data } due to "
289
+ "extreme parameter values"
280
290
)
281
291
continue
282
292
@@ -289,13 +299,15 @@ def test_stationary_mean(self):
289
299
# For small values, use absolute difference
290
300
self .assertTrue (
291
301
abs (manual_val - mre_val ) < 1e-2 ,
292
- f"Parameter { i } : { manual_val } vs { mre_val } (absolute diff too large)" ,
302
+ f"Parameter { i } : { manual_val } vs { mre_val } "
303
+ "(absolute diff too large)" ,
293
304
)
294
305
else :
295
306
# For larger values, use relative difference
296
307
self .assertTrue (
297
308
check_similarity (
298
309
manual_val , mre_val , ratio_different = 2e-1
299
310
),
300
- f"Parameter { i } : { manual_val } vs { mre_val } (relative diff too large)" ,
311
+ f"Parameter { i } : { manual_val } vs { mre_val } "
312
+ "(relative diff too large)" ,
301
313
)
0 commit comments