lux.executor package

Submodules

lux.executor.Executor module

class lux.executor.Executor.Executor[source]

Bases: object

Abstract class for the execution engine that fetches data for a given vis on a LuxDataFrame

static compute_data_model(self)[source]
static compute_data_type(self)[source]
static compute_stats(self)[source]
static execute(vis_collection: lux.vis.VisList.VisList, ldf)[source]
static execute_aggregate(vis, ldf)[source]
static execute_binning(vis, ldf)[source]
static execute_filter(vis, ldf)[source]
mapping(rmap)[source]
reverseMapping(map)[source]

lux.executor.PandasExecutor module

class lux.executor.PandasExecutor.PandasExecutor[source]

Bases: lux.executor.Executor.Executor

Given a Vis objects with complete specifications, fetch and process data using Pandas dataframe operations.

static apply_filter(df: lux.core.frame.LuxDataFrame, attribute: str, op: str, val: object) → lux.core.frame.LuxDataFrame[source]

Helper function for applying filter to a dataframe

Parameters:
  • df (pandas.DataFrame) – Dataframe to filter on
  • attribute (str) – Filter attribute
  • op (str) – Filter operation, ‘=’, ‘<’, ‘>’, ‘<=’, ‘>=’, ‘!=’
  • val (object) – Filter value
Returns:

df – Dataframe resulting from the filter operation

Return type:

pandas.DataFrame

compute_data_model(ldf: lux.core.frame.LuxDataFrame)[source]
compute_data_type(ldf: lux.core.frame.LuxDataFrame)[source]
compute_dataset_metadata(ldf: lux.core.frame.LuxDataFrame)[source]
compute_stats(ldf: lux.core.frame.LuxDataFrame)[source]
static execute(vislist: lux.vis.VisList.VisList, ldf: lux.core.frame.LuxDataFrame)[source]

Given a VisList, fetch the data required to render the vis. 1) Apply filters 2) Retrieve relevant attribute 3) Perform vis-related processing (aggregation, binning) 4) return a DataFrame with relevant results

Parameters:
  • vislist (list[lux.Vis]) – vis list that contains lux.Vis objects for visualization.
  • ldf (lux.core.frame) – LuxDataFrame with specified intent.
Returns:

Return type:

None

static execute_2D_binning(vis: lux.vis.Vis.Vis)[source]
static execute_aggregate(vis: lux.vis.Vis.Vis, isFiltered=True)[source]

Aggregate data points on an axis for bar or line charts

Parameters:
  • vis (lux.Vis) – lux.Vis object that represents a visualization
  • ldf (lux.core.frame) – LuxDataFrame with specified intent.
Returns:

Return type:

None

static execute_binning(vis: lux.vis.Vis.Vis)[source]

Binning of data points for generating histograms

Parameters:
  • vis (lux.Vis) – lux.Vis object that represents a visualization
  • ldf (lux.core.frame) – LuxDataFrame with specified intent.
Returns:

Return type:

None

static execute_filter(vis: lux.vis.Vis.Vis)[source]
static execute_sampling(ldf: lux.core.frame.LuxDataFrame)[source]
mapping(rmap)
reverseMapping(map)

lux.executor.SQLExecutor module

class lux.executor.SQLExecutor.SQLExecutor[source]

Bases: lux.executor.Executor.Executor

Given a Vis objects with complete specifications, fetch and process data using SQL operations.

static compute_data_model(self)
static compute_data_type(self)
static compute_stats(self)
static execute(vislist: lux.vis.VisList.VisList, ldf: lux.core.frame.LuxDataFrame)[source]
static execute_aggregate(vis: lux.vis.Vis.Vis, ldf: lux.core.frame.LuxDataFrame)[source]
static execute_binning(vis: lux.vis.Vis.Vis, ldf: lux.core.frame.LuxDataFrame)[source]
static execute_filter(vis: lux.vis.Vis.Vis)[source]
mapping(rmap)
reverseMapping(map)

Module contents