equinor / webviz-subsurface

Webviz-config plugins for subsurface data.
https://github.com/orgs/equinor/projects/24
GNU General Public License v3.0
56 stars 59 forks source link

Gracefully handle reference case not in input data #1045

Open anders-kiaer opened 2 years ago

anders-kiaer commented 2 years ago

image

Reported by user. Happens on in-place sensitivity and time series sensitivity. When clicking on those two pages, the user is sent to the front page, and the above is printed to terminal.

Since this is a runtime problem, we should perhaps handle it more gracefully.

Relevant code lines: https://github.com/equinor/webviz-subsurface/blob/50266076b133a671bf39f79fc46279edffe8b73d/webviz_subsurface/_components/tornado/_tornado_data.py#L44-L45

tnatt commented 2 years ago

One solution could be to have a callback to update the options and value of the reference selector when the ensemble is changed. This will ensure that the reference will always be in the dataset.