Skip to content

Commit

Permalink
Add audit-info option to tabulate runs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Oct 24, 2024
1 parent 2df83c5 commit 40d0f2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ixmp4/core/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,16 @@ def list(self, default_only: bool = True, **kwargs) -> list[Run]:
for r in self.backend.runs.list(default_only=default_only, **kwargs)
]

def tabulate(self, default_only: bool = True, **kwargs) -> pd.DataFrame:
def tabulate(
self, default_only: bool = True, audit_info: bool = False, **kwargs
) -> pd.DataFrame:
runs = self.backend.runs.tabulate(default_only=default_only, **kwargs)
runs["model"] = runs["model__id"].map(self.backend.models.map())
runs["scenario"] = runs["scenario__id"].map(self.backend.scenarios.map())
return runs[["id", "model", "scenario", "version", "is_default"]]
columns = ["model", "scenario", "version", "is_default"]
if audit_info:
columns += ["updated_at", "updated_by", "created_at", "created_by", "id"]
return runs[columns]


class RunMetaFacade(BaseFacade, UserDict):
Expand Down

0 comments on commit 40d0f2b

Please sign in to comment.