champpy.ChargingPlotter

The ChargingPlotter is a factory class to visualize synthetic charging profiles in CHAMPPy. Different plots are created with the Python library plotly and merged in a html file. The ChargingPlotter can be used to analyze the generated synthetic charging profiles and to compare different charging profiles.

The generated html file contains the following plots:

  • 📊 Bar charts of charging characteristics: daily driving consumption, daily charging hours, daily charging energy, daily connected hours

  • 📈 Total load profile of the fleet over the week

Basic workflow:

  1. Initialize the plotter ChargingPlotter with user parameters UserParamsChargingPlotter

  2. Call plot_charging_profiles() to create plots of ChargingProfiles.

  3. Analyze the generated plots in html format, that opens automatically after the plot is created.

class champpy.ChargingPlotter(user_params=UserParamsChargingPlotter(filename='plots\\\\charging_plots.html', font_family='Segoe UI', save_plot=True, show=True, font_size=18, rgb_color=[[0.2078, 0.4235, 0.6471], [0.9686, 0.8353, 0.0275], [0.5412, 0.7098, 0.8824], [0.6706, 0.149, 0.149], [0.1216, 0.3059, 0.4745], [0.9255, 0.5765, 0.0078], [0.4784, 0.1098, 0.1098]], load_temp_res=1, clustering=False))[source]

Plotter for charging profiles.

This class provides multiple plotting utilities for charging profiles, including summary characteristics and load profiles.

Parameters:

user_params (Optional[UserParamsChargingPlotter]) – Plot configuration such as output filename, font, colors, and display/export behavior.

plot_charging_profiles(charging_profiles)[source]

Main function to generate plots of charging profiles. The function calls plot_charging_char() and plot_load_week() to create a combined HTML file.

Parameters:

charging_profiles (ChargingProfiles) – Input charging profiles that are to be visualized.

Returns:

The method writes/opens a combined HTML plot report depending on user settings.

Return type:

None

plot_charging_char(charging_profiles)[source]

Plot charging characteristics: daily driving consumption, daily charging hours, daily charging energy, daily connected hours.

Parameters:

charging_profiles (ChargingProfiles) – Charging data to plot.

Returns:

Plotly figure object with charging characteristics.

Return type:

Figure

plot_load_week(charging_profiles)[source]

Plot the charging load profile over the course of an average week.

Parameters:

charging_profiles (ChargingProfiles) – Charging data to plot.

Returns:

Plotly figure object with weekly load profile.

Return type:

Figure

class champpy.UserParamsChargingPlotter(*args, **kwargs)[source]

User parameters to initialize ChargingPlotter.

filename: str = 'plots\\charging_plots.html'

Output filename for the generated HTML plots.

font_family: str = 'Segoe UI'

Font family for plot text.

save_plot: bool = True

Option to control whether plots are saved to file.

show: bool = True

Option to control whether plots are displayed in browser.

font_size: int = 18

Font size for plot text.

rgb_color: list | None

RGB color matrix for plotting clusters. Each inner list contains RGB values (0-1 range).

load_temp_res: int | None = 1

Temporal resolution in hours, only relevant for load profile plot.

clustering: bool | None = False

Option to control whether plots are created for clusters (if defined in the data).