Package qubx :: Module fit :: Class Curve
[hide private]
[frames] | no frames]

Class Curve

source code

object --+    
         |    
 BaseCurve --+
             |
            Curve
Known Subclasses:

Fittable curve from a parsed Python expression; either simple algebraic, or system of ODEs; see acceptODEs.

Instance Methods [hide private]
 
__init__(self, expr='a * x**k + b', locals=None, allow_params=True, allow_ode=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
eval(self, param_vals, xx, vvv=[])
Returns the numpy.array(dtype='float32', shape=xx.shape) calculated for xx given param_vals and extra named series.
source code
 
pool_eval(self, xx, vvv, func, pval_by_name, avail) source code
 
set_vars(self, var_names)
Tells the name and position of extra data series; if in expr these names will refer to vvv instead of params.
source code
 
setup_f(self)
Parses expr; called automatically when needed.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from BaseCurve: can_fit, can_resample, expr, hi, lo, name, param_defaults, params, pool

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, expr='a * x**k + b', locals=None, allow_params=True, allow_ode=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • expr - either the right-hand-side of "y=whatever*stuff(x)", or a system of ODEs; see acceptODEs
  • allow_params - whether to look for undefined names and add them to self.params
  • allow_ode - whether to allow system of ODEs
Overrides: object.__init__

eval(self, param_vals, xx, vvv=[])

source code 

Returns the numpy.array(dtype='float32', shape=xx.shape) calculated for xx given param_vals and extra named series.

Parameters:
  • param_vals - list of float corresponding to BaseCurve.params
  • xx - numpy.array(dtype='float32') of x coords
  • vvv - list of numpy.array(dtype='float32', shape=xx.shape); extra data series, must have already declared their names using set_vars
Returns:
numpy.array of y values
Overrides: BaseCurve.eval

set_vars(self, var_names)

source code 

Tells the name and position of extra data series; if in expr these names will refer to vvv instead of params.

Parameters:
  • var_names - list of str, one per vvv you will be passing to eval()
Overrides: BaseCurve.set_vars