perda.core_data_structures.single_run_data#
- pydantic model perda.core_data_structures.single_run_data.SingleRunData[source]#
Bases:
BaseModelPydantic model to store parsed CSV data with dictionary-like lookup.
- Config:
arbitrary_types_allowed: bool = True
- Fields:
-
field id_to_instance:
Dict[int,DataInstance] [Required]# Mapping from variable ID to DataInstance
-
field cpp_name_to_id:
Dict[str,int] [Required]# Mapping from variable name to variable ID
-
field id_to_cpp_name:
Dict[int,str] [Required]# Mapping from variable ID to variable name
-
field id_to_descript:
Dict[int,str] [Required]# Mapping from variable ID to variable description
-
field total_data_points:
int[Required]# Total number of data points across all variables
-
field data_start_time:
int[Required]# Start timestamp in log timestamp unit
-
field data_end_time:
int[Required]# End timestamp in log timestamp unit
-
field concat_boundaries:
List[int] [Optional]# Timestamps where concatenated runs begin (post-shift)
- add(cpp_name, di)[source]#
Insert a new derived DataInstance using a synthetic negative ID.
- Parameters:
cpp_name (str) – C++ variable name key for the new variable.
di (DataInstance) – DataInstance to insert.
- Return type:
None
- replace(cpp_name, di)[source]#
Overwrite the values of an existing variable in-place.
- Parameters:
cpp_name (str) – C++ variable name of the variable to replace.
di (DataInstance) – DataInstance whose
value_npthat replaces the stored one.
- Return type:
None