def test_RedshiftScaleFactor():
 m = models.RedshiftScaleFactor(0.4)
 assert (m(0) == 0)
 assert_array_equal(m([1, 2]), [1.4, 2.8])
 assert_allclose(m.inverse(m([1, 2])), [1, 2])
 m = models.RedshiftScaleFactor([(-0.5), 0, 0.5], n_models=3)
 assert_array_equal(m(0), 0)
 assert_array_equal(m([1, 2], model_set_axis=False), [[0.5, 1], [1, 2], [1.5, 3]])
 assert_allclose(m.inverse(m([1, 2], model_set_axis=False)), [[1, 2], [1, 2], [1, 2]])

def test_RedshiftScaleFactor ( ) : m = models . RedshiftScaleFactor ( 0.4 ) assert ( m ( 0 ) == 0 ) assert_array_equal ( m ( [ 1 , 2 ] ) , [ 1.4 , 2.8 ] ) assert_allclose ( m . inverse ( m ( [ 1 , 2 ] ) ) , [ 1 , 2 ] ) m = models . RedshiftScaleFactor ( [ ( - 0.5 ) , 0 , 0.5 ] , n_models = 3 ) assert_array_equal ( m ( 0 ) , 0 ) assert_array_equal ( m ( [ 1 , 2 ] , model_set_axis = False ) , [ [ 0.5 , 1 ] , [ 1 , 2 ] , [ 1.5 , 3 ] ] ) assert_allclose ( m . inverse ( m ( [ 1 , 2 ] , model_set_axis = False ) ) , [ [ 1 , 2 ] , [ 1 , 2 ] , [ 1 , 2 ] ] )
like test_scalemodel() .