5. Derivative specification¶
- class lsqfitgp.Deriv(int)[source]¶
Class for specifying derivatives. Behaves like a dictionary str -> int, where the keys represent variables and values the derivation order. An empty Deriv means no derivatives. A Deriv with one single key None means that the variable is implicit.
Deriv(str) -> first derivative w.r.t. specified variable
Deriv(iter of str) -> derivative w.r.t. specified variables
Deriv(iter of int, str) -> an int before a str acts as a multiplier
Deriv(Deriv) -> pass through
Deriv(None) -> Deriv(0)
Example: Deriv([‘a’, ‘b’, ‘b’, ‘c’]) is equivalent to Deriv([‘a’, 2, ‘b’, ‘c’]).
- Raises:
- TypeError
If
*argsis not of the specified form.- ValueError
If
*argsends with an integer or if there are consecutive integers.
- Attributes:
implicitTrue if the derivative is trivial or the variable is implicit.
orderThe total derivation order, i.e., the sum of the values.
maxThe maximum derivation order for any single variable.