From 9bd6d87641658c2dadbc10a2e94daa43ad7d841a Mon Sep 17 00:00:00 2001 From: Fabian Liebig Date: Mon, 25 Nov 2024 10:06:14 +0100 Subject: [PATCH] fixup! Refactor persistence handling: Restructure path building by separating folder and filename construction. This commit will drop the workflow id to allow overwriting and make the path homogenous constructable. Refactor PathConstructor: Change private branch attribute to public and update default branch method --- benchmarks/persistence/persistence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/persistence/persistence.py b/benchmarks/persistence/persistence.py index 4e62773e9..5daea69c1 100644 --- a/benchmarks/persistence/persistence.py +++ b/benchmarks/persistence/persistence.py @@ -42,10 +42,10 @@ class PathConstructor: execution_date_time: datetime = field(validator=instance_of(datetime)) """The date and time when the benchmark was executed.""" - _branch: str = field(validator=instance_of(str)) + branch: str = field(validator=instance_of(str), init=False) """The branch currently checked out.""" - @_branch.default + @branch.default def _default_branch(self) -> str: repo = Repo(search_parent_directories=True) current_branch = repo.active_branch.name @@ -78,7 +78,7 @@ def get_path(self, strategy: PathStrategy) -> str: file_usable_date = self.execution_date_time.strftime("%Y-%m-%d") components = [ self.benchmark_name, - self._branch, + self.branch, self.latest_baybe_tag, file_usable_date, self.commit_hash,