Skip to content
This repository was archived by the owner on Apr 26, 2023. It is now read-only.
This repository was archived by the owner on Apr 26, 2023. It is now read-only.

'Condition' parameter of the 'local' protocol parameter should reflect state of the 'global' protocol parameter #1770

Open
@DStrelak

Description

@DStrelak

Is your feature request related to a problem? Please describe.
Let's say I have a protocol, which can execute both GPU and CPU implementation of an algorithm.
And let's assume that the GPU implementation has an additional parameter (e.g. max GPU memory that the algorithm can use).
Clearly, this additional parameter should not be visible for the CPU version.

Describe the solution you'd like
I would like to be able to specify condition on such a (local) parameter, using the USE_GPU (global) parameter.

Example (currently not working in devel-pluginization branch):

form.addHidden(params.USE_GPU, params.BooleanParam, default=False,
                       label="Use GPU version",
                       help="XXX")
form.addParam("max_gpu_mem", params.IntParam,
                      label='Max GPU memory to use',
                      condition="useGpu",
                      help="XXX")

Describe alternatives you've considered
Currently, I have decided to describe both in help and label that this parameter is for GPU version only.

Additional context
Note: Currently the condition sort of works, however, it is not interactive. It reflexts only the state of the global parameter at the time of instantiation (i.e. if I set the GPU version as a default, the memory parameter appears in the form, but it won't hide when I select CPU version).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions