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

Multiple plugins fail if no ensembles are selected in frontend #835

Closed
lindjoha opened this issue Nov 2, 2021 · 4 comments · Fixed by #854
Closed

Multiple plugins fail if no ensembles are selected in frontend #835

lindjoha opened this issue Nov 2, 2021 · 4 comments · Fixed by #854
Assignees
Labels
bug 🐛 Something isn't working

Comments

@lindjoha
Copy link
Collaborator

lindjoha commented Nov 2, 2021

If I deselect all ensembles under Formation Plot Settings in the RFT plotter (RFT map tab), then I get this error. And I'm not able to get back in without restarting the app.

  File "/prog/res/komodo/2021.10.04-py36-rhel7/root/lib/python3.6/site-packages/webviz_subsurface/plugins/_rft_plotter/_formation_figure.py", line 201, in add_ert_observed
    "REAL": df["REAL"].unique()[0],
IndexError: index 0 is out of bounds for axis 0 with size 0
@anders-kiaer anders-kiaer added the bug 🐛 Something isn't working label Nov 2, 2021
@anders-kiaer
Copy link
Collaborator

Good catch. I observe the same on https://webviz-subsurface-example.azurewebsites.net/rft-plotter if I remove all ensembles there.

The easiest would have been dropdown + multi + not cleerable (i.e. you need at least one selected value). But that is maybe not possible with dcc.Dropdown 🤔 Suggestions on what would be an easy solution here @tnatt @HansKallekleiv? Maybe the easiest to allow for no ensembles and then no plots? That is the current behavior in https://webviz-subsurface-example.azurewebsites.net/simulation-time-series.

@anders-kiaer
Copy link
Collaborator

anders-kiaer commented Nov 2, 2021

The same problem seems to be there with:

@asnyv @rubenthoms

The other plugins seems to gracefully plot nothing (if no ensembles are selected).

@anders-kiaer anders-kiaer changed the title RFT plotter: fails if I deselect all ensemble under Formation Plot Settings Multiple plugins fail if no ensembles are selected in frontend Nov 2, 2021
@HansKallekleiv
Copy link
Collaborator

no way to prevent this behavior afaik. The simplest solution is to catch it first thing in the callback and return a dash.no_update. Alternatively we could return an empty figure with some descriptive text as done in some plugins.

@lindjoha lindjoha self-assigned this Nov 23, 2021
@lindjoha
Copy link
Collaborator Author

This is easily fixed in the RftPlotter by adding this to the callback:

        if not ensembles:
            return {"layout": {"title": "No ensembles selected"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants