1- import numpy as np
2-
31import sys
42
3+ import numpy as np
4+ import pytest
5+
56from stcal .multiprocessing import compute_num_cores
67from stcal .ramp_fitting .ramp_fit import ramp_fit_data
78from stcal .ramp_fitting .ramp_fit_class import RampData
@@ -439,7 +440,8 @@ def test_miri_ramp_dnu_and_jump_at_ramp_beginning():
439440 assert abs (s2 [0 , 0 ] - answer ) < tol
440441
441442
442- def test_2_group_cases ():
443+ @pytest .mark .parametrize ("algo" , [DEFAULT_OLS , "LIKELY" ])
444+ def test_2_group_cases (algo ):
443445 """
444446 Tests the special cases of 2 group ramps. Create multiple pixel ramps
445447 with two groups to test the various DQ cases.
@@ -494,7 +496,7 @@ def test_2_group_cases():
494496 ramp_data .set_dqflags (dqflags )
495497
496498 # Run ramp fit on RampData
497- save_opt , algo , wt , ncores = True , DEFAULT_OLS , "optimal" , "none"
499+ save_opt , wt , ncores = True , "optimal" , "none"
498500 slopes , cube , optional = ramp_fit_data (
499501 ramp_data , save_opt , rnoise , gain , algo , wt , ncores
500502 )
@@ -519,7 +521,7 @@ def test_2_group_cases():
519521 np .testing .assert_allclose (err , check , tol )
520522
521523
522- def run_one_group_ramp_suppression (nints , suppress ):
524+ def run_one_group_ramp_suppression (nints , suppress , algo = DEFAULT_OLS ):
523525 """
524526 Forms the base of the one group suppression tests. Create three ramps
525527 using three pixels with two integrations. In the first integration:
@@ -568,7 +570,6 @@ def run_one_group_ramp_suppression(nints, suppress):
568570
569571 ramp_data .suppress_one_group_ramps = suppress
570572
571- algo = DEFAULT_OLS
572573 save_opt , ncores = False , "none"
573574 slopes , cube , ols_opt = ramp_fit_data (
574575 ramp_data , save_opt , rnoise2d , gain2d , algo , "optimal" , ncores
@@ -577,11 +578,12 @@ def run_one_group_ramp_suppression(nints, suppress):
577578 return slopes , cube , dims
578579
579580
580- def test_one_group_ramp_suppressed_one_integration ():
581+ @pytest .mark .parametrize ("algo" , [DEFAULT_OLS , "LIKELY" ])
582+ def test_one_group_ramp_suppressed_one_integration (algo ):
581583 """
582584 Tests one group ramp fitting where suppression turned on.
583585 """
584- slopes , cube , dims = run_one_group_ramp_suppression (1 , True )
586+ slopes , cube , dims = run_one_group_ramp_suppression (1 , True , algo = algo )
585587 nints , ngroups , nrows , ncols = dims
586588 tol = 1e-5
587589
0 commit comments