Skip to content

Ensure periodic saving fires immediately after runner task is finished #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

jbweston
Copy link
Contributor

Description

This PR modifies the behavior of periodic saving to fire immediately after the runner completes.
Previously the periodic saving would wait 'interval' seconds before firing the final save event.

Fixes #439 .

Checklist

  • Fixed style issues using pre-commit run --all (first install using pip install pre-commit)
  • pytest passed

Type of change

Check relevant option(s).

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • (Code) style fix or documentation update
  • This change requires a documentation update

Copy link
Contributor

@akhmerov akhmerov left a comment

Choose a reason for hiding this comment

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

Cool implementation!

What will this do if the runner.task is canceled? Do I understand correctly that it'll still save one last time?

@jbweston
Copy link
Contributor Author

Cool implementation!

What will this do if the runner.task is canceled? Do I understand correctly that it'll still save one last time?

It will indeed save one last time.

I believe this to be the semantics we want; we want all the results that the learner has at a particular point in time to be reflected in the saved results, regardless of whether the runner was cancelled, or stopped of its own accord.

@basnijholt basnijholt merged commit b77e011 into python-adaptive:main Jul 19, 2023
@jbweston jbweston deleted the fix/periodic-saving branch July 25, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

large delay when using start_periodic_saving
3 participants