def _convert_input(x, y, z=None, n_models=1, model_set_axis=0):
 x = np.asarray(x, dtype=np.float)
 y = np.asarray(y, dtype=np.float)
 if (z is not None):
  z = np.asarray(z, dtype=np.float)
 if (n_models > 1):
  if (z is None):
   if (y.shape[model_set_axis] != n_models):
    raise ValueError(u'Number of data sets (y array is expected to equal the number of parameter sets)')
   y = np.rollaxis(y, model_set_axis, y.ndim)
  else:
   z_shape = (z.shape[:model_set_axis] + z.shape[(model_set_axis + 1):])
   if (not (x.shape == y.shape == z_shape)):
    raise ValueError(u'x, y and z should have the same shape')
 if (z is None):
  farg = (x, y)
 else:
  farg = (x, y, z)
 return farg

def _convert_input ( x , y , z = None , n_models = 1 , model_set_axis = 0 ) : x = np . asarray ( x , dtype = np . float ) y = np . asarray ( y , dtype = np . float ) if ( z is not None ) : z = np . asarray ( z , dtype = np . float ) if ( n_models > 1 ) : if ( z is None ) : if ( y . shape [ model_set_axis ] != n_models ) : raise ValueError ( u'Number of data sets (y array is expected to equal the number of parameter sets)' ) y = np . rollaxis ( y , model_set_axis , y . ndim ) else : z_shape = ( z . shape [ : model_set_axis ] + z . shape [ ( model_set_axis + 1 ) : ] ) if ( not ( x . shape == y . shape == z_shape ) ) : raise ValueError ( u'x, y and z should have the same shape' ) if ( z is None ) : farg = ( x , y ) else : farg = ( x , y , z ) return farg
convert inputs to float arrays .