cal-adapt / climakitae

A Python toolkit for retrieving, visualizing, and performing scientific analyses with data from the Cal-Adapt Analytics Engine.
https://climakitae.readthedocs.io
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Selecting derived variable and statistical data error #386

Closed vicford closed 2 months ago

vicford commented 2 months ago

When in Select panel, if a user selects the following in order, a error traceback is prodcued:

This is because derived indices are not hooked up for LOCA2 data.


  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pyviz_comms/__init__.py", line 346, in _handle_msg
    self._on_msg(msg)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/viewable.py", line 292, in _on_msg
    doc.unhold()
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/bokeh/document/document.py", line 799, in unhold
    self.callbacks.unhold()
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 396, in unhold
    self.trigger_on_change(event)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 373, in trigger_on_change
    invoke_with_curdoc(doc, event.callback_invoker)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/bokeh/util/callback_manager.py", line 191, in invoke
    callback(attr, old, new)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/reactive.py", line 392, in _comm_change
    self._schedule_change(doc, comm)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/reactive.py", line 376, in _schedule_change
    self._change_event(doc)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/reactive.py", line 370, in _change_event
    self._process_events(events)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/reactive.py", line 311, in _process_events
    events = self._process_property_change(events)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/panel/widgets/select.py", line 488, in _process_property_change
    msg['value'] = list(self.values)[index]
IndexError: list index out of range```
elehmer commented 2 months ago

I assume this is something we want to do for LOCA2?

elehmer commented 2 months ago

Hmm, I am not able to reproduce this error. Panel transitions to "Statistical" and removes the "Derived Index" variable options. @vicford Did you encounter this the first time through the code or did you select several options first?

vicford commented 2 months ago

I assume this is something we want to do for LOCA2?

@elehmer We actually don't want to provide the derived variable/indices for LOCA2 data at all - the raw variables needed for those derived variables aren't available in LOCA2

vicford commented 2 months ago

Hmm, I am not able to reproduce this error. Panel transitions to "Statistical" and removes the "Derived Index" variable options. @vicford Did you encounter this the first time through the code or did you select several options first?

I'm also now not seeing it pop up... I wonder if it was just a one time weirdness then... I'll close this issue then, crisis averted!