parameters: (self)
docstring: Check the inputs for consistency, but don't bother checking things
          that the builtin function odr will check.
docstring_summary: Check the inputs for consistency, but don't bother checking things
          that the builtin function odr will check.
docstring_tokens: Check the inputs for consistency but don t bother checking things that the builtin function odr will check .
function: def _check(self):
          """ Check the inputs for consistency, but don't bother checking things
          that the builtin function odr will check.
          """
  
          x_s = list(self.data.x.shape)
  
          if isinstance(self.data.y, numpy.ndarray):
              y_s = list(self.data.y.shape)
              if self.model.implicit:
                  raise OdrError("an implicit model cannot use response data")
          else:
              # implicit model with q == self.data.y
              y_s = [self.data.y, x_s[-1]]
              if not self.model.implicit:
                  raise OdrError("an explicit model needs response data")
              self.set_job(fit_type=1)
  
          if x_s[-1] != y_s[-1]:
              raise OdrError("number of observations do not match")
  
          n = x_s[-1]
  
          if len(x_s) == 2:
              m = x_s[0]
          else:
              m = 1
          if len(y_s) == 2:
              q = y_s[0]
          else:
              q = 1
  
          p = len(self.beta0)
  
          # permissible output array shapes
  
          fcn_perms = [(q, n)]
          fjacd_perms = [(q, m, n)]
          fjacb_perms = [(q, p, n)]
  
          if q == 1:
              fcn_perms.append((n,))
              fjacd_perms.append((m, n))
              fjacb_perms.append((p, n))
          if m == 1:
              fjacd_perms.append((q, n))
          if p == 1:
              fjacb_perms.append((q, n))
          if m == q == 1:
              fjacd_perms.append((n,))
          if p == q == 1:
              fjacb_perms.append((n,))
  
          # try evaluating the supplied functions to make sure they provide
          # sensible outputs
  
          arglist = (self.beta0, self.data.x)
          if self.model.extra_args is not None:
              arglist = arglist + self.model.extra_args
          res = self.model.fcn(*arglist)
  
          if res.shape not in fcn_perms:
              print(res.shape)
              print(fcn_perms)
              raise OdrError("fcn does not output %s-shaped array" % y_s)
  
          if self.model.fjacd is not None:
              res = self.model.fjacd(*arglist)
              if res.shape not in fjacd_perms:
                  raise OdrError(
                      "fjacd does not output %s-shaped array" % repr((q, m, n)))
          if self.model.fjacb is not None:
              res = self.model.fjacb(*arglist)
              if res.shape not in fjacb_perms:
                  raise OdrError(
                      "fjacb does not output %s-shaped array" % repr((q, p, n)))
  
          # check shape of delta0
  
          if self.delta0 is not None and self.delta0.shape != self.data.x.shape:
              raise OdrError(
                  "delta0 is not a %s-shaped array" % repr(self.data.x.shape))
  
          if self.data.x.size == 0:
              warn(("Empty data detected for ODR instance. "
                    "Do not expect any fitting to occur"),
                   OdrWarning)
function_tokens: def _check ( self ) : x_s = list ( self . data . x . shape ) if isinstance ( self . data . y , numpy . ndarray ) : y_s = list ( self . data . y . shape ) if self . model . implicit : raise OdrError ( "an implicit model cannot use response data" ) else : # implicit model with q == self.data.y y_s = [ self . data . y , x_s [ - 1 ] ] if not self . model . implicit : raise OdrError ( "an explicit model needs response data" ) self . set_job ( fit_type = 1 ) if x_s [ - 1 ] != y_s [ - 1 ] : raise OdrError ( "number of observations do not match" ) n = x_s [ - 1 ] if len ( x_s ) == 2 : m = x_s [ 0 ] else : m = 1 if len ( y_s ) == 2 : q = y_s [ 0 ] else : q = 1 p = len ( self . beta0 ) # permissible output array shapes fcn_perms = [ ( q , n ) ] fjacd_perms = [ ( q , m , n ) ] fjacb_perms = [ ( q , p , n ) ] if q == 1 : fcn_perms . append ( ( n , ) ) fjacd_perms . append ( ( m , n ) ) fjacb_perms . append ( ( p , n ) ) if m == 1 : fjacd_perms . append ( ( q , n ) ) if p == 1 : fjacb_perms . append ( ( q , n ) ) if m == q == 1 : fjacd_perms . append ( ( n , ) ) if p == q == 1 : fjacb_perms . append ( ( n , ) ) # try evaluating the supplied functions to make sure they provide # sensible outputs arglist = ( self . beta0 , self . data . x ) if self . model . extra_args is not None : arglist = arglist + self . model . extra_args res = self . model . fcn ( * arglist ) if res . shape not in fcn_perms : print ( res . shape ) print ( fcn_perms ) raise OdrError ( "fcn does not output %s-shaped array" % y_s ) if self . model . fjacd is not None : res = self . model . fjacd ( * arglist ) if res . shape not in fjacd_perms : raise OdrError ( "fjacd does not output %s-shaped array" % repr ( ( q , m , n ) ) ) if self . model . fjacb is not None : res = self . model . fjacb ( * arglist ) if res . shape not in fjacb_perms : raise OdrError ( "fjacb does not output %s-shaped array" % repr ( ( q , p , n ) ) ) # check shape of delta0 if self . delta0 is not None and self . delta0 . shape != self . data . x . shape : raise OdrError ( "delta0 is not a %s-shaped array" % repr ( self . data . x . shape ) ) if self . data . x . size == 0 : warn ( ( "Empty data detected for ODR instance. " "Do not expect any fitting to occur" ) , OdrWarning )