Skip to content

Ticket 8846 reflectometry training updates#193

Open
KathrynBaker wants to merge 49 commits into
masterfrom
Ticket_8846_Reflectometry_training_updates
Open

Ticket 8846 reflectometry training updates#193
KathrynBaker wants to merge 49 commits into
masterfrom
Ticket_8846_Reflectometry_training_updates

Conversation

@KathrynBaker

Copy link
Copy Markdown
Member

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.

@rerpha rerpha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some initial comments after skimming through

from ReflectometryServer import *

```Python
from typing import Dict

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above


# Beamline Constants
NATURAL_ANGLE = 90
SM_Z = 20.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might make sense to use a pyright: ignore [rulename] so that the var doesn't need to be renamed - this might be clearer.

Comment on lines +42 to +51
| 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could probably be a load of caputs used from an EPICSTERM.bat

@KathrynBaker

Copy link
Copy Markdown
Member Author

Change made to not do this

@KathrynBaker

Copy link
Copy Markdown
Member Author

Correction, Dict no longer imported, updated the python to just use dict instead.


# Beamline Constants
NATURAL_ANGLE = 90
SM_Z = 20.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@KathrynBaker

Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants