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

Update AdSim devices and configuration to use ophyd-async #405

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DiamondJoseph
Copy link
Contributor

Fixes #404

Instructions to reviewer on how to test:

  1. Run AdSimulator on workstation
  2. Run the device factory functions and confirm they connect to the devices
  3. run a simple scan with the device axes to confirm they run

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

@DiamondJoseph DiamondJoseph marked this pull request as draft April 2, 2024 12:33
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.77%. Comparing base (ac220bb) to head (dab2061).

Files Patch % Lines
src/dodal/devices/areadetector/adsim.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
+ Coverage   94.43%   94.77%   +0.34%     
==========================================
  Files         112      112              
  Lines        4531     4540       +9     
==========================================
+ Hits         4279     4303      +24     
+ Misses        252      237      -15     

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

@stan-dot
Copy link
Contributor

stan-dot commented Jul 9, 2024

@Relm-Arrowny you've done some simulation work for p99 afaik, how useful is this PR?

@Relm-Arrowny
Copy link
Contributor

@Relm-Arrowny you've done some simulation work for p99 afaik, how useful is this PR?

It nice to have, at the moment I either use fake or something from bluesky.sim so being able to just add area detector without thinking about it would save time.

@DiamondJoseph
Copy link
Contributor Author

How far does fake_with_ophyd_sim get you? Do you need something that is capable of writing files?

e.g.

def det(
    wait_for_connection: bool = True, fake_with_ophyd_sim: bool = True
) -> AravisDetector:
    return device_instantiation(
        AravisDetector,
        "det",
        "-EA-MAP-01:",
        wait_for_connection,
        fake_with_ophyd_sim,
        directory_provider=get_directory_provider(),
    )

@Relm-Arrowny
Copy link
Contributor

How far does fake_with_ophyd_sim get you? Do you need something that is capable of writing files?

It got me as far as getting arming/trigger to work so I can use it to test plans and emitted the right docs. This is an example of what I do atm.
As for writing file, I am not sure, atm I am not concern about writing files but I can see I may in the future.

@ZohebShaikh ZohebShaikh force-pushed the adsim_async branch 2 times, most recently from ecab867 to 5e2187e Compare August 12, 2024 11:29

class AdSimDetector(StandardDetector, HasHints):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@ZohebShaikh ZohebShaikh Aug 12, 2024

Choose a reason for hiding this comment

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

https://github.com/bluesky/ophyd-async/blob/ce3b85ded7811843d7c984a4911c5799ff05eb55/src/ophyd_async/epics/demo/demo_ad_sim_detector.py#L10

This is the only place sim_detector is present and it is not exported

Should I increase the version of ophyd_async but it will be a big change

ophyd-version is 0.3.4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I didn't realise that we hadn't updated to ophyd-async yet. Let's find out who's doing that.

src/dodal/devices/adsim.py Outdated Show resolved Hide resolved
tests/common/beamlines/test_device_instantiation.py Outdated Show resolved Hide resolved
src/dodal/beamlines/adsim.py Outdated Show resolved Hide resolved
@ZohebShaikh ZohebShaikh marked this pull request as ready for review August 12, 2024 13:30
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.

Update adsim to ophyd_async
4 participants