Skip to content
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

Merged
merged 11 commits into from
Oct 7, 2024
Merged

Workflow widget interface #171

merged 11 commits into from
Oct 7, 2024

Conversation

nvaytet
Copy link
Member

@nvaytet nvaytet commented Sep 27, 2024

Needs scipp/essreduce#109 for builds to pass.

@nvaytet nvaytet marked this pull request as ready for review October 4, 2024 10:46
Comment on lines 79 to 102
# 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
Copy link
Member

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)?

Copy link
Member Author

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?

Copy link
Member

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?

@nvaytet nvaytet merged commit f686722 into main Oct 7, 2024
4 checks passed
@nvaytet nvaytet deleted the workflow-interface2 branch October 7, 2024 09:03
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.

2 participants