plotting

Contents

plotting#

Base classes for different types of plotting tasks.

Classes:

PlotBase(*args, **kwargs)

Base class for all plotting tasks.

PlotBase1D(*args, **kwargs)

Base class for plotting tasks creating 1-dimensional plots.

PlotBase2D(*args, **kwargs)

Base class for plotting tasks creating 2-dimensional plots.

ProcessPlotSettingMixin(*args, **kwargs)

Mixin class for tasks creating plots where contributions of different processes are shown.

VariablePlotSettingMixin(*args, **kwargs)

Mixin class for tasks creating plots for multiple variables.

class PlotBase(*args, **kwargs)[source]#

Bases: ConfigTask

Base class for all plotting tasks.

Attributes:

Methods:

resolve_param_values(params)

get_plot_parameters()

rtype:

DotDict

plot_parts()

Returns a sorted, insertable dictionary containing all parts that make up the name of a plot file.

get_plot_names(name)

Returns a list of basenames for created plots given a file name for all configured file types, plus the additional plot suffix.

get_plot_func(func_name)

Returns a function, imported from a module given func_name which should have the format <module_to_import>.<function_name>.

call_plot_func(func_name, **kwargs)

Gets the plot function referred to by func_name via get_plot_func(), calls it with all kwargs and returns its result.

update_plot_kwargs(kwargs)

Hook to update keyword arguments kwargs used for plotting in call_plot_func().

plot_function = <luigi.parameter.Parameter object>#
file_types = <law.parameter.CSVParameter object>#
plot_suffix = <luigi.parameter.Parameter object>#
view_cmd = <luigi.parameter.Parameter object>#
general_settings = <columnflow.tasks.framework.parameters.SettingsParameter object>#
custom_style_config = <luigi.parameter.Parameter object>#
skip_legend = <law.parameter.OptionalBoolParameter object>#
cms_label = <luigi.parameter.Parameter object>#
debug_plot = <luigi.parameter.BoolParameter object>#
blinding_threshold = <luigi.parameter.FloatParameter object>#
exclude_params_remote_workflow = {'debug_plot'}#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

plot_parts()[source]#

Returns a sorted, insertable dictionary containing all parts that make up the name of a plot file.

Return type:

InsertableDict

get_plot_names(name)[source]#

Returns a list of basenames for created plots given a file name for all configured file types, plus the additional plot suffix.

Return type:

list[str]

get_plot_func(func_name)[source]#

Returns a function, imported from a module given func_name which should have the format <module_to_import>.<function_name>.

Return type:

Callable

call_plot_func(func_name, **kwargs)[source]#

Gets the plot function referred to by func_name via get_plot_func(), calls it with all kwargs and returns its result. kwargs are updated through the update_plot_kwargs() hook first.

Also, when the debug_plot parameter is set to True, an ipython debugger is started after the plot is created and can be interactively debugged.

Return type:

Any

update_plot_kwargs(kwargs)[source]#

Hook to update keyword arguments kwargs used for plotting in call_plot_func().

Return type:

dict

exclude_index = False#
exclude_params_branch = {'user'}#
exclude_params_index = {'user'}#
exclude_params_repr = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_repr_empty = {}#
exclude_params_req = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
exclude_params_workflow = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
class PlotBase1D(*args, **kwargs)[source]#

Bases: PlotBase

Base class for plotting tasks creating 1-dimensional plots.

Attributes:

Methods:

skip_ratio = <law.parameter.OptionalBoolParameter object>#
density = <law.parameter.OptionalBoolParameter object>#
yscale = <luigi.parameter.ChoiceParameter object>#
shape_norm = <law.parameter.OptionalBoolParameter object>#
hide_errors = <law.parameter.OptionalBoolParameter object>#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_branch = {'user'}#
exclude_params_index = {'user'}#
exclude_params_remote_workflow = {'debug_plot'}#
exclude_params_repr = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_repr_empty = {}#
exclude_params_req = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
exclude_params_workflow = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
class PlotBase2D(*args, **kwargs)[source]#

Bases: PlotBase

Base class for plotting tasks creating 2-dimensional plots.

Attributes:

Methods:

modify_param_values(params)

Hook to modify command line arguments before instances of this class are created.

get_plot_parameters()

rtype:

DotDict

zscale = <luigi.parameter.ChoiceParameter object>#
density = <law.parameter.OptionalBoolParameter object>#
shape_norm = <law.parameter.OptionalBoolParameter object>#
colormap = <luigi.parameter.Parameter object>#
zlim = <law.parameter.CSVParameter object>#
extremes = <luigi.parameter.ChoiceParameter object>#
extreme_colors = <law.parameter.CSVParameter object>#
classmethod modify_param_values(params)[source]#

Hook to modify command line arguments before instances of this class are created.

Return type:

dict

get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_branch = {'user'}#
exclude_params_index = {'user'}#
exclude_params_remote_workflow = {'debug_plot'}#
exclude_params_repr = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_repr_empty = {}#
exclude_params_req = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
exclude_params_workflow = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
class ProcessPlotSettingMixin(*args, **kwargs)[source]#

Bases: DatasetsProcessesMixin, PlotBase

Mixin class for tasks creating plots where contributions of different processes are shown.

Attributes:

Methods:

process_settings = <columnflow.tasks.framework.parameters.MultiSettingsParameter object>#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_branch = {'user'}#
exclude_params_index = {'user'}#
exclude_params_remote_workflow = {'debug_plot'}#
exclude_params_repr = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_repr_empty = {}#
exclude_params_req = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
exclude_params_workflow = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
class VariablePlotSettingMixin(*args, **kwargs)[source]#

Bases: VariablesMixin, PlotBase

Mixin class for tasks creating plots for multiple variables.

Attributes:

Methods:

variable_settings = <columnflow.tasks.framework.parameters.MultiSettingsParameter object>#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_branch = {'user'}#
exclude_params_index = {'user'}#
exclude_params_remote_workflow = {'debug_plot'}#
exclude_params_repr = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_repr_empty = {}#
exclude_params_req = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
exclude_params_workflow = {'notify_custom', 'notify_mattermost', 'notify_slack', 'user'}#