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.convert_to_ustons(settings, df)[source]¶
- Note:
CCEMS reports criteria pollutants in metric tons and converts to US tons when multiplying by $/ton. EPA prefers to report US tons.
- Parameters:
settings: The SetInputs class.
df: A DataFrame containing inventory values in metric tons for conversion to US tons.
- Returns:
A DataFrame with criteria pollutant inventories expressed in US tons.
- combinator_functions.do_year_shift(input_df, years_to_shift)[source]¶
- Parameters:
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_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_path_dict.