Set BDES with validation - #20
Merged
Merged
Conversation
kabanaty
requested changes
May 7, 2026
| return self.metadata.read_tolerance | ||
|
|
||
| def is_bact_settled(self, b_tolerance: Optional[float] = 0.0) -> bool: | ||
| def is_bact_settled(self, b_tolerance: Optional[float] = 0.005) -> bool: |
Collaborator
There was a problem hiding this comment.
Use Magnet tolerance PV and/or metadata here instead of 0.005 static value
|
|
||
| def is_bact_settled(self, b_tolerance: Optional[float] = 0.0) -> bool: | ||
| def is_bact_settled(self, b_tolerance: Optional[float] = 0.005) -> bool: | ||
| return abs(self.bdes) - abs(self.bact) < b_tolerance |
Collaborator
There was a problem hiding this comment.
Should be absolute of differences, not difference of absolutes
Comment on lines
218
to
220
| def trim(self) -> None: | ||
| """Issue trim command""" | ||
| self.controls_information.PVs.ctrl.put(self.ctrl_options["TRIM"]) |
Collaborator
There was a problem hiding this comment.
Suggested change
| def trim(self, **kwargs) -> None: | |
| """Issue trim command""" | |
| self.controls_information.PVs.ctrl.put(self.ctrl_options["TRIM"], **kwargs) |
| self.bdes = bval | ||
| self.trim() | ||
| time_when_trim_started = datetime.now() | ||
| while not self.is_bact_settled(): |
Collaborator
There was a problem hiding this comment.
Compare to bval instead of self.bdes per conversation in tools meeting
eloise-nebula
approved these changes
Jun 3, 2026
eloise-nebula
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the changes. Dunno if you wanna wait to merge until after tonight's MD or not, but I'll approve now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds in the
set_bdes_with_validationfunction for theMagnetclass. This sets the BDES, trims the magnet and waits for the BACT to settle within a tolerance of 0.005.