scipp / essreduce

Common functionality for ESS data reduction
https://scipp.github.io/essreduce/
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Optional widget wrapper #73

Closed YooSunYoung closed 3 months ago

YooSunYoung commented 3 months ago

Fixes #71

I don't like how it looks but it works...

Optional

image

Switchable & Optional

https://github.com/user-attachments/assets/0e26b649-5f4e-461e-acb7-015f65d78065

jokasimr commented 3 months ago

I saw this before but didn't understand it. What is a switchable widget? When is it used?

YooSunYoung commented 3 months ago

I saw this before but didn't understand it. What is a switchable widget? When is it used?

@jokasimr Switchable widget is when you don't want to set the parameter at all in the workflow and Optional widget is when you want to set it as None. It's handled by the attributes of Parameter object, switchable and optional.

Maybe I should add this information in the developer's gui page...

SimonHeybrock commented 3 months ago

I saw this before but didn't understand it. What is a switchable widget? When is it used?

TL;DR: When you have a parameter param: SomeType | None (aka Optional[SomeType]).

jokasimr commented 3 months ago

TL;DR: When you have a parameter param: SomeType | None (aka Optional[SomeType]).

From @YooSunYoung s explanation that sounds more like an optional widget.

YooSunYoung commented 3 months ago

I added the explanation in the developers document

jokasimr commented 3 months ago

Instead of making switchable widgets, maybe we should just add a long multiple-select widget containing all domain types (parameters) in the workflow. When you select some of them, they show up in the ParameterBox widget and you can assign their values. When you select a set of outputs, the multiple select list of parameters selects the required parameters to produce the outputs.

This would help by

  1. removing the need to have switchable parameters/widgets, simplifying the gui
  2. make it easy to add support for changing intermediate values, the user just needs to select them manually from the parameter multiple select widget
YooSunYoung commented 3 months ago

@jokasimr I created a separate issue regarding your suggestion. #74