pydpeet.extract_sequence_overview#
- pydpeet.extract_sequence_overview(df_primitives, SEGMENT_SEQUENCE_CONFIG=None, SHOW_RUNTIME=True)[source]#
Create a DataFrame of segments and sequences from a DataFrame of primitives. (ID, longest sequence, segments/sequence) Each Segment/Sequence is listed per ID with an incrementally increasing value per match.
- The rules dictionary can contain the following keys:
“min_length_sec”: minimum length of the segment in seconds
“min_avg_abs”: minimum average absolute value of the segment
“max_slope”: maximum slope of the segment
“min_abs_slope”: minimum absolute slope of the segment
“direction”: direction of the segment
“variable”: variable name of the segment
“type”: type of the segment
“loop”: True can be used to support looping sequences “merge”: True can be used to support merging multiple subsequences and segments
- Parameters:
- df_primitives (pd.DataFrame): A DataFrame of primitives created using step_analyzer_primitives(). With the following columns:
standard_columns = [‘Test_Time[s]’, ‘Voltage[V]’, ‘Current[A]’, ‘Power[W]’, “ID”, “Variable”, “Duration”, “Length”, “Min”, “Max”, “Avg”, “Type”, “Direction”, “Slope”]
- SEGMENT_SEQUENCE_CONFIG (dict): A dictionary containing the configuration for the analysis.
Example:{{“Current”: {“rules”: {“variable”: “I”, …}}}, {“Discharge_iOCV”: {“loop”: True, “minimum_IDs”: 4, “sequence”: [“CC_Discharge”,”Pause”]}}, …}
SHOW_RUNTIME (bool): If True, the function logs the time taken to perform each step.
- Returns:
- df_segments_and_sequences (pd.DataFrame): A DataFrame containing the columns ‘ID’, ‘Sequence’, and all columns
specified in SEGMENT_SEQUENCE_CONFIG.