sideop Package

sideop Package

This module contains the filter and regressor managers used by task to apply the filters and regressors. Both those classes use a side operation manager that implement the generic functions. This allow to apply the filters and regressors as early as possible during the triplet generation to optimise the performances.

filter_manager Module

class ABXpy.sideop.filter_manager.FilterManager(db_hierarchy, on, across, by, filters)[source]

Bases: ABXpy.sideop.side_operations_manager.SideOperationsManager

Manage the filters on attributes (on, across, by) or elements (A, B, X) for further processing

ABX_filter(on_across_by_values, db, triplets)[source]
A_filter(on_across_by_values, db, indices)[source]
B_filter(on_across_by_values, db, indices)[source]
X_filter(on_across_by_values, db, indices)[source]
by_filter(by_values)[source]
classify_generic(elements, db_fun, db_variables)[source]

Detect operations that can be applied directly to the columns of the original database. This is subclass specific…

generic_filter(by_values, db)[source]
on_across_by_filter(on_across_by_values)[source]
ABXpy.sideop.filter_manager.singleton_filter(generator)[source]
ABXpy.sideop.filter_manager.vectorial_filter(generator, indices)[source]

Note

To allow a lazy evaluation of the filter, the context is filtered explicitly which acts on the generator by a side-effect (dict being mutable in python)

regressor_manager Module

class ABXpy.sideop.regressor_manager.RegressorManager(db, db_hierarchy, on, across, by, regressors)[source]

Bases: ABXpy.sideop.side_operations_manager.SideOperationsManager

Manage the regressors on attributes (on, across, by) or elements (A, B, X) for further processing

classify_generic(elements, db_fun, db_variables)[source]

Detect operations that can be applied directly to the columns of the original database. This is subclass specific…

fetch_regressor_info(field, reg_id)[source]
get_regressor_info()[source]
set_ABX_regressors(on_across_by_values, db, triplets)[source]
set_A_regressors(on_across_by_values, db, indices)[source]
set_B_regressors(on_across_by_values, db, indices)[source]
set_X_regressors(on_across_by_values, db, indices)[source]
set_by_regressors(by_values)[source]
set_on_across_by_regressors(on_across_by_values)[source]

side_operations_manager Module

Class providing services for task.py

  • finds out the best point to execute side-operations (such as filtering and regressor generation) in the ABX task computation flow:

    • basically the more related a given side-operation is to the on/across/by structure of the ABX task, the earlier it can be executed and the lowest the computational cost is

  • providing methods to actually carry out these side-operations at the point in the execution flow to which they were attributed

class ABXpy.sideop.side_operations_manager.SideOperationsManager(db_hierarchy, on, across, by)[source]

Bases: object

add(db_fun, name=None)[source]
check_extensions(elements)[source]

Check that something with a AX, AB or 1, 2 extension is an on/across descendant and a correct one for AX, AB.

classify_ABX(elements, db_fun, db_variables)[source]

the only left extensions are either not descendant of on/across/by or descendant of across and _X or descendant of on and _B (i.e. _2) we do not try to batch the _2 because we think they are potentially too small, instead if necessary we should batch several consecutive calls

classify_by(elements, db_fun, db_variables)[source]

Detect operations that depend only on a variable that is used as a ‘by’ factor in the ABX task.

classify_generic(elements, db_fun, db_variables)[source]

Detect operations that can be applied directly to the columns of the original database. This is subclass specific…

classify_on_across_by(elements, db_fun, db_variables)[source]

Detect operations that can be applied at the level of an on/across/by block during the generation of the ABX triplets.

evaluate_A(*args)[source]
evaluate_ABX(on_across_by_values, db, triplets, context=None)[source]
evaluate_A_B_X(name, on_across_by_values, db, indices, context=None)[source]
evaluate_B(*args)[source]
evaluate_X(*args)[source]
evaluate_by(by_values)[source]
evaluate_generic(by_values, db, context=None)[source]
evaluate_on_across_by(on_across_by_values)[source]
parse_extended_column(column)[source]

Get radical and suffix part of a context_variable.

parse_extended_columns(columns)[source]

Get radical and suffix part for every context_variable, returns the set of the encountered couples.

set_ABX_context(context, db, triplets)[source]
set_A_B_X_context(context_field, context, stage, db, indices)[source]
set_by_context(context, stage, by_values)[source]
set_generic_context(context, stage, db)[source]
set_on_across_context(context, stage, on_across_values)[source]
ABXpy.sideop.side_operations_manager.result_generator(db_funs, context)[source]
ABXpy.sideop.side_operations_manager.singleton_result_generator(db_funs, context)[source]