pydpeet.extract_sequence_overview#

pydpeet.extract_sequence_overview(df_primitives, config)[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 add_primitive_segments(). 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”]

config (_SequenceOverviewConfigClass): Configuration object containing segment_sequence_config and show_runtime.

Use SequenceOverviewConfig.DEFAULT, SequenceOverviewConfig.OCV, or create custom config via sequence_overview_config_wrapper().

Returns:
df_segments_and_sequences (pd.DataFrame): A DataFrame containing the columns ‘ID’, ‘Sequence’, and all columns

specified in config.segment_sequence_config.

Parameters:
  • df_primitives (DataFrame)

  • config (_SequenceOverviewConfigClass)

Return type:

DataFrame