FAIRmat-NFDI / pynxtools-xps

A pynxtools reader plugin for X-ray photoelectron spectroscopy (XPS) data
https://fairmat-nfdi.github.io/pynxtools-xps/
Apache License 2.0
2 stars 0 forks source link

Clean up reader-mapper-parser infrastructure, use multiformat reader #19

Open lukaspie opened 4 months ago

lukaspie commented 4 months ago

Currently, the reader implements a three-layer structure:

The mappers are used for one file format (like the sle format from SPECS) and then I have a logic that calls a parser for a specific subsets of such files, e.g. depending on the software version that was used for this file. That allows me to keep functionality across different, yet very similar versions of a format by inheritance and abstract base classes.

All of those sub-classes could be readers themselvers, inheriting from our BaseReader class (or the MultiFormatReader developed in https://github.com/FAIRmat-NFDI/pynxtools/pull/250).

The file extension is often not unique, i.e., many vendors have a .txt export, but all the files are actually different. But this logic could probably be handled by passing a function in the extensions dict of the MultiFormatReader that does this. This is already being handled similary. And finally, there should be be a check that the file comes from the list of supported vendors.