-
Notifications
You must be signed in to change notification settings - Fork 12
Implement concrete analyser classes for beamlines to remove generics #1821
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
oliwenmandiamond
wants to merge
41
commits into
main
Choose a base branch
from
Implement_concrete_analyser_classes_for_beamlines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 29 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
4ed70ec
Implement concrete analyser classes for beamlines to remove generics
oliwenmandiamond e10fd04
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 7b8b811
Add i09_1 specs model
oliwenmandiamond fd65ea6
Add device args
oliwenmandiamond b1bbbfb
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond bb03340
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 6a9465d
Fix lint
oliwenmandiamond 146163c
Reorder DeviceManager placement for P60
oliwenmandiamond 0c08873
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 04a0371
Removed VGScienta and Specs Detector. Moved this
oliwenmandiamond e31edfe
Fix tests
oliwenmandiamond ecc4d7b
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond c5063d0
Add doc string to EW4000
oliwenmandiamond 66ce50b
Add missing classes from __init__
oliwenmandiamond 76405c2
Merge branch 'Implement_concrete_analyser_classes_for_beamlines' of s…
oliwenmandiamond ec6d817
Add psu_mode_suffix option to driver to fix i09 and p60 connection fail
oliwenmandiamond 60804b9
Renamed sequence functions
oliwenmandiamond d95a95f
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 1264e9a
Add comment linking bluesky issue
oliwenmandiamond dac774f
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 7db944a
Update outdated doc string
oliwenmandiamond 46e7b3d
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 9e1108e
Merge into main
oliwenmandiamond 5d2bde2
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond e470d24
Rename driver to drv
oliwenmandiamond 8cab29c
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond a72ec1c
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 714195b
Merge branch 'Implement_concrete_analyser_classes_for_beamlines' of s…
oliwenmandiamond 78cfb7f
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond 2d85839
Merge branch 'main' into Implement_concrete_analyser_classes_for_beam…
oliwenmandiamond cb912ea
Merge branch 'Implement_concrete_analyser_classes_for_beamlines' of s…
oliwenmandiamond 95aae82
Update the device names
oliwenmandiamond 360419c
Fix tests
oliwenmandiamond b358266
Remove temp drv variable from analyser
oliwenmandiamond 59d30c8
ElectronAnalyser no longer depends directly on sequence file path to …
oliwenmandiamond 7d4d359
Merge branch 'main' into analyser_works_with_blueapi
oliwenmandiamond 0a54935
Merge branch 'analyser_works_with_blueapi' into Implement_concrete_an…
oliwenmandiamond ef6b7d3
Fix tests
oliwenmandiamond 3075079
Improve type checking
oliwenmandiamond 9c2887e
Move PsuMode to B07 shared, improve type checking
oliwenmandiamond 92aab6b
Merge branch 'analyser_works_with_blueapi' into Implement_concrete_an…
oliwenmandiamond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,4 +1,20 @@ | ||
| from .analyser import ( | ||
| B07ElectronAnalyserController, | ||
| B07SpecsAnalyserDriverIO, | ||
| B07SpecsRegion, | ||
| B07SpecsSequence, | ||
| Specs2DCMOS, | ||
| ) | ||
| from .b07_motors import B07SampleManipulator52B | ||
| from .enums import Grating, LensMode, PsuMode | ||
| from .enums import Grating, LensMode | ||
|
|
||
| __all__ = ["B07SampleManipulator52B", "Grating", "LensMode", "PsuMode"] | ||
| __all__ = [ | ||
| "B07ElectronAnalyserController", | ||
| "B07SpecsAnalyserDriverIO", | ||
| "B07SpecsRegion", | ||
| "B07SpecsSequence", | ||
| "Specs2DCMOS", | ||
| "B07SampleManipulator52B", | ||
| "Grating", | ||
| "LensMode", | ||
| ] |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| from dodal.devices.beamlines.b07.enums import LensMode | ||
| from dodal.devices.beamlines.b07_shared.enums import PsuMode | ||
| from dodal.devices.electron_analyser.base.base_controller import ( | ||
| ElectronAnalyserController, | ||
| ) | ||
| from dodal.devices.electron_analyser.base.base_detector import ElectronAnalyserDetector | ||
| from dodal.devices.electron_analyser.base.energy_sources import EnergySource | ||
| from dodal.devices.electron_analyser.specs import ( | ||
| SpecsAnalyserDriverIO, | ||
| SpecsRegion, | ||
| SpecsSequence, | ||
| ) | ||
| from dodal.devices.fast_shutter import FastShutter | ||
|
|
||
| B07SpecsRegion = SpecsRegion[LensMode, PsuMode] | ||
| B07SpecsSequence = SpecsSequence[LensMode, PsuMode] | ||
|
|
||
|
|
||
| class B07SpecsAnalyserDriverIO(SpecsAnalyserDriverIO): | ||
| def __init__(self, prefix: str, name: str = ""): | ||
| super().__init__(prefix, LensMode, PsuMode, name) | ||
|
|
||
|
|
||
| B07ElectronAnalyserController = ElectronAnalyserController[ | ||
| B07SpecsAnalyserDriverIO, B07SpecsRegion | ||
| ] | ||
|
|
||
|
|
||
| class Specs2DCMOS(ElectronAnalyserDetector[B07SpecsAnalyserDriverIO, B07SpecsRegion]): | ||
| def __init__( | ||
| self, | ||
| prefix: str, | ||
| energy_source: EnergySource, | ||
| shutter: FastShutter | None = None, | ||
| name: str = "", | ||
| ): | ||
| drv = B07SpecsAnalyserDriverIO(prefix) | ||
| controller = B07ElectronAnalyserController(drv, energy_source, shutter) | ||
| super().__init__(controller, name) | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| from dodal.devices.beamlines.b07_1.enums import LensMode | ||
| from dodal.devices.beamlines.b07_shared.enums import PsuMode | ||
| from dodal.devices.electron_analyser.base.base_controller import ( | ||
| ElectronAnalyserController, | ||
| ) | ||
| from dodal.devices.electron_analyser.base.base_detector import ElectronAnalyserDetector | ||
| from dodal.devices.electron_analyser.base.energy_sources import EnergySource | ||
| from dodal.devices.electron_analyser.specs import ( | ||
| SpecsAnalyserDriverIO, | ||
| SpecsRegion, | ||
| SpecsSequence, | ||
| ) | ||
| from dodal.devices.fast_shutter import FastShutter | ||
|
|
||
| B071SpecsRegion = SpecsRegion[LensMode, PsuMode] | ||
| B071SpecsSequence = SpecsSequence[LensMode, PsuMode] | ||
|
|
||
|
|
||
| class B071SpecsAnalyserDriverIO(SpecsAnalyserDriverIO): | ||
|
fajinyuan marked this conversation as resolved.
Outdated
|
||
| def __init__(self, prefix: str, name: str = ""): | ||
| super().__init__(prefix, LensMode, PsuMode, name) | ||
|
|
||
|
|
||
| B071ElectronAnalyserController = ElectronAnalyserController[ | ||
| B071SpecsAnalyserDriverIO, B071SpecsRegion | ||
| ] | ||
|
|
||
|
|
||
| class SpecsPhoibos( | ||
|
oliwenmandiamond marked this conversation as resolved.
Outdated
|
||
| ElectronAnalyserDetector[B071SpecsAnalyserDriverIO, B071SpecsRegion] | ||
| ): | ||
| def __init__( | ||
| self, | ||
| prefix: str, | ||
| energy_source: EnergySource, | ||
| shutter: FastShutter | None = None, | ||
| name: str = "", | ||
| ): | ||
| drv = B071SpecsAnalyserDriverIO(prefix) | ||
| controller = B071ElectronAnalyserController(drv, energy_source, shutter) | ||
| super().__init__(controller, name) | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from .enums import PsuMode | ||
|
|
||
| __all__ = ["PsuMode"] |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| from ophyd_async.core import SupersetEnum | ||
|
|
||
|
|
||
| class PsuMode(SupersetEnum): | ||
| V3500 = "3.5kV" | ||
| V1500 = "1.5kV" | ||
| V400 = "400V" | ||
| V100 = "100V" | ||
| V10 = "10V" | ||
| # This is connected to the device separately and will only have "Not connected" as | ||
| # option if disconnected. Once it is connected, "Not connected" is replaced with the | ||
| # options above. This is also why this must be a SupersetEnum. | ||
| NOT_CONNECTED = "Not connected" |
This file contains hidden or 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,3 +1,20 @@ | ||
| from dodal.devices.beamlines.i09.enums import Grating, LensMode, PassEnergy, PsuMode | ||
| from .analyser import ( | ||
| EW4000, | ||
| I09ElectronAnalyserController, | ||
| I09VGScientaAnalyserDriverIO, | ||
| I09VGScientaRegion, | ||
| I09VGScientaSequence, | ||
| ) | ||
| from .enums import Grating, LensMode, PassEnergy, PsuMode | ||
|
|
||
| __all__ = ["Grating", "LensMode", "PsuMode", "PassEnergy"] | ||
| __all__ = [ | ||
| "EW4000", | ||
| "I09ElectronAnalyserController", | ||
| "I09VGScientaAnalyserDriverIO", | ||
| "I09VGScientaRegion", | ||
| "I09VGScientaSequence", | ||
| "Grating", | ||
| "LensMode", | ||
| "PsuMode", | ||
| "PassEnergy", | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.