h0rton.tdlmc_utils.tdlmc_parser

Module Contents

Functions

format_results_for_tdlmc_metrics(version_dir, out_dir, rung_id=2) Format the BNN inference results so they can be read into the script that
read_from_csv(csv_path) Read a Pandas Dataframe from the combined csv file of TDLMC data while
convert_to_dataframe(rung, save_csv_path) Store the TDLMC closed and open boxes into a Pandas DataFrame and exports
parse_closed_box(closed_box_path, row_dict=dict()) Parse the lines of an open-box TDLMX text file for Rungs 0, 1, and 2
parse_open_box(open_box_path, row_dict=dict()) Parse the lines of an open-box TDLMX text file for Rungs 0, 1, and 2
h0rton.tdlmc_utils.tdlmc_parser.format_results_for_tdlmc_metrics(version_dir, out_dir, rung_id=2)[source]

Format the BNN inference results so they can be read into the script that generates the TDLMC metrics cornerplot

version_dir : str or os.path object
path to the folder containing inference results
rung_id : int
TDLMC rung ID
h0rton.tdlmc_utils.tdlmc_parser.read_from_csv(csv_path)[source]

Read a Pandas Dataframe from the combined csv file of TDLMC data while evaluating all the relevant strings in each column as Python objects

csv_path : str
path to the csv file generated using convert_to_dataframe
Pandas DataFrame
the TDLMC data with correct Python objects
h0rton.tdlmc_utils.tdlmc_parser.convert_to_dataframe(rung, save_csv_path)[source]

Store the TDLMC closed and open boxes into a Pandas DataFrame and exports to a csv file at the same location

rung : int
rung number
save_csv_path : str
path of the csv file to be generated
Pandas DataFrame
the extracted rung data
h0rton.tdlmc_utils.tdlmc_parser.parse_closed_box(closed_box_path, row_dict=dict())[source]

Parse the lines of an open-box TDLMX text file for Rungs 0, 1, and 2

closed_box_path : str
path to the closed box text file, lens_info_for_Good_team.txt.txt
row_dict : dict
dictionary of the row info to update. Default: dict()
dict
An updated dictionary containing the information in the closed box text file
h0rton.tdlmc_utils.tdlmc_parser.parse_open_box(open_box_path, row_dict=dict())[source]

Parse the lines of an open-box TDLMX text file for Rungs 0, 1, and 2

open_box_path : str
path to the open box text file, lens_all_info.txt
row_dict : dict
dictionary of the row info to update. Default: dict()
dict
An updated dictionary containing the information in the open box text file