-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure storage of paramters and widgets in
ParameterPanel
Introduce `param_to_widget_map` to access the widgets in form of a dict for more convenient handling. To more robustly set parameter values the setter has been replaced by the `update_params` method. The setter introduced behavior that is unintuitive for python as it behaves like an update function while using assign syntax. Alternatively a design implementing methods `__{get,set}item__`, `values` and `keys` was considered, but `keys` was clashing with the trait variable of `Widget` which would have required a different naming. This would have been more confusing. ```python code_ex.params # returns parameter_panel code_ex.params['x'] = 5 # works, updates the panel code_ex.params['x'] code_ex.params.values() # works code_ex.params.params_keys() # cannot be keys because it is already used by Widget ```
- Loading branch information
1 parent
0c95cbd
commit 0830925
Showing
3 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters