marmot.formatters.formatbase.Process#
- class Process(input_folder: pathlib.Path, output_file_path: pathlib.Path, *_, region_mapping: pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [], emit_names_dict: typing.Optional[dict] = None, **__)[source]#
Bases:
object
Base class for processing simulation model data.
- Parameters
input_folder (Path) – Folder containing model input files.
output_file_path (Path) – Path to formatted h5 output file.
region_mapping (pd.DataFrame, optional) – DataFrame to map custom regions/zones to create custom aggregations. Defaults to pd.DataFrame().
emit_names_dict (dict, optional) – Dictionary to rename emission names. Defaults to None.
Methods
combine_models
(model_list[, drop_duplicates])Combine temporally disaggregated model results.
get_processed_data
(prop_class, property, ...)method template for get_processed_data
output_metadata
(files_list)method template for output_metadata
Attributes
EXTRA_PROPERTIES_CLASS
Maps simulation model property names to Marmot property names
Dictionary to convert units to standard values used by Marmot
Dictionary model names to full filename path
Gets a list of input files within the scenario folders
Path to input folder
- UNITS_CONVERSION: dict = {'kW': ('MW', 0.001), 'MW': ('MW', 1), 'GW': ('MW', 1000.0), 'TW': ('MW', 1000000.0), 'kWh': ('MWh', 0.001), 'MWh': ('MWh', 1), 'GWh': ('MWh', 1000.0), 'TWh': ('MWh', 1000000.0), 'lb': ('kg', 0.453592), 'ton': ('kg', 907.18474), 'kg': ('kg', 1), 'tonne': ('kg', 1000), 'metric tons': ('kg', 1000), '$': ('$', 1), '2004$': ('$', 1), '$000': ('$', 1000), 'h': ('h', 1), 'MMBTU': ('MMBTU', 1), 'GBTU': ('MMBTU', 1000), 'GJ"': ('MMBTU', 0.947817), 'TJ': ('MMBTU', 947.81712), '$/MW': ('$/MW', 1), '$/MWh': ('$/MWh', 1), 'lb/MWh': ('kg/MWh', 0.453592), 'Kg/MWh': ('Kg/MWh', 1), 'Quads': ('Quads', 1), 'MW/yr': ('MW/yr', 1), 'frac': ('fraction', 1), 'fraction': ('fraction', 1), None: ('unitless', 1), 'unitless': ('unitless', 1)}#
Dictionary to convert units to standard values used by Marmot
- property input_folder: pathlib.Path#
Path to input folder
- Returns
input_folder
- Return type
Path
- property get_input_data_paths: list#
Gets a list of input files within the scenario folders
- Returns
list of input filenames to process
- Return type
- property data_collection: Dict[str, pathlib.Path]#
Dictionary model names to full filename path
- Returns
data_collection {filename: fullpath}
- Return type
- output_metadata(files_list: list) None [source]#
method template for output_metadata
- Parameters
files_list (list) – list of string files or filenames
- get_processed_data(prop_class: str, property: str, timescale: str, model_name: str) pandas.core.frame.DataFrame [source]#
method template for get_processed_data
- combine_models(model_list: list, drop_duplicates: bool = True) pandas.core.frame.DataFrame [source]#
Combine temporally disaggregated model results.
Will drop duplicate index entries by default.