You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, we have started playing around with adding more and more search quantities in NOMAD (mostly in #525). In particular, this includes adding all NeXus attributes as NOMAD quantities (using the __<attribute_name> convention) and field aggregation statistics (using __mean, __var, etc.), with the idea of powering the search in the apps that we are developing.
However, we soon started running into some limitations. Most notably, the GUI becomes incredibly slow for groups that have lots of fields. A noteable example is the XPS example, where there are a lot of cycle and scan repititions in the default NXdata group (see image). Loading the data/data/ENTRY:0/data tab here takes up to 1 min due to a lag in the GUI. Similar situations are expected in descriptions of microstructures, with potentially millions of instances of the same concept.
So, we are faced with an issue: which search_quantities do we want to expose from the NeXus definitions in NOMAD. This issue is meant to summarize the current situation and suggested ideas and also to store any results coming from upcoming discussions on this, e.g. in the TF meetings.
One suggestion (made by @sanbrock and @rettigl) is that we only make those concepts that are specifically mentioned in the application definition available for search. That includes all required or recommended elements, but also those that are optional. But explicitly not those that are just defined in the base class that are inherited in the application definition.
Comments so far on this:
This could be a good solution, at least for now. We must consider that the appdefs will likely need to get more comprehensive to be usable in NOMAD and will probably blow up a bit. For MPES, Laurenz and I already started to mention more terms explicitly in the application definition (including all the AXISNAME and DATA fields in NXdata), see MPES: new concepts from NIAC discussions, searchable fields nexus_definitions#329.
It is a bit strange to make the contents of the appdef depend on how we want to use them in NOMAD. Of course, adding more optional elements (as done above) is not a problem, but it feels slightly backwards to build the appdef for an experimental technique based on the search and visualization capabilities of NOMAD.
If a new use case for an appdef comes up, where more concepts from the base classes are to be used, you would need to blow up the appdef even more or make an extension for it (like NXxps extending NXmpes), to allow for more search_quantities that are relevant for this new use case. The second option raises a problem/question which I have been asking myself for a while: If an appdef extends another one (think NXxps extending NXmpes), is it possible to add more elements or can they only specialize what is already in the sup-appdef. If I have an NXfit class in NXxps, but not in NXmpes, is a file that implements NXxps with a fit even compliant with NXmpes anymore?
There is an alternative proposed by @mkuehbach: we ship a "concept filtration configuration" with pynxtools that explicitly states for each application definition what the searchable quantities should be. This would be a yaml/json file that defines a selected set of elements you can search for. This may include all or some of the appdef concepts, but could also include some of those from the base classes.
Comments so far on this:
This is of course another abstraction layer that the user is not aware of and that makes it difficult to understand which elements are searchable for which appdef.
Whenever the application definition or base classes change, we also need to update these configurations.
Such configurations should probably be shipped with the main pynxtools, not with the reader plugins. This avoid conflicts that could arise for two plugins writing to the same appdef (pynxtools-mpes/xps both write to NXmpes) or a plugin that can touch many appdefs (like pynxtools-igor).
We use a similar option already for the configuration of the multiformat reader. These are JSON files that map concepts defined in the vendor specific files to the concepts in the appdef. For this, we have a CLI function that generates a template for a given application definition. We could likely reuse the python code of that script to give the default search_quantities config, i.e. all concepts defined in the appdef. This would then need to be customized.
Another option this approach could open up: we could use the same filter for exporting from NOMAD. That is, a pynxtools-adjacent tool takes an existent NeXus file/data archive in NOMAD and a filter map and exports a smaller NeXus file. Here we are adding to the macro issue in NOMAD that is about exporting from NOMAD, but more than just download that file .
We could also go for a combination of the two approaches: for specific appdefs (i.e., the ones designed by FAIRmat) you have a "concept filtration configuration", whereas for the other application definition you can only search for what is in the appplication definition itself (this would be the default).
Further comments:
Regarding the aggretation statistics, in order to not increase the number of quantities, we could bring NeXus fields to NOMAD as subsections. This was indeed implemented in the first version of the NexusParser as there was no support for attributes). So, we could make a subsection for each number quantity like 'energy__field' . This subsection would contain all its stats. And all its attributes we could also bring here as Quantities.
Sorry for the wall of text, but I just wanted to summarize the current situation accurately. Looking for input here and in the upcoming TF meetings. @FAIRmat-NFDI/areab
Recently, we have started playing around with adding more and more search quantities in NOMAD (mostly in #525). In particular, this includes adding all NeXus attributes as NOMAD quantities (using the
__<attribute_name>convention) and field aggregation statistics (using__mean,__var, etc.), with the idea of powering the search in the apps that we are developing.However, we soon started running into some limitations. Most notably, the GUI becomes incredibly slow for groups that have lots of fields. A noteable example is the XPS example, where there are a lot of cycle and scan repititions in the default
NXdatagroup (see image). Loading thedata/data/ENTRY:0/datatab here takes up to 1 min due to a lag in the GUI. Similar situations are expected in descriptions of microstructures, with potentially millions of instances of the same concept.So, we are faced with an issue: which
search_quantitiesdo we want to expose from the NeXus definitions in NOMAD. This issue is meant to summarize the current situation and suggested ideas and also to store any results coming from upcoming discussions on this, e.g. in the TF meetings.One suggestion (made by @sanbrock and @rettigl) is that we only make those concepts that are specifically mentioned in the application definition available for search. That includes all required or recommended elements, but also those that are optional. But explicitly not those that are just defined in the base class that are inherited in the application definition.
Comments so far on this:
AXISNAMEandDATAfields inNXdata), see MPES: new concepts from NIAC discussions, searchable fields nexus_definitions#329.NXxpsextendingNXmpes), to allow for moresearch_quantitiesthat are relevant for this new use case. The second option raises a problem/question which I have been asking myself for a while: If an appdef extends another one (thinkNXxpsextendingNXmpes), is it possible to add more elements or can they only specialize what is already in the sup-appdef. If I have anNXfitclass inNXxps, but not inNXmpes, is a file that implementsNXxpswith a fit even compliant withNXmpesanymore?There is an alternative proposed by @mkuehbach: we ship a "concept filtration configuration" with pynxtools that explicitly states for each application definition what the searchable quantities should be. This would be a yaml/json file that defines a selected set of elements you can search for. This may include all or some of the appdef concepts, but could also include some of those from the base classes.
Comments so far on this:
pynxtools-mpes/xpsboth write toNXmpes) or a plugin that can touch many appdefs (likepynxtools-igor).We could also go for a combination of the two approaches: for specific appdefs (i.e., the ones designed by FAIRmat) you have a "concept filtration configuration", whereas for the other application definition you can only search for what is in the appplication definition itself (this would be the default).
Further comments:
Sorry for the wall of text, but I just wanted to summarize the current situation accurately. Looking for input here and in the upcoming TF meetings. @FAIRmat-NFDI/areab