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

Component for motors moving halfs of JF4M detector #224

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

Conversation

egorsobolev
Copy link
Member

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 20.83333% with 19 lines in your changes missing coverage. Please review.

Project coverage is 70.70%. Comparing base (e884f54) to head (fa55874).

Files Patch % Lines
src/extra/components/detector_motors.py 17.39% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
- Coverage   71.09%   70.70%   -0.39%     
==========================================
  Files          23       23              
  Lines        2726     2748      +22     
==========================================
+ Hits         1938     1943       +5     
- Misses        788      805      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if src in dc.control_sources and position_key in dc[src].keys():
if (
src in dc.control_sources and
position_key in dc[src].keys(inc_timestamps=False)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
position_key in dc[src].keys(inc_timestamps=False)
position_key in dc[src]

This should work, and can be faster than loading the list of keys.

@takluyver
Copy link
Member

I assume you've tested this manually? It would be good to add some automated tests for it, like you did for the AGIPD 1M quadrant motors.

Other than that, I think this all looks fine.

Copy link
Member

@JamesWrigley JamesWrigley left a comment

Choose a reason for hiding this comment

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

Apart from needing some basic tests, LGTM!

raise ValueError("Motors are not found")
elif len(all_motors) > 1:
raise ValueError(
"Many detector found: {', '.join(det_motors.keys())}. "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Many detector found: {', '.join(det_motors.keys())}. "
"Many detector found: {', '.join(det_motors.keys())}.\n"

Nitpicking, it might be nicer formatting to print the 'please specify' message on a new line.

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