spacetelescope / jdaviz

JWST astronomical data analysis tools in the Jupyter platform
https://jdaviz.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
134 stars 71 forks source link

MosViz PR#209 Traitlet Traceback (IndexError: list index out of range) #247

Closed duytnguyendtn closed 1 year ago

duytnguyendtn commented 4 years ago

After doing an eager upgrade on master, getting the following error with the MOSViz Example notebook. The weird thing is that the app works as you'd expect (i.e. clicking on the table row appropriately loads/switches the data in the image, 2D spectra, and 1D spectra. Traceback doesn't seem to impede my ability to use MosViz. Any ideas @nmearl ? Is this the same error you're getting @rosteen ?

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
f:\stsci\gitrepos\jdaviz\envmaster\lib\site-packages\ipywidgets\widgets\widget.py in _handle_msg(self, msg)
    674                 if 'buffer_paths' in data:
    675                     _put_buffers(state, data['buffer_paths'], msg['buffers'])
--> 676                 self.set_state(state)
    677 
    678         # Handle a state request.

f:\stsci\gitrepos\jdaviz\envmaster\lib\site-packages\ipywidgets\widgets\widget.py in set_state(self, sync_data)
    543                     from_json = self.trait_metadata(name, 'from_json',
    544                                                     self._trait_from_json)
--> 545                     self.set_trait(name, from_json(sync_data[name], self))
    546 
    547     def send(self, content, buffers=None):

f:\stsci\gitrepos\jdaviz\envmaster\lib\site-packages\glue_jupyter\state_traitlets_helpers.py in update_state_from_json(self, json, widget)
    149         self._block_on_state_change = True
    150         try:
--> 151             update_state_from_dict(state, json)
    152         finally:
    153             self._block_on_state_change = False

f:\stsci\gitrepos\jdaviz\envmaster\lib\site-packages\glue_jupyter\state_traitlets_helpers.py in update_state_from_dict(state, changes)
     49                         update_state_from_dict(callback_list[i], changes[name][i])
     50                     else:
---> 51                         if (changes[name][i] != MAGIC_IGNORE and
     52                                 callback_list[i] != changes[name][i]):
     53                             callback_list[i] = changes[name][i]

IndexError: list index out of range
rosteen commented 4 years ago

My problem turned out to be with my local environment, not with the PR (I wasn't getting an error message at all, the app was just hanging trying to start). That said, I have seen the error you posted but in a different context (in Cubeviz while using one of the plugins) - I didn't see exactly what action caused it, but it's definitely not specific to this PR and warrants a separate issue.

nmearl commented 3 years ago

This might be a question for @astrofrog. It looks like maybe the state isn't populated yet and it's attempting to mutate before it exists in the changes dictionary. @dtn5ah are you able to reproduce this reliably? Does it occur if you want a big longer before attempting to click on a row?

pllim commented 3 years ago

Is this still a problem? Various upstream releases have happened since then.

pllim commented 2 years ago

We start to see it in Cubeviz too, for example in #1412

rosteen commented 1 year ago

This was recently fixed upstream in glue-jupyter, closing.