@@ -0,0 +1,2885 @@
+from __future__ import division%0Afrom __future__ import print_function%0A%0Aimport plotly.graph_objs as go%0A%0Aimport cea.plots.optimization%0Afrom cea.plots.variable_naming import NAMING, COLOR%0A%0A__author__ = %22Daren Thomas%22%0A__copyright__ = %22Copyright 2019, Architecture and Building Systems - ETH Zurich%22%0A__credits__ = %5B%22Jimeno A. Fonseca%22, %22Daren Thomas%22%5D%0A__license__ = %22MIT%22%0A__version__ = %220.1%22%0A__maintainer__ = %22Daren Thomas%22%0A__email__ = %22cea@arch.ethz.ch%22%0A__status__ = %22Production%22%0A%0A%0Aclass InvestmentCostsPlot(cea.plots.optimization.GenerationPlotBase):%0A    %22%22%22Implement the %22CAPEX vs. OPEX of centralized system in generation X%22 plot%22%22%22%0A    name = %22Investment costs%22%0A    expected_parameters = %7B%0A        'generation': 'plots-optimization:generation',%0A        'scenario-name': 'general:scenario-name',%0A    %7D%0A%0A    def __init__(self, project, parameters, cache):%0A        super(InvestmentCostsPlot, self).__init__(project, parameters, cache)%0A        self.analysis_fields = %5B%22Capex_total_sys_connected_USD%22,%0A                                %22Capex_total_sys_disconnected_USD%22,%0A                                %5D%0A        self.input_files = %5B(self.locator.get_optimization_generation_total_performance, %5Bself.generation%5D)%5D%0A%0A    @property%0A    def title(self):%0A        return %22Investment Costs for generation #%25s%22 %25 self.generation%0A%0A    @property%0A    def output_path(self):%0A        return self.locator.get_timeseries_plots_file(%0A            'gen%7Bgeneration%7D_investment_costs'.format(generation=self.generation),%0A            self.category_name)%0A%0A    @property%0A    def layout(self):%0A        return go.Layout(barmode='relative',%0A                         yaxis=dict(title='Investment cost %5BUSD$(2015)%5D'))%0A%0A    def calc_graph(self):%0A        self.multi_criteria = False  # TODO: add capabilities to plot muticriteria in this plot too%0A        data = self.process_generation_total_performance_pareto()%0A        graph = %5B%5D%0A        for field in self.analysis_fields:%0A            y = data%5Bfield%5D.values%0A            flag_for_unused_technologies = all(v == 0 for v in y)%0A            if not flag_for_unused_technologies:%0A                trace = go.Bar(x=data%5B'individual_name'%5D, y=y, name=NAMING%5Bfield%5D,%0A                               marker=dict(color=COLOR%5Bfield%5D))%0A                graph.append(trace)%0A%0A        return graph%0A%0A%0Adef main():%0A    %22%22%22Test this plot%22%22%22%0A    import cea.config%0A    import cea.plots.cache%0A    config = cea.config.Configuration()%0A    cache = cea.plots.cache.NullPlotCache()%0A    locator = cea.inputlocator.InputLocator(config.scenario)%0A    # cache = cea.plots.cache.PlotCache(config.project)%0A    InvestmentCostsPlot(config.project,%0A                    %7B'buildings': None,%0A                     'scenario-name': config.scenario_name,%0A                     'generation': config.plots_optimization.generation%7D,%0A                    cache).plot(auto_open=True)%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Create Investment_costs.py