Waterfall_Analysis#
Classes:
|
Perform waterfall analysis to study the compounded effect of changing multiple parameters. |
- class pyH2A.Analysis.Waterfall_Analysis.Waterfall_Analysis(input_file)[source]#
Perform waterfall analysis to study the compounded effect of changing multiple parameters.
- Parameters
- Waterfall_Analysis > […] > Namestr
Display name for parameter, e.g. used for plot labels.
- Waterfall_Analysis > […] > Typestr
Type of parameter values. If Type is ‘value’, provided values are used as is. If Type is ‘factor’, provided values are multiplied with base value of parameter in input file.
- Waterfall_Analysis > […] > Valuefloat
New value or factor for parameter.
- Waterfall_Analysis > […] > Show Percentbool or str, optional
If there is any entry for Show Percent the parameter will be displayed as a percentage value in waterfall chart.
Notes
Waterfall_Analysis contains parameters which are to be varied in waterfall analysis. First column specifies path to parameter in input file (top key > middle key > bottom key format, e.g. Catalyst > Cost per kg ($) > Value). Order of varied parameters determines in which order they are applied. In the order they are provided, each parameter is changed to the provided value. The relative change of introducing each change is computed, and the new H2 cost (compound result of applying all changes) is calculated.
Methods:
modify_inp_run_dcf
(inp, dic, output)Modification of inp with values from dic and running discounted cash flow analysis.
Perform waterfall analysis
plot_waterfall_chart
([ax, figure_lean, ...])Plot waterfall chart.
show_percent
(value, dic)Displaying provided value as percentage if Show Percent is in dictionary.
- modify_inp_run_dcf(inp, dic, output)[source]#
Modification of inp with values from dic and running discounted cash flow analysis.
- plot_waterfall_chart(ax=None, figure_lean=True, width=0.7, connection_width=1.0, label_offset=20, plot_sorted=False, plot_kwargs={}, **kwargs)[source]#
Plot waterfall chart.
- Parameters
- axmatplotlib.axes, optional
Axes object in which plot is drawn. Default is None, creating new plot.
- figure_leanbool, optional
If figure_lean is True, matplotlib.fig object is returned.
- widthfloat, optional
Width of bars in waterfall chart.
- connection_widthfloat, optional
Width of lines connecting bars.
- label_offsetfloat, optional
Offset of label for bars.
- plot_sortedbool, optional
If plot_sorted is True, bars are plotted in a sorted manner. If it False, they are plotted in the order they are provided in the input file.
- plot_kwargs: dict, optional
Dictionary containing optional keyword arguments for
Figure_Lean()
, has priority over **kwargs.- **kwargs:
Additional kwargs passed to
Figure_Lean()
- Returns
- figurematplotlib.fig or None
matplotlib.fig is returned if figure_lean is True.