Skip to content

Commit

Permalink
🐛 Fix FormatError
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Feb 2, 2023
1 parent e02a1ce commit 1ce8559
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.1.2 (2023-02-02)

### Fixed

- Log message of `LoggedStopper` caused `FormatError`

## 1.1.1 (2023-01-31)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = rt_stoppers_contrib
version = 1.1.1
version = 1.1.2
description = Additional stoppers for ray tune
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
4 changes: 2 additions & 2 deletions src/rt_stoppers_contrib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ def __init__(self, stopper: tune.Stopper, logger: logging.Logger | None = None):
def __call__(self, trial_id: Any, result: dict[str, Any]) -> bool:
stop = self._stopper(trial_id, result)
if stop:
self._logger.info(f"Trial {trial_id} stopped because of {self._stopper:!r}")
self._logger.info("Trial %s stopped because of %s", trial_id, self._stopper)
return stop

def stop_all(self) -> bool:
stop = self._stopper.stop_all()
if stop:
self._logger.info(f"All trials stopped because of {self._stopper:!r}")
self._logger.info(f"All trials stopped because of {self._stopper!r}")
return stop

0 comments on commit 1ce8559

Please sign in to comment.