DiamondLightSource / httomo

High-throughput tomography pipeline
https://diamondlightsource.github.io/httomo/
Other
7 stars 4 forks source link

Sort out inconsistencies and oddities with the loader's YAML template and how a loader is referenced in a pipeline file #501

Open yousefmoazzam opened 1 month ago

yousefmoazzam commented 1 month ago

Current situation with the loader and its YAML template

The history of the loader YAML template is a bit weird, so it may be worth summarising here:

The situation we have now is that the YAML config for a loader is inconsistent with where the loader code is actually located (ie, it's in httomo.loaders.standard_tomo_loader rather than httomo.data.hdf.loaders, despite the config implying the latter).

Stuff to address (they're somewhat connected, rather than being totally independent problems)

Loader YAML template generation

Due to the block loader being a class and not a function, enabling the YAML template generator script to work with loaders which are classes and not functions will probably require some tweaks to it. For example, maybe by checking if httomo.loaders is part of the module path, loader config in the pipeline can be caught and then treated differently to methods (which are just functions)?

Referencing a loader in a pipeline file

The old loader (ie, the loader which didn't load individual blocks) in httomo.data.hdf.loaders is not used anymore, yet pipelines all reference httomo.data.hdf.loaders. To be consistent with how methods in a YAML pipeline file are referenced via their:

it would make sense to have the way to reference an httomo loader in a pipeline to be something like:

- method: StandardTomoLoader
  module_path: httomo.loaders.standard_tomo_loader