-
Notifications
You must be signed in to change notification settings - Fork 0
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of Scan component #4
Conversation
d3de875
to
3dacf2f
Compare
5b3116b
to
460d717
Compare
src/extra/components/scan.py
Outdated
from datetime import timedelta | ||
|
||
import numpy as np | ||
from xarray import DataArray |
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.
xarray
is really slow to import and can take up to 10s of seconds especially from GPFS environments. Unlike in most other places it does look like this component will always use it, but since it's imported alongside any other component, I would prefer a lazy import.
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.
Sure, fixed in 7f69671.
src/extra/components/scan.py
Outdated
min_trains (int): The minimum number of trains per-step in the scan. It | ||
will be guessed if not passed explicitly. | ||
""" | ||
self._name = "motor" |
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.
When an xarray.DataArray
is passed, it may be nice to set this argument manually via an optional argument or try to take it from the DataArray
's name (KeyData.xarray()
will set this to {source}.{key}
by default).
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.
Ah nice, didn't know about DataArray.name
. Added in 7f69671.
I rebased the branch, added some tests, and cleaned up the code a bit. Still not quite happy with it so I'm gonna leave it as a draft for now. |
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 gave it a try for a demo in the FXE workshop, and it worked beautifully. Doing so I found a few minor usability improvements, but this component is frankly awesome.
Rebased and fixed a few things, but there's one more issue with noisy data (noticed in the FXE demo) I want to fix before this is ready for review. |
I was also wondering whether the fixtures could directly return the |
4f51926
to
68bd630
Compare
Ok, I think this is ready for review now. Recent changes:
|
(if there's no objections I'll probably merge this at the end of next week) |
LGTM! One additional idea I got while remaking the XAS demo on top of
|
The problem with using slices is that they'll include any trains that are filtered out within the steps. My inclination is to stick with lists of train IDs, but then again I don't think I've seen any scans that have jumps within the steps 馃 Lemme think about that. |
Oh certainly, but I don't think it's that much of a deal, and slices would be there for convenience anyway. We could have an optional |
There's actually none that I can think of, the original reason I did it that way is to be on the safe side in case there was some badly behaving motor (or other device). But I've never seen it happen so it's probably safe to assume that we always want all trains within a step, or make that the default behaviour at least. |
We always end up converting it to one anyway.
I tried to switch to |
Leaving this as a draft for now because I still need to write tests, but y'all are welcome to try it on real data to make sure I'm not missing something obvious 馃槄
Known issues (that may or may not be fixed in the future):