Consider loading detectors and analyzers in a single provider each
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 3
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 17
Description
Currently, we load all detectors, detector data, and analyzers individually. This means that we have 45*3 distinct file accesses. This is useful when we only want to load a small subset of detectors. But it also causes problems:
- When using a threaded scheduler, there is high contention on the file which slows down the pipeline significantly. It is slower than a single threaded scheduler.
- The pipeline graph is very large and unreadable for all 45 detectors.
- We have to determine and specify the list of detector names when creating the workflow.
We keep the detectors separate for a bit but merge them all into a single data array eventually. I think we can fix all 3 issues by never even mapping the pipeline over detector names. We would have a provider similar to this:
DetectorNames[RunType] = list[DetectorName[RunType] | None
def load_all_detectors(
location: NeXusAllComponentLocationSpec[NXdetector, RunType],
detector_names: DetectorNames[RunType],
) -> NeXusComponent[NXdetector, RunType]: ...
where DetectorNames[RunType] defaults to None which means 'load all NXdetectors'. And similarly for analyzers and detector events.
This would still allow us to selectively load detectors but would simplify the normal case of loading all detectors. It would also reduce the size of the pipeline and would strongly reduce contention on the file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the current detector, detector-data, analyzer, and detector-event providers and the workflow construction that maps over detector names. Compare that structure with the proposed single-provider interfaces and verify that selective loading still works while the all-detectors case reduces file accesses, pipeline size, and threaded contention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100