Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Jun 27, 2025

After introducing the GenericTofWorkflow, the old dream.io.nexus.LoadNeXusWorkflow which reshaped detector banks was no longer used.

This PR removed that old nexus workflow, and re-implements bank reshaping in the new workflows.

We now have a DreamGenericWorkflow which is basically the GenericTofWorkflow with detector bank reshaping.
Then, the DreamPowderWorkflow and the DreamGeant4Workflow build on top of this workflow.

I did not have to touch the docs, so hopefully this means the API didn't change?

@nvaytet nvaytet requested a review from SimonHeybrock June 27, 2025 09:43
Comment on lines 7 to 23
from .generic import DreamGenericWorkflow
from .powder import (
DreamGeant4MonitorHistogramWorkflow,
DreamGeant4MonitorIntegratedWorkflow,
DreamGeant4ProtonChargeWorkflow,
DreamGeant4Workflow,
DreamPowderWorkflow,
)

__all__ = [
'DreamGeant4MonitorHistogramWorkflow',
'DreamGeant4MonitorIntegratedWorkflow',
'DreamGeant4ProtonChargeWorkflow',
'DreamGeant4Workflow',
'DreamGenericWorkflow',
'DreamPowderWorkflow',
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need this subfolder. Confusing why some workflows are in dream, others only in dream.workflows. Why not have everything in dream? We won't have 1000 workflows so I think that should be fine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I moved all the workflows into the workflows folder?
In any case, I don't mind putting everything back into the workflow.py file one level above, if you think that's better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment was about which you have in the respective __init__.py on the various levels. Also, we should avoid too much user-visible nesting, since it is just complicated and confusing.

)


def DreamGenericWorkflow() -> sciline.Pipeline:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DreamWorkflow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought having Generic in there made it a little more obvious that this should be used as a base for other workflows, but I guess in principle you can also use it on its own.
So I don't have a super strong opinion.

Comment on lines 76 to 77
Dream generic workflow with default parameters.
The workflow is based on the GenericTofWorkflow.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explain what it can do, i.e., load and compute Tof?

Comment on lines 179 to 190
def test_geant4_in_workflow(file_path, file):
wf = DreamGenericWorkflow()
for provider in geant4_providers:
wf.insert(provider)
wf[Filename[SampleRun]] = file_path
wf[NeXusDetectorName] = NeXusDetectorName("mantle")
wf[NeXusComponent[snx.NXsample, SampleRun]] = sc.DataGroup(
position=sc.vector([0.0, 0.0, 0.0], unit="mm")
)
pipeline[NeXusComponent[snx.NXsource, SampleRun]] = sc.DataGroup(
wf[NeXusComponent[snx.NXsource, SampleRun]] = sc.DataGroup(
position=sc.vector([-3.478, 0.0, -76550], unit="mm")
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is not using the Geant4 workflows, where these things are defined already?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change, thanks

@nvaytet nvaytet merged commit 9cbe154 into main Jul 1, 2025
4 checks passed
@nvaytet nvaytet deleted the reorganise-workflows branch July 1, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants