Skip to content

Commit

Permalink
Fix bug in log_every_seconds (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored May 1, 2023
1 parent 943cf89 commit 91a1ad1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SDDP"
uuid = "f4570300-c277-11e8-125c-4912f86ce65d"
authors = ["Oscar Dowson <[email protected]>"]
version = "1.2.0"
version = "1.2.1"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
6 changes: 6 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ CurrentModule = SDDP
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).

## v1.2.1 (May 1, 2023)

### Fixed

- Fixed `log_every_seconds` (#597)

## v1.2.0 (May 1, 2023)

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ function train(
if mod(length(log), log_frequency) != 0
return false
end
if length(log) >= 2
if length(log) >= 2 && log_every_seconds > 0.0
return div(log[end-1].time, log_every_seconds) <
div(log[end].time, log_every_seconds)
end
Expand Down

2 comments on commit 91a1ad1

@odow
Copy link
Owner Author

@odow odow commented on 91a1ad1 May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/82628

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.1 -m "<description of version>" 91a1ad1947c8727a84b067e853bc2b98b79cc942
git push origin v1.2.1

Please sign in to comment.