Skip to content
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

REF: Actually copy parameters / Update convergence metric #275

Merged
merged 7 commits into from
Aug 4, 2023

Conversation

carterbox
Copy link
Contributor

@carterbox carterbox commented Jul 10, 2023

Purpose

Actually return a copy of the parameters classes when using the copy_to_device/copy_to_host functions. This prevents unexpected behavior when a parameter of one of these classes is modified in place.

Use a convergence metric that checks how much (absolutely) the object has changed since the last epoch.

Approach

Return a new instance of the Parameter classes from the copy_to functions instead of a reference to the original.

Pre-Merge Checklists

Submitter

  • Write a helpfully descriptive pull request title.
  • Organize changes into logically grouped commits with descriptive commit messages.
  • Document all new functions.
  • Click 'details' on the readthedocs check to view the updated docs.
  • Write tests for new functions or explain why they are not needed.
  • Address any complaints from pep8speaks.

Reviewer

  • Actually read all of the code.
  • Run the new code yourself; the included tests should make this easy.
  • Write a summary of the changes as you understand them.
  • Thank the submitter.

@carterbox carterbox changed the title Actually copy REF: Actually copy parameters Jul 10, 2023
@carterbox carterbox changed the title REF: Actually copy parameters REF: Actually copy parameters / Update convergence metric Jul 10, 2023
@carterbox carterbox marked this pull request as ready for review July 10, 2023 22:34
@carterbox carterbox requested a review from a4894z July 26, 2023 14:49
@carterbox carterbox merged commit f87be34 into AdvancedPhotonSource:main Aug 4, 2023
1 of 5 checks passed
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.

1 participant