Skip to content

Commit

Permalink
fixup! Refactor persistence handling: Restructure path building by se…
Browse files Browse the repository at this point in the history
…parating 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
  • Loading branch information
fabianliebig committed Nov 25, 2024
1 parent bd34ac9 commit 9bd6d87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmarks/persistence/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9bd6d87

Please sign in to comment.