Skip to content

Move CentreEllipseMethod to a more common location#1942

Open
noemifrisina wants to merge 7 commits intomainfrom
i19-122_find-beam-centre
Open

Move CentreEllipseMethod to a more common location#1942
noemifrisina wants to merge 7 commits intomainfrom
i19-122_find-beam-centre

Conversation

@noemifrisina
Copy link
Copy Markdown
Collaborator

Needed for i19-bluesky#122

Instructions to reviewer on how to test:

  1. Run tests
  2. Check that all code using this device has been updated

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}

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.10%. Comparing base (7913c36) to head (233766f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1942   +/-   ##
=======================================
  Coverage   99.09%   99.10%           
=======================================
  Files         317      317           
  Lines       11995    12000    +5     
=======================================
+ Hits        11887    11892    +5     
  Misses        108      108           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@noemifrisina noemifrisina marked this pull request as ready for review February 27, 2026 11:13
@noemifrisina noemifrisina requested a review from a team as a code owner February 27, 2026 11:13
Copy link
Copy Markdown
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Thanks, minor comment. Could you also add a test that explicitly checks that if you specify a large ROI it gives you the full image? It may be covered by test_get_roi_creates_correct_image_array, if it is then just a comment on one of those cases would be good.

ellipse_fit = self._fit_ellipse(roi_binary)
roi_centre_x = ellipse_fit[0][0]
roi_centre_y = ellipse_fit[0][1]
LOGGER.info(f"Beam centre founf at ({roi_centre_x}, {roi_centre_y})")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
LOGGER.info(f"Beam centre founf at ({roi_centre_x}, {roi_centre_y})")
LOGGER.info(f"Beam centre found at ({roi_centre_x}, {roi_centre_y})")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, this is the centre in the ROI co-ordinates, I think the full image co-ordinates would be more expected (or specify in the log that they're ROI)

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.

2 participants