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

Make more use of AsyncStatus.wrap #694

Merged
merged 5 commits into from
Jul 23, 2024
Merged

Make more use of AsyncStatus.wrap #694

merged 5 commits into from
Jul 23, 2024

Conversation

DominicOram
Copy link
Contributor

Instructions to reviewer on how to test:

  1. Confirm tests still pass and code is cleaner

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}

Copy link
Collaborator

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Changes look good, but CI is complaining

return AsyncStatus(
asyncio.wait_for(self._set_armed(demand), timeout=self.TIMEOUT)
)
@AsyncStatus.wrap
Copy link
Collaborator

Choose a reason for hiding this comment

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

lgtm, thanks.

I think we could move the code in _set_armed in this set here instead of keeping in split into two functions but I don't feel that strongly about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean make it an inner function of set? We need the function so that we can wait on it with a timeout

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, but I don't mind either way

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.16%. Comparing base (8ae0343) to head (4e52a00).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #694   +/-   ##
=======================================
  Coverage   94.16%   94.16%           
=======================================
  Files         108      108           
  Lines        4302     4305    +3     
=======================================
+ Hits         4051     4054    +3     
  Misses        251      251           

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

@DominicOram DominicOram merged commit ad3c5a8 into main Jul 23, 2024
18 checks passed
@DominicOram DominicOram deleted the use_wraps branch July 23, 2024 10:32
stan-dot pushed a commit that referenced this pull request Jul 24, 2024
* Make more use of AsyncStatus.wrap

* Use RE in smargon so it has an event loop

* Fix signature of stop

* Fix some typing issues
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