DivisionProcessor¶
- class DivisionProcessor(a, b=None, *, start=None, end=None, dividend=None, **kwargs)[source]¶
Methods
- __init__(a, b=None, *, start=None, end=None, dividend=None, **kwargs)[source]¶
DivisionProcessor divides two series or divides a dividend to a series
- Parameters:
a (
Union
[DataCoordinate
,BaseProcessor
]) – DataCoordinate or BaseProcessor for the first seriesb (
Union
[DataCoordinate
,BaseProcessor
,None
]) – DataCoordinate or BaseProcessor for the second series to multiply to the firststart (
Union
[date
,datetime
,RelativeDate
,None
]) – start date or time used in the underlying data queryend (
Union
[date
,datetime
,RelativeDate
,None
]) – end date or time used in the underlying data querydividend (
Optional
[float
]) – number to divide all values in the series
- as_dict()¶
Create a dictionary representation of the processor. Used for eventually turning the processor into json for API usage. Allows for nested processors. :rtype:
Dict
:return: Dictionary representation of the processor
- build_graph(entity, cell, queries, rdate_entity_map, overrides)¶
Generates the nested cell graph and keeps a map of leaf data queries to processors
- async calculate(attribute, result, rdate_entity_map, pool=None, query_info=None)¶
Sets the result on the processor and recursively calls parent to set and calculate value
- Parameters:
attribute (
str
) – Attribute alinging to data coordinate in the processorresult (
ProcessorResult
) – Processor result including success and series from data query
- classmethod from_dict(obj, reference_list)¶
- get_default_params()¶
- post_process()¶
- async update(attribute, result, rdate_entity_map, pool=None, query_info=None)¶
Handle the update of a single coordinate and recalculate the value
- Parameters:
attribute (
str
) – Attribute alinging to data coordinate in the processorresult (
ProcessorResult
) – Processor result including success and series from data query