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

add preset support for SQR1 #1255

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add preset support for SQR1 #1255

wants to merge 4 commits into from

Conversation

baljamal
Copy link
Contributor

Description

add preset support for SQR1 device

Motivation and Context

James Cryan asked for preset feature so he can move lamp sqr1 to predefined positions where beam focus is the best

How Has This Been Tested?

tested using hutch-python with TMO LAMP SQR1

Where Has This Been Documented?

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive docstrings, including context and API
  • New/changed functions and methods are covered in the test suite where possible
  • Test suite passes locally
  • Test suite passes on GitHub Actions
  • Ran docs/pre-release-notes.sh and created a pre-release documentation page
  • Pre-release docs include context, functional descriptions, and contributors as appropriate

@baljamal baljamal requested a review from ZLLentz June 27, 2024 15:28

if preset_pos is not None:
axis_list = [self.x, self.y, self.z, self.rz, self.ry, self.rz]
if any(hasattr(a.presets.positions, preset_pos) for a in axis_list):
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to be all instead of any, to force all the presets to exist before moving?

ry_sp = (getattr(self.ry.presets.positions, preset_pos)).pos
rz_sp = (getattr(self.rz.presets.positions, preset_pos)).pos
else:
logger.error('One of the axes is missing the desired state.')
Copy link
Member

Choose a reason for hiding this comment

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

should this return or raise as well in the error state to prevent the rest of the function from running?

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I like this, two small observations/questions above

Copy link
Member

Choose a reason for hiding this comment

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

Side note: the new functionality you've added here is unit-testable if you have the time

@@ -0,0 +1,30 @@
IssueNumber Title
Copy link
Contributor

Choose a reason for hiding this comment

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

did you run the script to generate this file? I'm surprised the filename is standard but the title here isn't

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