scipp / beamlime

Live data reduction visualisation for ESS
https://scipp.github.io/beamlime/
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Insert event data into nexus structure by data assembling handler. #183

Closed YooSunYoung closed 5 months ago

YooSunYoung commented 6 months ago

Continued from #177 Fixes #134

Main Changes

Handler, DataAssembler receives raw data messages (for now only ev44 and it doesn't matter if it's fake or not) and use NexusContainer to assemble them into the whole nexus structure and send the assembled nexus structure to the message router again.

_nexus_helpers.replace_subdataset create a shallow copy from root, to the point of insertion so that the previously assembled dictionary is not affected by the update.

In order to update the nexus structure (in this case, dictionary) without affecting the previous data, there are helper functions for handling/filtering nested dictionary/list and validating the whole structure.

Following-up Issues

For now, NexusContainer.insert_ev44 method only replaces the data, but since it is now shallow copying the original structure, it is not guaranteed that the DataAssembler is looking at the latest data if they are being appended, not replaced. Related issue: #182.

And I expected DataAssembler will later take care of merging multiple messages by simply concatenating them or using the average. Related issue: #133