ddg.abc module
- class ddg.abc.Transformable[source]
Bases:
objectMakes a class transformable by keeping a stack of transformations.
It is assumed that the transformations are functions. If a matrix is passed to push_transformation, it will be converted to a function.
- push_transformation(f)[source]
Add a transformation to the trafo-stack.
- Parameters:
- fnumpy.ndarray or function
- transform(f)[source]
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- class ddg.abc.LinearTransformable(trafo_dimension)[source]
Bases:
TransformableMakes a class transformable by keeping a stack of transformations.
It is assumed that the transformations are matrices.
- Attributes:
- trafo_dimensionint
An empty transformation stack returns np.eye(_trafo_dimension).
- property transformation
Product of all matrices on the stack.
- Returns:
- numpy.ndarray
- pop_transformation()
Pop transformation from the trafo-stack.
- Returns:
- function
- transform(f)
Wrapper for
push_transformation.See also
- class ddg.abc.NonExact(atol=None, rtol=None)[source]
Bases:
objectAdds tolerance attributes to a class.
- Parameters:
- atolfloat (default=None)
Absolute tolerance
- rtolfloat (default=None)
Relative tolerance
- property atol
- property rtol
- ddg.abc.get_tol_defaults()[source]
Get current global tolerance defaults.
- Returns:
- dict {‘atol’: float, ‘rtol’: float}
Notes
The defaults are stored in the class attributes ddg.abc.NonExact.atol_default and ddg.abc.NonExact.rtol_default. This function is just meant to be elevated to a higher level of the library to make them more accessible.
- ddg.abc.set_tol_defaults(atol=None, rtol=None)[source]
Set global tolerance defaults.
- Parameters:
- atolfloat (default=None)
- rtolfloat (default=None)
Notes
The defaults are stored in the class attributes ddg.abc.NonExact.atol_default and ddg.abc.NonExact.rtol_default. This function is just meant to be elevated to a higher level of the library to make them more accessible.
- ddg.abc.reset_tol_defaults()[source]
Reset global tolerance defaults to their original values.
Notes
The defaults are stored in the class attributes ddg.abc.NonExact.atol_default and ddg.abc.NonExact.rtol_default. This function is just meant to be elevated to a higher level of the library to make them more accessible.