Ticket 8846 reflectometry training updates#193
Conversation
rerpha
left a comment
There was a problem hiding this comment.
some initial comments after skimming through
| from ReflectometryServer import * | ||
|
|
||
| ```Python | ||
| from typing import Dict |
There was a problem hiding this comment.
you can just use dict nowadays - no need to import typing.Dict
| ``` | ||
| - `from ReflectometryServer import *`: This is required to use classes and helper methods which are used to construct the model of the beamline | ||
|
|
||
| - `from typing import Dict` relates to the output of the function and the enforcement of typing via PyRight. |
|
|
||
| # Beamline Constants | ||
| NATURAL_ANGLE = 90 | ||
| SM_Z = 20.0 |
There was a problem hiding this comment.
normally on instruments we put these in a constants.py file. we might want to do the same here (and document it!)
note that the constant values go in this file (ie. usually it's just a load of CONST integers/floats) but the actual add_constant() call stays in this config file.
|
|
||
| ## Exercise 3 | ||
| ### 1. Create your modes | ||
| So far there has always been a mode `_nr`, without a mode the reflectometry server, but as this variable wasn't used there is an underscore to let Pyright know that it could be ignored. |
There was a problem hiding this comment.
it might make sense to use a pyright: ignore [rulename] so that the var doesn't need to be renamed - this might be clearer.
| | Axis | Galil 01 | Galil 02 | Galil 03 | | ||
| | -- | -- | -- | -- | | ||
| | 01 | Jaws 1, North | Detector Angle | Slit 1 Offset | | ||
| | 02 | Jaws 1, South | Detector Position | Slit 2 Offset | | ||
| | 03 | Jaws 1, East | Bench Front | | | ||
| | 04 | Jaws 1, West | Bench Back | | | ||
| | 05 | Jaws 2, North | Bench Slide | Sample Stack Translation | | ||
| | 06 | Jaws 2, South | Supermirror Position | Sample Stack Phi | | ||
| | 07 | Jaws 2, East | Supermirror Angle | Sample Stack Height/Offset | | ||
| | 08 | Jaws 2, West | Monitor | Sample Stack Psi | |
There was a problem hiding this comment.
this could probably be a load of caputs used from an EPICSTERM.bat
|
Change made to not do this |
|
Correction, Dict no longer imported, updated the python to just use dict instead. |
|
|
||
| # Beamline Constants | ||
| NATURAL_ANGLE = 90 | ||
| SM_Z = 20.0 |
There was a problem hiding this comment.
It was commented originally that these were usually in a separate file, I would rather keep them in one file for the training (which they were before) as there is more than enough moving around the system to worry about without that.
|
|
||
| ## Exercise 3 | ||
| ### 1. Create your modes | ||
| So far there has always been a mode `_nr`, without a mode the reflectometry server, but as this variable wasn't used there is an underscore to let Pyright know that it could be ignored. |
There was a problem hiding this comment.
It would make sense for a final file, but there needs to be an entry to load things, and is at this point that we make it available - this is aimed at scientists as well as programmers, and after this they should never need to ignore it again
|
Re the settings for the motors, yes, they could be dones as a load of command line items, but they also aren't necessary changes, and I'd rather encourage knowing the fictisous beamline than just have things blindly copied and done, which is the likely impact of just having a script to run. |
This is a rather large overhaul of how the training is worded and approached, especially the use of aspects that are needed for ruff/pyright, and clearer instructions for what to look for when making changes, at least on a surface level.