4.3. combinator_functions module

combinator_functions.check_scenario_name(df, scen_name)[source]
Note:

This function checks to ensure that all passed DataFrames have a consistent scenario 0.

Parameters:

df: A DataFrame which must have a column named “Scenario Name’.

scen_name: The scenario name that should be included in the passed DataFrame as scenario 0.

Return:

The passed DataFrame if scen_name is present as scenario 0, an error if not.

combinator_functions.do_year_shift(input_df, years_to_shift)[source]
Args:

df: A DataFrame of the data contained in the report-csv file being read and combined. years_to_shift: An integer representing the number of years by which to shift the model output file’s data for use in this tool.

Returns:

The passed DataFrame with year data shifted by years_to_shift years.

combinator_functions.read_and_combine_files(settings, report_name)[source]
Parameters:

settings: The SetInputs class.

report_name: The name of the report(s) to read.

Return:

A DataFrame that combines the Framework and NonFramework OEM run results for all runs in the model_runs_to_combine_path_dict.

combinator_functions.read_files_and_combine_scenarios(settings, report_name)[source]
Parameters:

settings: The SetInputs class.

report_name: The name of the report(s) to read.

Return:

A DataFrame that combines the Framework and NonFramework OEM scenario results for all runs in the model_runs_with_scenarios_to_combine_path_dict.

combinator_functions.scrub_data(settings, df)[source]
Note:

This function scrubs some records from the passed DataFrame.

Parameters:

settings: The SetInputs class.

df: The passed DataFrame.

Return:

The passed DataFrame after scrubbing base_scenario_name and some model_year “TOTAL” records.