h2integrate.tools.profast_tools#
Functions
|
Convert dictionary of ProFAST objects to dictionary with |
Convert dictionary of ProFAST objects to dictionary with embedded dictionaries. |
|
|
Create ProFAST object and populate it with inputs. |
|
Create list of years of operation. |
Formats a price breakdown DataFrame to expand yearly amounts into separate columns. |
|
Convert ProFAST object to a dictionary of objects. |
|
|
Make a custom price breakdown of primary cost items in $/unit of commodity. |
|
Simulate financials with ProFAST |
- h2integrate.tools.profast_tools.create_and_populate_profast(pf_config)#
Create ProFAST object and populate it with inputs.
- Parameters:
pf_config (dict) – populated dictionary of ProFAST inputs.
- Returns:
ProFAST object – profast object initialized with data from pf_config
- h2integrate.tools.profast_tools.run_profast(pf)#
Simulate financials with ProFAST
- Parameters:
pf (ProFAST object) – populated ProFAST object
- Returns:
3-element tuple containing
sol (dict): solved price generated by ProFAST
summary (dict): summary vals generated by ProFAST
price_breakdown (pd.DataFrame): price breakdown generated by ProFAST
- h2integrate.tools.profast_tools.make_price_breakdown(price_breakdown, pf_config)#
- Make a custom price breakdown of primary cost items in $/unit of commodity.
Distributes non-component financial contributions (remaining financials) across primary cost items as weighted by cost item capex.
- Parameters:
price_breakdown (pd.DataFrame) – price breakdown generated by ProFAST
pf_config (dict) – dictionary of ProFAST inputs. can be used to recreate replica of ProFAST simulation.
- Returns:
2-element tuple containing
full_price_breakdown (dict): dictionary of each item’s contribution to overall LCO.
- lco_check (float): if
lcoh_check==sol['price'] then the results of
full_price_breakdownare accurate
- lco_check (float): if
- h2integrate.tools.profast_tools.create_years_of_operation(plant_life_years, financial_analysis_start_year, installation_period_months)#
Create list of years of operation.
- Parameters:
plant_life_years (int) – plant life duration in years
financial_analysis_start_year (int) – year to start analysis.
installation_period_months (float | int) – installation period in months
- Returns:
list[str] – list of years of operation.
- h2integrate.tools.profast_tools.format_profast_price_breakdown_per_year(price_breakdown)#
Formats a price breakdown DataFrame to expand yearly amounts into separate columns.
- Parameters:
price_breakdown (pd.DataFrame) – A DataFrame containing “Type”, “Name”, “Amount”, and “NPV” - “Amount” should be an array-like object per row, representing values for each year.
- Returns:
pd.DataFrame –
- A formatted DataFrame with columns:
”Type”
”Name”
”Year {i} Amount” for each year (e.g., “Year 0 Amount”, “Year 1 Amount”, …)
”NPV”
Each row corresponds to an entry in the input DataFrame, with yearly amounts expanded into separate columns.
- h2integrate.tools.profast_tools.convert_pf_res_to_pf_config(pf_config)#
- Convert dictionary of ProFAST objects to dictionary with
embedded dictionaries.
- Parameters:
pf_config (dict) – values are profast objects.
- Returns:
dict – dictionary representation of ProFAST inputs.
- h2integrate.tools.profast_tools.make_pf_config_from_profast(pf)#
Convert ProFAST object to a dictionary of objects.
- Parameters:
pf (ProFAST.ProFAST) – ProFAST object.
- Returns:
dict –
- keys are profast top-level inputs such as ‘params’, ‘capital_items’,
’fixed_costs’, etc. Values are objects of each input type.
- h2integrate.tools.profast_tools.convert_pf_to_dict(pf)#
Convert dictionary of ProFAST objects to dictionary with embedded dictionaries.
- Parameters:
pf_config (ProFAST object) – values are ProFAST objects.
- Returns:
dict – dictionary representation of ProFAST inputs.