spacetelescope / cubeviz

Data analysis package for cubes. https://cubeviz.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
15 stars 25 forks source link

Cubeviz not working with glue-core 0.15dev #473

Closed brechmos-stsci closed 3 years ago

brechmos-stsci commented 5 years ago

Cubeviz is not working with Glue 0.15dev when loading data from the command line...

Traceback (most recent call last):
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/utils/qt/decorators.py", line 63, in decorated
    return f(*args, **kwargs)
  File "/home/craig/Documents/STScI/cubeviz/cubeviz/cubeviz/cubeviz.py", line 118, in main
    ga.add_datasets(data_collection, datasets, auto_merge=False)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/core/application_base.py", line 302, in add_datasets
    data_collection.extend(datasets)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/core/data_collection.py", line 98, in extend
    self.append(d)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/core/data_collection.py", line 84, in append
    self.hub.broadcast(msg)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/core/hub.py", line 217, in broadcast
    handler(message)
  File "/home/craig/Documents/STScI/cubeviz/cubeviz/cubeviz/listener.py", line 51, in handle_new_dataset
    self.configure_layout(data)
  File "/home/craig/Documents/STScI/cubeviz/cubeviz/cubeviz/listener.py", line 61, in configure_layout
    self.setup_data(cubeviz_layout, data)
  File "/home/craig/Documents/STScI/cubeviz/cubeviz/cubeviz/listener.py", line 102, in setup_data
    image_viewers[0].add_data(data)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/utils/matplotlib.py", line 167, in wrapper
    FigureCanvasAgg.draw.execute_deferred_calls()
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/utils/misc.py", line 43, in execute_deferred_calls
    self.method(instance, *args, **kwargs)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 402, in draw
    self.figure.draw(self.renderer)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/figure.py", line 1649, in draw
    renderer, self, artists, self.suppressComposite)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/astropy/visualization/wcsaxes/core.py", line 458, in draw
    super().draw(renderer, inframe=inframe)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/matplotlib/image.py", line 584, in draw
    renderer, renderer.get_image_magnification())
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/mpl_scatter_density/base_image_artist.py", line 178, in make_image
    array = self._array_func(bins=bins, range=((ymin, ymax), (xmin, xmax)))
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/viewers/image/frb_artist.py", line 29, in array_func_wrapper
    array = self._array_maker(bounds)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/viewers/image/composite_array.py", line 96, in __call__
    array = layer['array'](bounds=bounds)
  File "/opt/miniconda3/envs/cubeviz-dev/lib/python3.6/site-packages/glue/viewers/image/layer_artist.py", line 122, in get_image_data
    image = self.state.get_sliced_data(bounds=bounds)
TypeError: get_sliced_data() got an unexpected keyword argument 'bounds'
brechmos-stsci commented 5 years ago

So I tried putting bounds=None in the get_sliced_data() but now am getting reset_cache_from_slices is not a method for the layer in:

for layer in self.layers:
            layer.reset_cache_from_slices(slices_before, slices_after)
brechmos-stsci commented 5 years ago

Going to talk with @astrofrog to see how hard it will be to get things in cubeviz fixed up for glue-core v0.15 and also when the release date will be for 0.15.

astrofrog commented 5 years ago

Ok so I've started investigating this and the fix isn't trivial, but I plan to work on it over the next few days. In the mean time, for the upcoming sprint please rely on the latest stable version of glue.

brechmos-stsci commented 5 years ago

For this next Cubeviz release we are going to aim for glue-core 0.13.x and 0.14.x.