Skip to content

Commit

Permalink
Update to support ParamDB v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhad6 committed Feb 5, 2024
1 parent 6b3754d commit ad20480
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
7 changes: 4 additions & 3 deletions datalogger/_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,13 @@ def _log(
ID. If no commit ID is given, the latest commit ID will be used.
"""
if self._param_db is not None and commit_id is None:
latest_commit = self._param_db.latest_commit
if latest_commit is None:
try:
latest_commit = self._param_db.load_commit_entry()
except IndexError as exc:
raise IndexError(
f"cannot tag log '{description}' with most recent commit because"
f" ParamDB '{self._param_db.path}' is empty"
)
) from exc
commit_id = latest_commit.id
log = make_log(
LogMetadata(
Expand Down
13 changes: 6 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typing-extensions = "^4.9.0"
numpy = "^1.26.3"
xarray = "^2024.1.0"
netcdf4 = "^1.6.5"
paramdb = { version = "^0.10.2", optional = true }
paramdb = { version = "^0.11.0", optional = true }

[tool.poetry.extras]
paramdb = ["paramdb"]
Expand Down

0 comments on commit ad20480

Please sign in to comment.