def test_inputless_model():
 class TestModel(Model, ):
  inputs = ()
  outputs = (u'y',)
  a = Parameter()
  @staticmethod
  def evaluate(a):
   return a
 m = TestModel(1)
 assert (m.a == 1)
 assert (m() == 1)
 m = TestModel([1, 2, 3], model_set_axis=False)
 assert (len(m) == 1)
 assert np.all((m() == [1, 2, 3]))
 m = TestModel(a=[1, 2, 3], model_set_axis=0)
 assert (len(m) == 3)
 assert np.all((m() == [1, 2, 3]))
 m = TestModel(a=[[1, 2, 3], [4, 5, 6]], model_set_axis=0)
 assert (len(m) == 2)
 assert np.all((m() == [[1, 2, 3], [4, 5, 6]]))

def test_inputless_model ( ) : class TestModel ( Model , ) : inputs = ( ) outputs = ( u'y' , ) a = Parameter ( ) @ staticmethod def evaluate ( a ) : return a m = TestModel ( 1 ) assert ( m . a == 1 ) assert ( m ( ) == 1 ) m = TestModel ( [ 1 , 2 , 3 ] , model_set_axis = False ) assert ( len ( m ) == 1 ) assert np . all ( ( m ( ) == [ 1 , 2 , 3 ] ) ) m = TestModel ( a = [ 1 , 2 , 3 ] , model_set_axis = 0 ) assert ( len ( m ) == 3 ) assert np . all ( ( m ( ) == [ 1 , 2 , 3 ] ) ) m = TestModel ( a = [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] ] , model_set_axis = 0 ) assert ( len ( m ) == 2 ) assert np . all ( ( m ( ) == [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] ] ) )
regression test for URL#issuecomment-101821641 .