Postprocessing (battdat.postprocess
)#
Base (b.postprocess.base
)#
Base class and utilities related to post-processing on battery data
- class battdat.postprocess.base.BaseFeatureComputer#
Bases:
object
Base class for methods that produce new features given battery data
Features can be anything but are often collected statistics about a certain cycle.
- compute_features(data: CellDataset) DataFrame #
Compute
- Parameters:
data – Battery data object
- Returns:
A dataframe of features where rows are different cycles or steps, columns are different features
- class battdat.postprocess.base.CycleSummarizer#
Bases:
BaseFeatureComputer
Classes which produce a summary of certain cycles given the raw data from a cycle
- add_summaries(data: CellDataset)#
Add cycle-level summaries to a battery dataset
- Parameters:
data – Dataset to be modified
- compute_features(data: CellDataset) DataFrame #
Compute
- Parameters:
data – Battery data object
- Returns:
A dataframe of features where rows are different cycles or steps, columns are different features
- class battdat.postprocess.base.RawDataEnhancer#
Bases:
BaseFeatureComputer
Base class for methods derives new data from the existing columns in raw data
- compute_features(data: CellDataset) DataFrame #
Compute
- Parameters:
data – Battery data object
- Returns:
A dataframe of features where rows are different cycles or steps, columns are different features
Integral (b.postprocess.integral
)#
Features related to integral quantities (e.g., energy, capacity)
- class battdat.postprocess.integral.CapacityPerCycle(reuse_integrals: bool = True)#
Bases:
CycleSummarizer
Compute the observed capacity and energy during both charge and discharge of each cycle
Determines capacities based on the integral of current over each cycle:
Compute the change in state of charge from the start of the cycle by computing the integral of the capacity over time. We refer to this integral as the dSOC.
Determine whether the battery started from a charged state by determining if the largest capacity change is positive (i.e., if the point most different state of charge from the start is more discharged than the starting point). The code will raise a warning if the quantities are similar.
If starting from a charged state, the discharge capacity is the maximum change in state of charge (
dSOC.max()
). The charge capacity is the amount of charge transferred to the battery between this maximally-discharged state and the end the of the cycle (dSOC.max() - dSOC[-1]
)If starting from a discharged state, the charge capacity is the maximum change in state of charge and the discharge capacity is the amount transferred from the battery into the end of the cycle.
The energy is computed using a similar procedure, but by integrating the product of current and voltage instead of only current.
Note
Measurements of capacity and energy assume a cycle returns the battery to the same state as it started the cycle.
Output dataframe has 4 new columns.
capacity_discharge
: Discharge capacity per cycle in A-hrcapacity_charge
: Charge capacity per the cycle in A-hrenergy_charge
: Discharge energy per cycle in Jenergy_discharge
: Charge energy per the cycle in J
The full definitions are provided in the
CycleLevelData
schema- Parameters:
reuse_integrals – Whether to reuse the
cycle_capacity
andcycle_energy
if they are available
- class battdat.postprocess.integral.StateOfCharge#
Bases:
RawDataEnhancer
Compute the change in capacity and system energy over each cycle
The capacity change for a cycle is determined by integrating the current as a function of time between the start of the cycle and the first of the next cycle. The energy change is determined by integrating the product of current and voltage.
- Output dataframe has 2 new columns:
cycle_capacity
: Amount of charge charged since the beginning of the cycle, in A-hrcycle_energy
: Amount of energy charged since the beginning of the cycle, in J
Tagging (b.postprocess.tagging
)#
Methods which assign labels that are present in some testing machines yet absent in others.
For example, add_method()
determines whether the battery is being held at a constant voltage or current.
- class battdat.postprocess.tagging.AddMethod#
Bases:
RawDataEnhancer
Determine how the battery was being controlled
Determines whether a charging step is composed of constant-current, constant-voltage, or mixed steps by first partitioning it into substeps based on the maximum curvature of these points then assigning regions to constant voltage or current if one varied more than twice the other.
- class battdat.postprocess.tagging.AddSteps#
Bases:
RawDataEnhancer
Mark points at which the battery changed state: charging, discharging, rest
- class battdat.postprocess.tagging.AddSubSteps#
Bases:
RawDataEnhancer
Mark points at which the battery control method changed state
See
AddMethod
for how control methods are determined.
Timing (b.postprocess.tagging
)#
Features related to the relative to the start of cycles or the test, etc
- class battdat.postprocess.timing.CycleTimesSummarizer#
Bases:
CycleSummarizer
Capture the start time and duration of a cycle
The start of a cycle is the minimum test time for any point in the raw data.
The duration of a cycle is the difference between the start of the next cycle and the start of the cycle. If the start time of the next cycle is unavailable, it is the difference between the test time of the last test time in the raw data and the start of the cycle.
- class battdat.postprocess.timing.TimeEnhancer#
Bases:
RawDataEnhancer
Compute additional columns describing the time a measurement was taken