@@ -90,14 +90,17 @@ def test_apply_stretch(inputs, expected):
9090 np .testing .assert_allclose (actual , expected , rtol = 1e-01 )
9191
9292
93- @pytest .mark .parametrize ("inputs, expected" , [
94- ([np .arange (5 ), 2 , 0 , [0 , 1 , 2 , 3 , 4 ], 0.5 ], [0 , 0.5 , 1 , 1.5 , 2 ]),
95- ([np .arange (5 ), 20 , 2 , [0 , - 1 , - 2 , - 3 , - 4 ], 0.25 ], [0 , - 0.25 , - 0.5 , - 0.75 , - 1 ]),
96- ([np .arange (40 ), 200 , 4 , np .arange (0 , 10 , 0.25 ), 0.3 ], np .arange (0 , 10 , 0.25 ) * 0.3 ),
97- ([np .arange (1 ), 10 , 2 , [10.5 , 11.5 , - 10.5 ], 0 ], [0 , 0 , 0 ]),
98- ([[- 12 , - 10 , - 15 ], 5 , 2 , [- 0.5 , - 1 , - 1.2 ], 0.9 ], [- 0.45 , - 0.9 , - 1.08 ]),
99- ([[- 12 , - 10 , - 15 ], 5 , 2 , [0 , 0 , 0 ], 0.9 ], [0 , 0 , 0 ]),
100- ])
93+ @pytest .mark .parametrize (
94+ "inputs, expected" ,
95+ [
96+ ([np .arange (5 ), 2 , 0 , [0 , 1 , 2 , 3 , 4 ], 0.5 ], [0 , 0.5 , 1 , 1.5 , 2 ]),
97+ ([np .arange (5 ), 20 , 2 , [0 , - 1 , - 2 , - 3 , - 4 ], 0.25 ], [0 , - 0.25 , - 0.5 , - 0.75 , - 1 ]),
98+ ([np .arange (40 ), 200 , 4 , np .arange (0 , 10 , 0.25 ), 0.3 ], np .arange (0 , 10 , 0.25 ) * 0.3 ),
99+ ([np .arange (1 ), 10 , 2 , [10.5 , 11.5 , - 10.5 ], 0 ], [0 , 0 , 0 ]),
100+ ([[- 12 , - 10 , - 15 ], 5 , 2 , [- 0.5 , - 1 , - 1.2 ], 0.9 ], [- 0.45 , - 0.9 , - 1.08 ]),
101+ ([[- 12 , - 10 , - 15 ], 5 , 2 , [0 , 0 , 0 ], 0.9 ], [0 , 0 , 0 ]),
102+ ],
103+ )
101104def test_apply_weight (inputs , expected ):
102105 component = ComponentSignal (inputs [0 ], inputs [1 ], inputs [2 ])
103106 component .iq = np .array (inputs [3 ])
0 commit comments