def recompute_levelized_costs(self, y, k='monetary', carrier='power',
                                  cost_adjustment=1.0):
        """
        Recompute levelized costs for the given technology ``y``.

        ``cost_adjustment`` linearly scales the construction costs used
        internally to compute levelized costs.

        """
        get_depreciation = self.get_depreciation
        solution = self.solution
        icf = self.recompute_investment_costs
        cost_con = icf(y, k=k, cost_adjustment=cost_adjustment)['total']
        ocf = self.recompute_operational_costs
        cost_op = ocf(y, k=k, carrier=carrier,
                      cost_adjustment=cost_adjustment)['total']
        # Here we want net production
        production = solution['ec_prod'].loc[dict(c=carrier, y=y)]
        lc = (get_depreciation(y, k) * (solution['time_res'].to_pandas().sum() / 8760)
              * cost_con + cost_op) / production.to_pandas()
        lc.at['total'] = (get_depreciation(y, k)
                          * (solution['time_res'].to_pandas().sum() / 8760)
                          * cost_con.total
                          # * cost_con.drop(['total'], axis=0).sum()
                          + cost_op.sum()) / production.sum()
        return lc
dataset/ETHPy150Open calliope-project/calliope/calliope/analysis.py/SolutionModel.recompute_levelized_costs/original