@pytest.mark.parametrize(u'model_class', [cls for cls in (list(linear1d) + list(linear2d)) if isinstance(cls, PolynomialBase)])
def test_polynomial_init_with_constraints(model_class):
 if (u'1D' in model_class.__name__):
  param = u'c0'
 else:
  param = u'c0_0'
 if issubclass(model_class, OrthoPolynomialBase):
  degree = (2, 2)
 else:
  degree = (2,)
 m = model_class(fixed={param: True}, *degree)
 assert (m.fixed[param] is True)
 assert (getattr(m, param).fixed is True)

@ pytest . mark . parametrize ( u'model_class' , [ cls for cls in ( list ( linear1d ) + list ( linear2d ) ) if isinstance ( cls , PolynomialBase ) ] ) def test_polynomial_init_with_constraints ( model_class ) : if ( u'1D' in model_class . __name__ ) : param = u'c0' else : param = u'c0_0' if issubclass ( model_class , OrthoPolynomialBase ) : degree = ( 2 , 2 ) else : degree = ( 2 , ) m = model_class ( fixed = { param : True } , * degree ) assert ( m . fixed [ param ] is True ) assert ( getattr ( m , param ) . fixed is True )
test that polynomial models can be instantiated with constraints .