energytrackr.plot.builtin_plots packageΒΆ
SubmodulesΒΆ
energytrackr.plot.builtin_plots.bootstrap_comparison moduleΒΆ
BootstrapComparison using BasePlot and mixins for cleaner composition.
- class energytrackr.plot.builtin_plots.bootstrap_comparison.BootStats(counts: list[int], lefts: list[float], rights: list[float], low_ci: float, high_ci: float)[source]ΒΆ
Bases:
NamedTupleStatistical summary for bootstrap CI histogram.
- counts: list[int]ΒΆ
Alias for field number 0
- high_ci: floatΒΆ
Alias for field number 4
- lefts: list[float]ΒΆ
Alias for field number 1
- low_ci: floatΒΆ
Alias for field number 3
- rights: list[float]ΒΆ
Alias for field number 2
- class energytrackr.plot.builtin_plots.bootstrap_comparison.BootstrapComparison[source]ΒΆ
Bases:
ComparisonBaseInteractive bootstrap CI histogram for Ξ-median between two commits.
energytrackr.plot.builtin_plots.boxplot_comparison moduleΒΆ
This module implements the BoxplotComparison plot for energytrackr.
BoxplotComparison using BasePlot and composable mixins for cleaner architecture, with notches, median-connecting line, and full/raw data sources restored.
- class energytrackr.plot.builtin_plots.boxplot_comparison.BoxplotComparison[source]ΒΆ
Bases:
ComparisonBaseInteractive boxplot comparison for two selected commits.
quartiles & whiskers
notches around medians
dashed line connecting medians
full & raw data sources for dynamic JS callbacks
tilted x-axis labels for readability
- class energytrackr.plot.builtin_plots.boxplot_comparison.SingleStats(commit: str, quartiles: tuple[float, float, float], whiskers: tuple[float, float], notch: tuple[float, float])[source]ΒΆ
Bases:
objectStatistical summary for a commit: quartiles, whiskers, and notch bounds.
- commit: strΒΆ
- notch: tuple[float, float]ΒΆ
- quartiles: tuple[float, float, float]ΒΆ
- whiskers: tuple[float, float]ΒΆ
energytrackr.plot.builtin_plots.change_point_comparison moduleΒΆ
ChangePointComparison using BasePlot and mixins for cleaner composition.
- class energytrackr.plot.builtin_plots.change_point_comparison.ChangePointComparison(**params: dict[str, Any])[source]ΒΆ
Bases:
FontMixin,HoverMixin,BasePlot,Configurable[ChangePointComparisonConfig]Renders a median-trend plot with change-point detection overlays.
energytrackr.plot.builtin_plots.cusum_comparison moduleΒΆ
CUSUMComparison using BasePlot and mixins with refactored stats dataclasses.
- class energytrackr.plot.builtin_plots.cusum_comparison.CUSJStats(cusum_pos_j: ndarray[tuple[int, ...], dtype[float64]], cusum_neg_j: ndarray[tuple[int, ...], dtype[float64]], cusum_net_j: ndarray[tuple[int, ...], dtype[float64]], upper_j: float)[source]ΒΆ
Bases:
objectJoule-based CUSUM statistics.
- cusum_neg_j: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- cusum_net_j: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- cusum_pos_j: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- upper_j: floatΒΆ
- class energytrackr.plot.builtin_plots.cusum_comparison.CUSPctStats(cusum_pos_pct: ndarray[tuple[int, ...], dtype[float64]], cusum_neg_pct: ndarray[tuple[int, ...], dtype[float64]], cusum_net_pct: ndarray[tuple[int, ...], dtype[float64]], upper_pct: float)[source]ΒΆ
Bases:
objectPercentage-based CUSUM statistics.
- cusum_neg_pct: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- cusum_net_pct: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- cusum_pos_pct: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- upper_pct: floatΒΆ
- class energytrackr.plot.builtin_plots.cusum_comparison.CUSStats(medians: ndarray[tuple[int, ...], dtype[float64]], diffs: ndarray[tuple[int, ...], dtype[float64]], sigma: float, j: CUSJStats, pct: CUSPctStats)[source]ΒΆ
Bases:
objectAll the series we need for CUSUM Comparison.
- diffs: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- medians: ndarray[tuple[int, ...], dtype[float64]]ΒΆ
- pct: CUSPctStatsΒΆ
- sigma: floatΒΆ
- class energytrackr.plot.builtin_plots.cusum_comparison.CUSUMComparison(**params: dict[str, Any])[source]ΒΆ
Bases:
FontMixin,HoverMixin,BasePlot,Configurable[CUSUMComparisonConfig]Enhanced CUSUM chart with both original areas and net-difference shading.
energytrackr.plot.builtin_plots.ecdf_comparison moduleΒΆ
ECDFComparison using BasePlot and mixins for cleaner composition.
- class energytrackr.plot.builtin_plots.ecdf_comparison.ECDFComparison[source]ΒΆ
Bases:
ComparisonBaseInteractive ECDF comparison between two selected commits.
energytrackr.plot.builtin_plots.evolution_plot moduleΒΆ
EvolutionPlot module with commit-zoom selector and fixed y-axis.
- class energytrackr.plot.builtin_plots.evolution_plot.EvolutionPlot(**params: dict[str, Any])[source]ΒΆ
Bases:
SingleCommitZoomMixin,FontMixin,BasePlot,Configurable[EvolutionPlotConfig]Energy-per-commit evolution plot with commit zoom and fixed y-axis.
- class energytrackr.plot.builtin_plots.evolution_plot.EvolutionPlotConfig(template: str = 'templates/base_plot.html', objects: list[str] = <factory>, zoom_window: int = 5)[source]ΒΆ
Bases:
objectConfiguration for EvolutionPlot, including how wide the zoom box is.
- objects: list[str]ΒΆ
- template: str = 'templates/base_plot.html'ΒΆ
- zoom_window: int = 5ΒΆ
energytrackr.plot.builtin_plots.mixins moduleΒΆ
Reusable mixin classes for common plot behavior.
- class energytrackr.plot.builtin_plots.mixins.ColorbarMixin[source]ΒΆ
Bases:
objectAdds a Viridis palette colorbar on the right.
- class energytrackr.plot.builtin_plots.mixins.CommitSelectorsMixin[source]ΒΆ
Bases:
objectAdds two Autocomplete selectors for commit A/B with JS callback wiring.
- class energytrackr.plot.builtin_plots.mixins.ComparisonBase[source]ΒΆ
Bases:
CommitSelectorsMixin,FontMixin,HoverMixin,BasePlotAbstract base for any βcompare-two commitsβ plot.
- class energytrackr.plot.builtin_plots.mixins.FontMixin[source]ΒΆ
Bases:
objectConfigures consistent fonts for axes and title.
- class energytrackr.plot.builtin_plots.mixins.HoverMixin[source]ΒΆ
Bases:
objectAdds a hover tool to the first data renderer with custom tooltips.
- class energytrackr.plot.builtin_plots.mixins.RangeToolMixin[source]ΒΆ
Bases:
objectAdds a drag-to-zoom minimap under the chart.
- class energytrackr.plot.builtin_plots.mixins.SingleCommitZoomMixin[source]ΒΆ
Bases:
objectAdds an AutocompleteInput to zoom the x-range around one commit.
- energytrackr.plot.builtin_plots.mixins.draw_additional_objects(objects: list[str], fig: figure, ctx: Context) None[source]ΒΆ
Draw additional plot objects on the figure.
- Parameters:
objects (list[str]) β List of object names to be drawn.
fig (figure) β The Bokeh figure object.
ctx (Context) β The context object containing the data and configuration.
- energytrackr.plot.builtin_plots.mixins.get_labels_and_dists(ctx: Context) tuple[list[str], list[ndarray]][source]ΒΆ
Extracts and returns the labels and corresponding distributions from the given context.
- Parameters:
ctx (Context) β The context object containing statistical data and artefacts.
- Returns:
A tuple containing a list of short hash labels and a list of distributions.
- Return type:
tuple[list[str], list[np.ndarray]]
- energytrackr.plot.builtin_plots.mixins.initial_commits(labels: Sequence[str]) tuple[str, str][source]ΒΆ
Returns the first and last elements from a sequence of label strings.
- Parameters:
labels (Sequence[str]) β A sequence of label strings.
- Returns:
A tuple containing the first and last label from the input sequence.
- Return type:
tuple[str, str]
- energytrackr.plot.builtin_plots.mixins.make_selectors(labels: list[str], js_code_path: str | Path, cb_args: Mapping[str, Any]) tuple[AutocompleteInput, AutocompleteInput][source]ΒΆ
Create two AutocompleteInput widgets wired to the same CustomJS callback.
- Parameters:
labels (list[str]) β List of labels to be used for the AutocompleteInput widgets.
js_code_path (str | Path) β Path to the JavaScript code file for the CustomJS callback.
cb_args (Mapping[str, Any]) β Additional arguments to be passed to the CustomJS callback.
- Returns:
A tuple containing two AutocompleteInput widgets.
- Return type:
tuple[AutocompleteInput, AutocompleteInput]
energytrackr.plot.builtin_plots.qq_comparison moduleΒΆ
QQComparison using BasePlot and mixins for cleaner composition.
- class energytrackr.plot.builtin_plots.qq_comparison.QQComparison[source]ΒΆ
Bases:
CommitSelectorsMixin,FontMixin,ColorbarMixin,HoverMixin,BasePlotInteractive QQ-plot comparing two commits with percentile coloring and tooltips.
energytrackr.plot.builtin_plots.registry moduleΒΆ
Registry for BasePlot subclasses, enabling automatic discovery of available plots.
- energytrackr.plot.builtin_plots.registry.get_registered_plots() dict[str, type[BasePlot]][source]ΒΆ
Return mapping of plot names to BasePlot subclasses.
- Returns:
Mapping of plot names to BasePlot subclasses.
- Return type:
dict[str, type[BasePlot]]
- energytrackr.plot.builtin_plots.registry.register_plot(plot_cls: type[BasePlot]) type[BasePlot][source]ΒΆ
Class decorator to register a BasePlot subclass.
Usage:
@register_plot class MyPlot(BasePlot): ...
Registered under its class name.
- Parameters:
plot_cls (type[BasePlot]) β A subclass of BasePlot
- Returns:
The registered plot class.
- Return type:
type[BasePlot]
- Raises:
PlotAlreadyRegisteredError β If the plot class is already registered.
energytrackr.plot.builtin_plots.violin_comparison moduleΒΆ
ViolinComparison using BasePlot and mixins for cleaner composition.
- class energytrackr.plot.builtin_plots.violin_comparison.ViolinComparison[source]ΒΆ
Bases:
ComparisonBaseInteractive violin plot comparing two selected commits with hover tooltips.
Module contentsΒΆ
Builtin plots for energytrackr.