champpy.ChargingProfiles

The ChargingProfiles class is a wrapper class that integrates three interconnected data components for managing charging profiles. These three components are instances of ChargingTimeseries, ElectricVehicles, and Clusters. Each component contains a DataFrame that holds the data for that component. The components are linked via IDs, ensuring data consistency and enabling seamless workflows for analyzing and modifying the data. The structure is as follows:

ChargingProfiles
├── charging_timeseries  # Charging data for each timestep
│   └── df               # DataFrame with one row for each timestep and vehicle
├── vehicles             # Information of the vehicles
│   └── df               # DataFrame with one row for each vehicle
└── clusters             # Groups of vehicles with similar behaviour
    └── df               # DataFrame with one row for each cluster
class champpy.ChargingProfiles(charging_array, vehicles, clusters)[source]

Wrapper class for charging data in the champpy framework. It contains instances of the following classes: ChargingTimeseries, ElectricVehicles, Clusters. This class is genereated by the ChargingModel class. Don’t instantiate it directly.

charging_timeseries

Contains the charging data for each vehicle over time.

Type:

ChargingTimeseries

vehicles

Contains vehicle-specific data about each vehicle, such as its first and last day of activity, cluster assignment, battery capacity, max. charging power etc. It is connected to logbooks via id_vehicle.

Type:

ElectricVehicles

clusters

Describes the clusters defined in vehicles. It is connected to vehicles via id_cluster. It provides a label for each cluster.

Type:

Clusters

class champpy.ChargingTimeseries(charging_array)[source]

Class to hold charging profiles as a DataFrame.

Each row corresponds to a time step and a vehicle and contains information about charging status, energy consumption, energy stored, charging power, and missing energy.

The DataFrame (accessible via the df property) contains the following columns:

Column

Type

Description

id_vehicle

int

Vehicle identifier.

datetime

pandas.Timestamp

Date and time of the time step.

connected

bool

Boolean indicating whether the vehicle is connected to a charging station at the given time step.

energy_consumption_kwh

float

Energy consumption in kWh at the given time step.

energy_stored_kwh

float

Energy stored in the battery in kWh at the given time step.

power_charging_kw

float

Charging power in kW at the given time step.

energy_missing_kwh

float

Energy in kWh that is missing at the given time step (i.e., energy that should have been charged but was not because the vehicle was not connected).

property df

Return a copy of the DataFrame containing the charging timeseries data.

class champpy.ElectricVehicles(vehicles_data, user_params)[source]

Electric vehicle component extending Vehicles.

This class is based on the vehicles contained in MobProfiles and adds charging-related parameters required for charging profile calculations.

The DataFrame (accessible via the df property) contains all columns from Vehicles plus additional charging-related parameters:

Column

Type

Description

id_vehicle

int

Vehicle identifier.

first_day

pandas.Timestamp

First recorded day of the vehicle.

last_day

pandas.Timestamp

Last recorded day of the vehicle.

id_cluster

int

Cluster assignment.

first_loc

int

First location of the vehicle.

energy_consumption_kwh_per_km

float

Energy consumption per kilometer in kWh/km.

battery_capacity_kwh

float

Battery capacity in kWh.

charging_power_max_kw

float

Maximum charging power in kW.

efficiency_charging

float

Charging efficiency (0-1).

soc_min

float

Minimum state of charge (0-1).

soc_min_dep

float

Minimum state of charge at departure (0-1).

property df: DataFrame

Get a copy of the DataFrame of the data component. If the DataFrame is None, return an empty DataFrame with the correct schema.

property number: int

Return the number of entries in the DataFrame df.