Skip to content

Bimorph mirrors#944

Merged
dan-fernandes merged 101 commits intomainfrom
bimorph-mirrors
Dec 19, 2024
Merged

Bimorph mirrors#944
dan-fernandes merged 101 commits intomainfrom
bimorph-mirrors

Conversation

@dan-fernandes
Copy link
Collaborator

Adds the BimorphMirror device, representing an n-channel CAENels Bimorph Mirror.

My general questions:

  1. Some tests have assertions inside for loops. Could these be improved by collecting results and asserting all of collection?
  2. Should the mirror throw an error on being instantiated with zero (or negative) channels, or could there be a use case for this? (Perhaps not a programming question.)
  3. The test script contains a valid_bimorph_values fixture that generates a prandom set of correct inputs. Does it matter that this is generated at collection? Could there be a test case where multiple sets of randomly generated inputs are require, and in this case would it be better to implement input generation using a factory pattern?
  4. Order of fixture execution is based on scope, dependency and autouse. Due to this, the mirror fixture will definitely be executed before its needed. However, only one reference to the mirror fixtures passes the required number_of_channels parameter. Is this an issue? (Does this question make sense?)

Instructions to reviewer on how to test:

  1. Ensure tests pass

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@dan-fernandes dan-fernandes marked this pull request as ready for review December 10, 2024 16:47
@dan-fernandes dan-fernandes requested a review from a team as a code owner December 10, 2024 16:47
@dan-fernandes
Copy link
Collaborator Author

Updates made per Joseph's comment.

@callumforrester callumforrester self-assigned this Dec 11, 2024
Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

Looking good Dan, most comments are minor

Comment on lines +26 to +40
class BimorphMirrorOnOff(StrictEnum):
ON = "ON"
OFF = "OFF"


class BimorphMirrorMode(StrictEnum):
HI = "HI"
NORMAL = "NORMAL"
FAST = "FAST"


class BimorphMirrorStatus(StrictEnum):
IDLE = "Idle"
BUSY = "Busy"
ERROR = "Error"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting this related issue: #934

Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@dan-fernandes dan-fernandes merged commit 5a4a7ab into main Dec 19, 2024
@dan-fernandes dan-fernandes deleted the bimorph-mirrors branch December 19, 2024 11:53
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.

3 participants