Add vs00 timed variable string events#102
Add vs00 timed variable string events#102geishm-ansto wants to merge 2 commits intoess-dmsc:masterfrom
Conversation
|
Hi @geishm-ansto , we were thinking of doing something similar at ISIS - nexusformat/definitions#1432 by first adding a new nexus base class (then subsequently a flatbuffers schema here for EPICS string PV value updates) that adds support for strings in the same way NXLog works. I don't know if this fits your use case too? |
|
Hi @rerpha , it's possible that we could use it but I would need to see the details. At the moment we have implemented vs00 in a local ANSTO variant of the streaming data types and nxs writer but didn't want to add a different python package for reading the data type so raised the PR to see if there was any interest. We wanted to be able to capture system log messages during an experiment using a variable string format. |
|
For some reason we didn't get a notification on this - I'm adding a comment so that I am updated. But yes, the current issue is writing it out in a NeXusy way |
|
I was reminded about this today. Are either of you using this in the filewriter? I have worked with strings before in the modules there and it can be a bit difficult when using variable lengths. If there was an additional entry in the flatbuffer to specify size of the string it would be an improvement. It would also be good to know about use cases. |
|
@ggoneiESS Hi, we have a local Ansto branch of the filewriter and within that I have added support for the 'vs00' flatbuffer. We use it primarily to record logging events. It required adding a Variablestring class to the ExtensibleDataset component and a vs00 writer module. /// \brief /// \brief Append a new string to the dataset array private: VariableString::VariableString(const hdf5::node::Group &Parent, if (Mode::Create == CMode) { void VariableString::appendStringElement(std::string const &InString) { |
|
we aren't using it currently, but may do in the future for generic string diagnostic stuff, even if/when nexusformat/definitions#1590 is accepted and we make a new schema for SE strings. |
|
I have done a bit of a refresher, but haven't done a deep-dive into the implementation in hdf5 2.0.0 (we aren't using that yet but we will this year). I still worry a bit about the idea of variable-length strings. If this is used rarely (in comparison to e.g. detector data etc) it's not a big deal but:
And (academic but technical arguments)
Performance is definitely at a premium V storage. I found this via the HDF5 clinic - https://steven-varga.ca/blog/hdf5-fixed-vs-variable-benchmark/ and it provides a CPP file. It might be possible to incorporate into a filewriter test. |
|
I haven't quite forgotten about this! My writing objection wasn't very well thought through, there's no reason it needs to be part of the schema (it can be handled by kafka-to-nexus or whatever software), and it shouldn't affect message brokers (although it's perhaps advisable to keep message size down I'm not sure that needs to be recorded in the schema). I'm going to set up a proper workflow for this @ ESS; I assume we have implicit approval from:
|
|
@geishm-ansto two questions:
|
|
@ggoneiESS |
|
The Nexus standard itself doesn't actually support writing strings in an NXlog (see here - its We also need it at ISIS as we have string PVs that need to be written to a file. VS00 is probably fine for a short term fix for us, but it'd be nice if the nexus standard itself actually supported it too. |
|
@geishm-ansto this was before my time but let's then keep this separation - agreed about the modules and tests. They are indeed implemented 'under the hood' in a slightly different way, mostly because an e.g. uint16 is always an uint16, but a string is far more complicated. @rerpha it was because I am trying to work on some tooling and NXtextlog was failing (since it isn't actually merged yet) that made me think about this MR again. But we can have this in place already. |
Add a new flatbuffer description that is useful at ANSTO to support logging and variable strings in the nxs file writer.
The read me file was updated and there is no breaking changes.
Approval Criteria
This PR should not be merged until the ECDC Group Leader (acting or permanent) has given their explicit approval in the comments section.
SCIPP/DRAM should also be consulted on changes which may affect them.