From d96406804fc508c723b15e953e16e450544a5a49 Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Wed, 27 Nov 2024 09:45:16 +0100 Subject: [PATCH] Allow include_data parameter for indexset.tabulate() --- ixmp4/core/optimization/indexset.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ixmp4/core/optimization/indexset.py b/ixmp4/core/optimization/indexset.py index 312b388a..40ad02e8 100644 --- a/ixmp4/core/optimization/indexset.py +++ b/ixmp4/core/optimization/indexset.py @@ -1,6 +1,8 @@ from datetime import datetime from typing import ClassVar +import pandas as pd + from ixmp4.core.base import BaseModelFacade from ixmp4.data.abstract import Docs as DocsModel from ixmp4.data.abstract import IndexSet as IndexSetModel @@ -79,3 +81,10 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self._backend_repository = self.backend.optimization.indexsets self._model_type = IndexSet + + def tabulate( + self, name: str | None = None, include_data: bool = False + ) -> pd.DataFrame: + return self._backend_repository.tabulate( + run_id=self._run.id, name=name, include_data=include_data + )