# colour.continuous.AbstractContinuousFunction¶

class colour.continuous.AbstractContinuousFunction(name=None)[source]

Defines the base class for abstract continuous function.

This is an ABCMeta abstract class that must be inherited by sub-classes.

The sub-classes are expected to implement the colour.continuous.AbstractContinuousFunction.function() method so that evaluating the function for any independent domain $$x \in\mathbb{R}$$ variable returns a corresponding range $$y \in\mathbb{R}$$ variable. A conventional implementation adopts an interpolating function encapsulated inside an extrapolating function. The resulting function independent domain, stored as discrete values in the colour.continuous.AbstractContinuousFunction.domain attribute corresponds with the function dependent and already known range stored in the colour.continuous.AbstractContinuousFunction.range attribute.

Parameters: name (unicode, optional) – Continuous function name.
name
domain
range
interpolator
interpolator_args
extrapolator
extrapolator_args
function
__str__()[source]
__repr__()[source]
__hash__()[source]
__getitem__()[source]
__setitem__()[source]
__contains__()[source]
__len__()[source]
__eq__()[source]
__ne__()[source]
__isub__()[source]
__sub__()[source]
__imul__()[source]
__mul__()[source]
__idiv__()[source]
__div__()[source]
__ipow__()[source]
__pow__()[source]
arithmetical_operation()[source]
fill_nan()[source]
domain_distance()[source]
is_uniform()[source]
copy()[source]
__init__(name=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

 __init__([name]) Initialize self. arithmetical_operation(a, operation[, in_place]) Performs given arithmetical operation with $$a$$ operand, the operation can be either performed on a copy or in-place, must be reimplemented by sub-classes. copy() Returns a copy of the sub-class instance. domain_distance(a) Returns the euclidean distance between given array and independent domain $$x$$ closest element. fill_nan([method, default]) Fill NaNs in independent domain $$x$$ variable and corresponding range $$y$$ variable using given method, must be reimplemented by sub-classes. is_uniform() Returns if independent domain $$x$$ variable is uniform.

Attributes

 domain Getter and setter property for the abstract continuous function independent domain $$x$$ variable, must be reimplemented by sub-classes. extrapolator Getter and setter property for the abstract continuous function extrapolator type, must be reimplemented by sub-classes. extrapolator_args Getter and setter property for the abstract continuous function extrapolator instantiation time arguments, must be reimplemented by sub-classes. function Getter and setter property for the abstract continuous function callable, must be reimplemented by sub-classes. interpolator Getter and setter property for the abstract continuous function interpolator type, must be reimplemented by sub-classes. interpolator_args Getter and setter property for the abstract continuous function interpolator instantiation time arguments, must be reimplemented by sub-classes. name Getter and setter property for the abstract continuous function name. range Getter and setter property for the abstract continuous function corresponding range $$y$$ variable, must be reimplemented by sub-classes.