Improve pipeline.writer.WriterManager
Nabu uses a wrapper on top on various tomoscan XXVolume
: pipeline.writer.WriterManager
.
Using tomoscan volumes solves quite a few things in term of API, but there are still multiple issues:
- When using HDF5, we still have to do
self.file_prefix += str("_%05d" % self.start_index)
because we are writing partial files. This should be done by tomoscan but it's likely incompatible with its current architecture -
_configure_metadata()
is too long, and somehow duplicates what is done inLegacyNXProcessWriter
. -
LegacyNXProcessWriter
still has to be used for writing 1D data (histogram)
Generally speaking, the design is shaky:
-
WriterManager
tries to use directlyXXVolume
classes from tomoscan, but there are still many corner case and code to handle it - In some cases (histogram and .vol), using tomoscan directly is not possible, which entails even more specialized code
A more proper way of doing things would be:
- Define one writer per file type, with the same API, as it was done by
nabu.io.writer
- Each writer can be backed by tomoscan volume
-
WriterManager
does minimal things to assemble them and dispatch parameters
Edited by Pierre Paleo