mlair.plotting.tracker_plot

Module Contents

Classes

TrackObject

A TrackObject can be used to create simple chains of objects.

TrackChain

TrackPlot

class mlair.plotting.tracker_plot.TrackObject(name: Union[List[str], str], stage: str)

A TrackObject can be used to create simple chains of objects.

Parameters
  • name – string or list of strings with a name describing the track object

  • stage – additional meta information (can be used to highlight different blocks inside a chain)

__repr__(self)

Return repr(self).

property x(self)

Get x value.

property y(self)

Get y value.

add_precursor(self, precursor: TrackObject)

Add a precursory track object.

add_successor(self, successor: TrackObject)

Add a successive track object.

class mlair.plotting.tracker_plot.TrackChain(track_list)
get_all_scopes(self, track_list) → Dict

Return dictionary with all distinct variables as keys and its unique scopes as values.

static get_all_dims(scopes)
create_track_chain(self)
_create_track_chain(self, control, sorted_track_dict, stage)
static _update_control(control, variable, scope, tr_obj)
static _add_track_object(track_objects, tr_obj, prev_obj)
_add_precursor(self, track_objects, tr_obj, prev_obj)
_add_set_object(self, track_objects, tr_obj, control_obj)
_recursive_decent(self, scope, control_obj_var)
_add_get_object(self, track_objects, tr_obj, control_obj, control, scope, variable)
static control_dict(scopes)

Create empty control dictionary with variables and scopes as keys and None as default for all values.

static clean_control(control)
static get_unique_scopes(track_list: List[Dict]) → List[str]

Get list with all unique elements from input including general scope if missing.

class mlair.plotting.tracker_plot.TrackPlot(tracker_list, sparse_conn_mode=True, plot_folder: str = '.', skip_run_env=True, plot_name=None)
_plot(self, track_chain_dict, sparse_conn_mode, skip_run_env, plot_folder, plot_name=None)
line(self, start_x, end_x, y, color='darkgrey')

Draw grey horizontal connection line from start_x to end_x on y-pos.

step(self, start_x, end_x, start_y, end_y, color='black')

Draw black connection step line from start_xy to end_xy. Step is taken shortly before end position.

rect(self, x, y, method='get')

Draw rectangle with lower left at (x,y), size equal to width/height and label/color according to method.

set_ypos_anchor(self, scopes, dims)
plot_track_chain(self, chain, y_pos, x_pos=0, prev=None, stage=None, sparse_conn_mode=False)
add_variable_names(self)
add_stages(self, vlines, stages)
create_track_chain_plot(self, track_chain_dict, sparse_conn_mode=True, skip_run_env=True)
set_lims(self)