def __init__(self, solution):
        """
        Dummy model created from a model solution,
        which gives access to the ``config_model`` AttrDict and a subset
        of Model methods, including ``get_option``, ``get_cost``, and
        ``get_depreciation``.

        Furthermore, it provides several ``recompute_`` methods
        to recalculate costs for a given technology after modifying the
        underlying data.

        """
        super().__init__()
        self.config_model = solution.config_model

        # Reconstruct self.data from solution
        self.data = utils.AttrDict()
        for k in ['r', 'e_eff']:
            if k in solution:
                ds = solution[k].to_dataset(dim='y_def_{}'.format(k))
                for y in ds.data_vars:
                    self.data.set_key('{}.{}'.format(k, y), ds[y].to_pandas())
                del solution[k]

        self.solution = solution

        # Add getters
        self._get_option = utils.option_getter(self.config_model, solution)
        self._get_cost = utils.cost_getter(self._get_option)
        self._get_dep = utils.depreciation_getter(self._get_option)
dataset/ETHPy150Open calliope-project/calliope/calliope/analysis.py/SolutionModel.__init__/original