-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dodal git dependency * Add initial dodal device loading to context * Allow only dodal style device modules * Allow list of device and plan sources * Enable context to search multiple modules for devices and plans * Update to use dodal function format * Add checking when adding devices to context * Update p45 config to use dodal * Update adsim.yaml to use multiple sources * Update worker config for multiple sources * Add module loading tests for context DiamondLightSource/python3-pip-skeleton#127 * Correct ignore pre-commit comment * Make module name qualification explicit * Swap typedict for basemodel in config * Test device functions with dependencies * Make source type an enum * Allocate device and plan adding based on source kind * Change source type to kind * Remove unused imports * Make test context use default environment config * Update source format * Update enum case to abide by pep8 * Update dodal dependency format * Exclude dodal from lockfile Avoids current skeleton bug, DiamondLightSource/python3-pip-skeleton#127.
- Loading branch information
Showing
17 changed files
with
208 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
env: | ||
startupScript: blueapi.startup.adsim | ||
sources: | ||
- kind: deviceFunctions | ||
module: blueapi.startup.adsim | ||
- kind: planFunctions | ||
module: blueapi.startup.adsim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
env: | ||
startupScript: blueapi.startup.bl45p | ||
sources: | ||
- kind: dodal | ||
module: dodal.p45 | ||
- kind: planFunctions | ||
module: blueapi.plans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,74 @@ | ||
from ophyd.sim import Syn2DGauss, SynGauss, SynSignal | ||
|
||
from blueapi.plans import * # noqa: F401, F403 | ||
|
||
from .simmotor import BrokenSynAxis, SynAxisWithMotionEvents | ||
|
||
x = SynAxisWithMotionEvents(name="x", delay=1.0, events_per_move=8) | ||
y = SynAxisWithMotionEvents(name="y", delay=3.0, events_per_move=24) | ||
z = SynAxisWithMotionEvents(name="z", delay=2.0, events_per_move=16) | ||
theta = SynAxisWithMotionEvents( | ||
name="theta", delay=0.2, events_per_move=12, egu="degrees" | ||
) | ||
x_err = BrokenSynAxis(name="x_err", timeout=1.0) | ||
sample_pressure = SynAxisWithMotionEvents( | ||
name="sample_pressure", delay=30.0, events_per_move=128, egu="MPa", value=0.101 | ||
) | ||
sample_temperature = SynSignal( | ||
func=lambda: ((x.position + y.position + z.position) / 1000.0) + 20.0, | ||
|
||
def x(name="x") -> SynAxisWithMotionEvents: | ||
return SynAxisWithMotionEvents(name=name, delay=1.0, events_per_move=8) | ||
|
||
|
||
def y(name="y") -> SynAxisWithMotionEvents: | ||
return SynAxisWithMotionEvents(name=name, delay=3.0, events_per_move=24) | ||
|
||
|
||
def z(name="z") -> SynAxisWithMotionEvents: | ||
return SynAxisWithMotionEvents(name=name, delay=2.0, events_per_move=16) | ||
|
||
|
||
def theta(name="theta") -> SynAxisWithMotionEvents: | ||
return SynAxisWithMotionEvents( | ||
name=name, delay=0.2, events_per_move=12, egu="degrees" | ||
) | ||
|
||
|
||
def x_err(name="x_err") -> BrokenSynAxis: | ||
return BrokenSynAxis(name=name, timeout=1.0) | ||
|
||
|
||
def sample_pressure(name="sample_pressure") -> SynAxisWithMotionEvents: | ||
return SynAxisWithMotionEvents( | ||
name=name, delay=30.0, events_per_move=128, egu="MPa", value=0.101 | ||
) | ||
|
||
|
||
def sample_temperature( | ||
x: SynAxisWithMotionEvents, | ||
y: SynAxisWithMotionEvents, | ||
z: SynAxisWithMotionEvents, | ||
name="sample_temperature", | ||
) | ||
image_det = Syn2DGauss( | ||
) -> SynSignal: | ||
return SynSignal( | ||
func=lambda: ((x.position + y.position + z.position) / 1000.0) + 20.0, | ||
name=name, | ||
) | ||
|
||
|
||
def image_det( | ||
x: SynAxisWithMotionEvents, | ||
y: SynAxisWithMotionEvents, | ||
name="image_det", | ||
motor0=x, | ||
motor_field0="x", | ||
motor1=y, | ||
motor_field1="y", | ||
center=(0, 0), | ||
Imax=1, | ||
labels={"detectors"}, | ||
) | ||
current_det = SynGauss( | ||
) -> Syn2DGauss: | ||
return Syn2DGauss( | ||
name=name, | ||
motor0=x, | ||
motor_field0="x", | ||
motor1=y, | ||
motor_field1="y", | ||
center=(0, 0), | ||
Imax=1, | ||
labels={"detectors"}, | ||
) | ||
|
||
|
||
def current_det( | ||
x: SynAxisWithMotionEvents, | ||
name="current_det", | ||
motor=x, | ||
motor_field="x", | ||
center=0.0, | ||
Imax=1, | ||
labels={"detectors"}, | ||
) | ||
) -> SynGauss: | ||
return SynGauss( | ||
name=name, | ||
motor=x, | ||
motor_field="x", | ||
center=0.0, | ||
Imax=1, | ||
labels={"detectors"}, | ||
) |
Empty file.
Oops, something went wrong.