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

846 update i04 to use device_factory #986

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

Conversation

rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented Jan 13, 2025

Part of a series of PRs that addresses #846

This PR builds on and depends on

Instructions to reviewer on how to test:

  1. dodal connect i04 connects to all devices
  2. Tests pass

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}

@rtuck99 rtuck99 requested a review from a team as a code owner January 13, 2025 14:24
@rtuck99 rtuck99 changed the base branch from main to 846_device_factory_support_for_ophyd_v1 January 13, 2025 14:24
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.55%. Comparing base (5441cc1) to head (cc1b1a4).

Additional details and impacted files
@@                             Coverage Diff                             @@
##           846_device_factory_support_for_ophyd_v1     #986      +/-   ##
===========================================================================
+ Coverage                                    97.51%   97.55%   +0.03%     
===========================================================================
  Files                                          148      148              
  Lines                                         6279     6299      +20     
===========================================================================
+ Hits                                          6123     6145      +22     
+ Misses                                         156      154       -2     

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

)


def flux(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> Flux:
@device_factory()
def flux(mock: bool = False) -> Flux:
"""Get the i04 flux device, instantiate it if it hasn't already been.
If this is called when already instantiated in i04, it will return the existing object.
"""
return device_instantiation(
Copy link
Contributor

Choose a reason for hiding this comment

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

Must: The objective of device_factory is to get rid of device_instantiation, this factory should use the Flux constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flux is an ophyd v1 device and is not yet converted to ophyd_async. See previous PR where ophyd v1 support was added to device_factory

@rtuck99 rtuck99 force-pushed the 846_update_mx_beamline_to_use_device_factory_part_2 branch from 53a47cc to cc1b1a4 Compare January 13, 2025 17:01
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