Xiaoya refactor block - #76
Conversation
We really should bump tiled up to 0.2.8 or greater to be compatible with modern tiled. |
dylanmcreynolds
left a comment
There was a problem hiding this comment.
In pyproject.toml, what would you think of adding tiled[client]==0.2.8 to the arroyo dependency list? Then we could more surely know what tiled we have, rather than have it sneak in from arroyoysas
dylanmcreynolds
left a comment
There was a problem hiding this comment.
it the settings.yml file in the root still needed anymore?
taxe10
left a comment
There was a problem hiding this comment.
Changes look good. At a high-level, do we still need to make a distinction between scattering and XPS beyond the configuration files? Would it be possible to maintain a single LSE operator regardless of the technique (assuming that the input is a 2D frame ofc)?
Nope. I just remove it. And I also remove |
Thanks for your review. At the moment, we need to distinguish between SAS and XPS because the listeners and publishers are different. For SAS (e.g., at NSLS-II), we use a For Timepix/LabVIEW XPS experiments, arroyoxps sends WebSocket messages that include only the image. The Because of this, the workflows are different. I’m wondering what Dylan’s @dylanmcreynolds plan is for refactoring this in the long term. |
|
Thanks for clarifying @xiaoyachong If I understood correctly, if If that’s not feasible at this stage, I wonder if it might be worth moving away from naming these paths based on experimental techniques (SAS vs XPS). The current distinction seems to stem more from differences in the data ingestion/publishing pipeline (e.g., whether the image is already persisted in Tiled and how events are constructed) rather than the technique itself. Framing this in terms of the publisher/listener behavior might make the abstraction a bit clearer and more extensible long-term. Also curious what @dylanmcreynolds thoughts are regarding this. Follow-up comment below - there may be a confusion |
|
Actually - just to clarify my previous comment a bit further. I saw there was an |
Sure. I just upgrade |
Sure. I add it to arroyo dependency list. |
Yes, I removed the unused It seems I misunderstood your message earlier—I thought you were referring to the workflows between SAS and XPS being different. |
Thanks for your suggestion. I think moving the |
dylanmcreynolds
left a comment
There was a problem hiding this comment.
If I understood correctly, if
arroyoxpswere to write to Tiled and send both the image and the Tiled URL, then in principle we could unify this into a single LSE operator, since the downstream interface (RawFrameEvent) would be consistent.
Tanny, this is feasible in the timepix case at XPS, but not the bassler case. splash_timepix code is creating the heatmap, while arroyXPS has a step that creates it for bassler. This is being a little pedantic though, since I think we can now assume timeepix. So, I love your suggestion.
Shall we move the At the moment, we write averaged heatmaps in the current structure. Once |
I refactored the LSE code to follow the arroyopy block format. The idea is to use a

xx.yamlfile to define the operator, listener, and publisher, so we can removeapp_xps.py/app.pyand start the server usingarroyo run xx.yaml. I tested this with splash_timpix simulator andarroyoXPSon my end, and it works well.A few issues for this PR:
For writing vector results to Tiled (
TiledResultsPublisher), I previously userewriteimmediately. I change it toappend_partition, similar aspatchused inXPSTiledLocalImagePublisher. Here is the reference code: append a table/patch an array.I also opened a companion PR for arroyopy, because it does not call
start()in the publisher. This causes an issue forLSEWSResultPublisher, since it connects to the WebSocket listener (LSE) in itsstart()method.I didn't move
arroyo_reductionout of LSE. If we move it into both arroyosas and arroyoxps, we would end up with duplicated copies in each repo, which may not be ideal. A better solution might be to create a separate repository (e.g., ArroyoLSE) in the future.There is a mismatch between the scan names sent from LabVIEW (
temp name {uuid.uuid4()}) and Timepix (acquisition_YYYYMMDDTHHMMSSZ_<uuid8>). To make the WebSocket listener work for both formats, I added a temporary fix: if a 36-character UUID is present inscan_name, use it directly; otherwise, generate a new one. A future improvement would be to update splash_timepix to senduuid.uuid4()as the scan name. This is necessary because previous SAS and XPS LabVIEW experiments all useuuid.uuid4()as the scan name in theTiledURL.