-
Notifications
You must be signed in to change notification settings - Fork 2
Add workflow helper #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments:
src/ess/dream/__init__.py
Outdated
| def default_parameters() -> dict: | ||
| # QUantities not available in the simulated data | ||
| sample = sc.DataGroup(position=sc.vector([0.0, 0.0, 0.0], unit="mm")) | ||
| source = sc.DataGroup(position=sc.vector([-3.478, 0.0, -76550], unit="mm")) | ||
| charge = sc.scalar(1.0, unit="µAh") | ||
| return { | ||
| RawSample[SampleRun]: sample, | ||
| RawSample[VanadiumRun]: sample, | ||
| RawSource[SampleRun]: source, | ||
| RawSource[VanadiumRun]: source, | ||
| AccumulatedProtonCharge[SampleRun]: charge, | ||
| AccumulatedProtonCharge[VanadiumRun]: charge, | ||
| } | ||
|
|
||
|
|
||
| def DreamGeant4Workflow() -> sciline.Pipeline: | ||
| """ | ||
| Workflow with default parameters for the Powgen SNS instrument. | ||
| """ | ||
| return sciline.Pipeline( | ||
| providers=powder_providers + geant4_providers, params=default_parameters() | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does this belong into the
__init__.py? - Docstring refers to Powgen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does this belong into the
__init__.py?
hmm in essans, we have a separate workflow file for loki, in essreflectometry, for Amor, we have the workflow in the __init__.py. We should be consistent and just have a separate workflow file?
- Docstring refers to Powgen.
Bad copy/paste ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think consistency is the main argument, I thought the __init__.py should generally be kept minimal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the workflows be listed in the api-reference?
| "# Mask in time-of-flight to crop to valid range\n", | ||
| "workflow[TofMask] = lambda x: (x < sc.scalar(0.0, unit=\"ns\")) | (x > sc.scalar(86e6, unit=\"ns\"))\n", | ||
| "workflow[TwoThetaMask] = None\n", | ||
| "workflow[WavelengthMask] = None\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can those be None by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could, but I thought this would make it obvious what the syntax is if you want to add other masks. I guess this goes back to the discussion on whether these notebooks should only show what is needed, and we need another page that describes everything that can be done in the workflow.
Adds
PowgenWorkflow()andDreamGeant4Workflow()helpers.I also moved the
ess/powder/externalfolder toess/snspowderto be more likeess/isissansinesssans.