-
Notifications
You must be signed in to change notification settings - Fork 12
breaking up i10 config into smaller python files #1861
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
base: main
Are you sure you want to change the base?
Conversation
…ghtSource/dodal into 1810-break_up_config_in_python
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1861 +/- ##
==========================================
+ Coverage 99.07% 99.09% +0.01%
==========================================
Files 297 317 +20
Lines 11298 11480 +182
==========================================
+ Hits 11194 11376 +182
Misses 104 104 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
oliwenmandiamond
left a comment
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.
I don't think we need to set logging and beamline for every single device file.
I also really dislike needing to define PREFIX 20 times for each device file. However, we also cannot add it into i10.py and then import as then we would have a circular import
The only solution that I can think of is we define
i10.py
i10_prefix.py
and then have i10 and i10/devices/my_device.py import from i10_prefix.py
I also don't think this is layed out correctly.
You should have i10.py, i10_1.py and i10_shared.py
Anything that is shared between endstation lives in shared, e.g the insertion device, shared diagnostics, shared mirrors etc.That way when looking at a beamline, it is very clear what is specific to this end station, e.g i10? Everything defined in i10.py. What is shared between end stations? Everything in i10_shared. It will make supporting and maintaining much easier.
|
I think maybe a solution to this would be to define e.g def prefix() -> BeamLinePrefix:
bl = get_beamline_name("iXX")
return BeamlinePrefix(bl, suffix=suffix)then have every device expect |
|
@oliwenmandiamond I don't disagree, I was just thinking about grouping devices so share was a after thought, I will fix them if we decide to go down this route. it was mostly copy and paste hence all the |
Fixes #ISSUE
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}