ViewMapper¶
-
class
quantipy.
ViewMapper
(views=None, template=None)¶ Applies View computation results to Links based on the view method’s kwargs, handling the coordination and structuring side of the aggregation process.
-
add_method
(name=None, method=None, kwargs={}, template=None)¶ Add a method to the instance of the ViewMapper.
Parameters: - name (str) – The short name of the View.
- method (view method) – The view method that will be used to derivce the result
- kwargs (dict) – The keyword arguments needed by the view method.
- template (dict) – A ViewMapper template that contains information on view method and kwargs values to iterate over.
Returns: Updates the ViewMapper instance with a new method definiton.
Return type: None
-
make_template
(method, iterators=None)¶ Generate a view method template that cycles through kwargs values.
Parameters: - method ({'frequency', 'descriptives', 'coltests'}) – The baseline view method to be used.
- iterators (dict) – A dictionary mapping of view method kwargs to lists of values.
Returns: Sets the template inside ViewMapper instance.
Return type: None
-
subset
(views, strict_selection=True)¶ Copy ViewMapper instance retaining only the View names provided.
Parameters: - views (list of str) – The selection of View names to keep.
- strict_selection (bool, default True) – TODO
Returns: subset
Return type: ViewMapper instance
-