-
Notifications
You must be signed in to change notification settings - Fork 2
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
Workflow widget interface #171
Conversation
tests/loki/workflow_test.py
Outdated
# Select tutorial workflow | ||
select = widget.children[0].children[0] | ||
keys, values = zip(*select.options, strict=True) | ||
ind = keys.index('LokiAtLarmorTutorialWorkflow') | ||
select.value = values[ind] | ||
# Select IofQ[SampleRun] output | ||
wfw = widget.children[1].children[0] | ||
outputs = wfw.output_selection_box.typical_outputs_widget | ||
keys, values = zip(*outputs.options, strict=True) | ||
ind = keys.index('IofQ[SampleRun]') | ||
outputs.value = (values[ind],) | ||
# Refresh parameters | ||
pbox = wfw.parameter_box | ||
pbox.parameter_refresh_button.click() | ||
# Enable DirectBeam input | ||
pbox._input_widgets[DirectBeam].children[0].enabled = True | ||
pbox._input_widgets[DirectBeam].children[0].wrapped._option_box.value = None | ||
# Run the workflow | ||
rbox = wfw.result_box | ||
rbox.run_button.click() | ||
# Inspect results | ||
(da,) = results.values() | ||
assert da.dims == ('Q',) | ||
assert da.sizes['Q'] == pbox._input_widgets[QBins].children[0].fields['nbins'].value |
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.
Won't a test like this break all the time as we refactor and improve the widget code? Can we avoid it (for now at least)?
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.
Sure. Does this mean I should also remove the notebook, as it uses the same code to make the widget come alive?
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.
Let us leave it for now? I hope once we implement a way to save the widget config that would be solved?
Needs scipp/essreduce#109 for builds to pass.