Skip to content

Fix use of default context in caproto shim #1238

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomashopkins32
Copy link
Collaborator

@thomashopkins32 thomashopkins32 commented Apr 2, 2025

NOTE: To be merged after (and only if) caproto/caproto#862 is merged and released.

Uses the default context as a cached class method rather than the instance method that was released in https://github.com/caproto/caproto/releases/tag/v1.2.0

It also ensures that a different context is not passed in to the get_pv function so that the same context is used by caproto as is used by the event dispatcher.

Ophyd can't make its own default context unless it overrides and monkey-patches the remaining pyepics_compat functions. We only override get_pv right now:

pyepics_compat._get_pv = pyepics_compat.get_pv
pyepics_compat.get_pv = get_pv

Please let me know if I am missing something here!

@thomashopkins32 thomashopkins32 marked this pull request as ready for review April 2, 2025 20:51
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.

1 participant