-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
==========================================
+ Coverage 95.20% 96.42% +1.21%
==========================================
Files 120 116 -4
Lines 4984 4889 -95
==========================================
- Hits 4745 4714 -31
+ Misses 239 175 -64 ☔ View full report in Codecov by Sentry. |
e865779
to
cb9d72d
Compare
@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. |
How far does 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(),
) |
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. |
ecab867
to
5e2187e
Compare
28b38d4
to
dab2061
Compare
b79dc80
to
70d923b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone who has never used the ADSim
before I think this needs some more info. Ideally I would like a few system tests that spawn the ADSim
and run some stuff tests against it using these files. If this is out of scope then I would at least like some documentation at the top of adsim.py
pointing to how I would get started using the ADSim
(and an issue to do the proper tests).
src/dodal/beamlines/adsim.py
Outdated
from pathlib import Path | ||
|
||
from ophyd_async.epics.adsimdetector import SimDetector | ||
|
||
from dodal.common.beamlines.beamline_utils import ( | ||
device_instantiation, | ||
get_path_provider, | ||
set_path_provider, | ||
) | ||
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline | ||
from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider | ||
from dodal.devices.adsim import SimStage | ||
from dodal.log import set_beamline as set_log_beamline | ||
from dodal.utils import get_hostname | ||
|
||
BL = get_hostname() | ||
set_log_beamline(BL) | ||
set_utils_beamline(BL) | ||
|
||
set_path_provider( | ||
StaticVisitPathProvider( | ||
BL, | ||
Path("/scratch/adsim/bluesky"), | ||
client=LocalDirectoryServiceClient(), | ||
) | ||
) | ||
|
||
""" | ||
Usage Example | ||
------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs explanation what adsim is, link do docs maybe
class AdAravisDetector(SingleTriggerV33, DetectorBase): | ||
cam = Cpt(SynchronisedAdDriverBase, suffix="DET:") | ||
hdf = Cpt( | ||
Hdf5Writer, | ||
suffix="HDF5:", | ||
root="", | ||
write_path_template="", | ||
) | ||
_priming_settings: Mapping[Signal, Any] | ||
|
||
def __init__(self, *args, **kwargs) -> None: | ||
super().__init__(*args, **kwargs) | ||
self.hdf.kind = "normal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is AdAravis
related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AdSim was a final remaining "used" ophyd device in this module, so with it being deleted the whole module may as well be removed.
@ZohebShaikh re: discussion on docs and use: since the AD sim that we use on workstations isn't going to be containerised or available in exactly the same form outside of Diamond anytime soon, CF and I discussed and we can instead back it with the example Simulation Beamline that is spun up by EC: https://epics-containers.github.io/main/tutorials/launch_example.html It has fewer axes, but still has a camera and should be possible to run up from anywhere with the tutorial. Please walk through the tutorial for this and alter the beamline to connect to these devices! |
found a bug, possibly with #841 that when in ipython context a device does not connect while in the from a debugging session with @DiamondJoseph |
Fixes #404
Instructions to reviewer on how to test:
EPICS_CA_SERVER_PORT=6064
,EPICS_CA_REPEATER_PORT=6065
e.g. RE(count([adsim])), RE(scan([adsim], sim_motors.x, 0, 1, 5))
Checks for reviewer