Giter Site home page Giter Site logo

glue-viz / glue-jupyter Goto Github PK

View Code? Open in Web Editor NEW
85.0 16.0 38.0 1013 KB

Glue front-end for the Jupyter ecosystem

Home Page: https://glue-jupyter.readthedocs.io/en/latest/

License: Other

Python 78.74% Jupyter Notebook 12.57% Shell 0.07% Dockerfile 0.26% Vue 8.36%

glue-jupyter's Introduction

Jupyter interface for Glue

Sometimes known as “Glupyter”

Glue Jupyter's GitHub Actions CI Status Glue Jupyter's Coverage Status Glue Jupyter's Documentation Status

About

Glue is a Python library to explore relationships within and among datasets. The main interface until now has been based on Qt, but the glue-jupyter package aims to provide a way to use Glue in Jupyter notebooks and Jupyter lab instead. This is currently a work in progress and highly experimental.

For some notebooks with examples of usage of glue-jupyter, see the notebooks directory.

You can try out glue-jupyter online at mybinder:

Launch Glue Jupyter on mybinder

Notebooks with real data:

Installing

For now, installing should be done using pip:

pip install git+https://github.com/glue-viz/glue-jupyter.git

Or from source:

git clone https://github.com/glue-viz/glue-jupyter.git
cd glue-jupyter
pip install -e .

Testing

The test suite can be run using:

pytest glue_jupyter

glue-jupyter's People

Contributors

astrofrog avatar carifio24 avatar dhomeier avatar duytnguyendtn avatar eteq avatar javerbukh avatar jazztap avatar jfoster17 avatar jsoref avatar jsub1 avatar kecnry avatar maartenbreddels avatar mariobuikhuizen avatar nmearl avatar pkgw avatar pllim avatar rosteen avatar sk1p avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glue-jupyter's Issues

Move selection tools out of tabs

At the moment the selection tools are inside the tab on the right for each viewer but I think it would be better if these tools used the same toolbar as the one with the current subset and selection mode, since then all selection-related things would be together.

TraitError when loading a FITS image with app.imshow

I am trying to use Glupyter to load a FITS image and link it to a catalog table as well. I'm getting an error when trying to imshow the image data. I've tried passing in the image data as well as the full HDUList object and I get the same error.

tmp = '/Users/bcherinka/Work/notebooks/dss_red_66.582618_-67.806508.fits'
dss = fits.open(tmp)
sciim = app.add_data(dss=dss[0].data)[0]
imview = app.imshow(data=sciim)

produces the following traceback

---------------------------------------------------------------------------
TraitError                                Traceback (most recent call last)
<ipython-input-7-27ab10311ede> in <module>
      2 dss = fits.open(tmp)
      3 sciim = app.add_data(dss=dss[0].data)[0]
----> 4 imview = app.imshow(data=sciim)

~/Work/git/stsci/glue-jupyter/glue_jupyter/app.py in imshow(self, x, y, data, widget)
    240         if len(data.pixel_component_ids) < 2:
    241             raise ValueError('There are less than 2 pixel components (not an image?)')
--> 242         view = self.new_data_viewer(viewer_cls, data=data)
    243         if x is not None:
    244             x = data.id[x]

~/Work/git/stsci/glue-jupyter/glue_jupyter/app.py in new_data_viewer(self, viewer_class, data, state)
    136         if data is not None:
    137             if isinstance(data, BaseData):
--> 138                 result = c.add_data(data)
    139             elif isinstance(data, Subset):
    140                 result = c.add_subset(data)

~/Work/git/stsci/glue-jupyter/glue_jupyter/view.py in add_data(self, data, color, alpha, **layer_state)
     77         layer_state = dict(layer_state)
     78         _update_not_none(layer_state, color=color, alpha=alpha)
---> 79         layer.update()
     80         layer.state.update_from_dict(layer_state)
     81 

~/Work/git/stsci/glue-jupyter/glue_jupyter/bqplot/image.py in update(self)
    132             # print(np.nanmin(data), np.nanmax(data))
    133             # png_data = _scalar_to_png_data(data)
--> 134             self.scale_image.min = self.state.v_min
    135             self.scale_image.max = self.state.v_max
    136             self.image_mark.image = data

~/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    583             raise TraitError('The "%s" trait is read-only.' % self.name)
    584         else:
--> 585             self.set(obj, value)
    586 
    587     def _validate(self, obj, value):

~/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value)
    557 
    558     def set(self, obj, value):
--> 559         new_value = self._validate(obj, value)
    560         try:
    561             old_value = obj._trait_values[self.name]

~/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py in _validate(self, obj, value)
    589             return value
    590         if hasattr(self, 'validate'):
--> 591             value = self.validate(obj, value)
    592         if obj._cross_validation_lock is False:
    593             value = self._cross_validate(obj, value)

~/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py in validate(self, obj, value)
   1974             value = float(value)
   1975         if not isinstance(value, float):
-> 1976             self.error(obj, value)
   1977         return _validate_bounds(self, obj, value)
   1978 

~/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py in error(self, obj, value)
    623             e = "The '%s' trait must be %s, but a value of %r was specified." \
    624                 % (self.name, self.info(), repr_type(value))
--> 625         raise TraitError(e)
    626 
    627     def get_metadata(self, key, default=None):

TraitError: The 'min' trait of a ColorScale instance must be a float, but a value of 2216 <class 'numpy.int64'> was specified.

It plots ok using straight Matplotlib

import matplotlib.pyplot as plt
plt.imshow(dss[0].data, origin='lower')

AttributeError: can't set attribute

I tried to run the demo_gaussian.ipynb notebook - with the developer version of ipyvolume and the scatter_webgl branch of bqplot, but I'm getting:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-99c7b0ec2bcb> in <module>()
----> 1 s = app.scatter2d('x', 'y')

~/Desktop/jupyter/glue-jupyter/glue_jupyter/__init__.py in scatter2d(self, x, y, data)
    182         from .bqplot import BqplotScatterView
    183         data = data or self._data[0]
--> 184         view = self.new_data_viewer(BqplotScatterView, data=data)
    185         x = data.id[x]
    186         y = data.id[y]

~/Dropbox/Code/Glue/glue/glue/core/application_base.py in new_data_viewer(self, viewer_class, data)
     79             return
     80 
---> 81         c = viewer_class(self._session)
     82         c.register_to_hub(self._session.hub)
     83 

~/Desktop/jupyter/glue-jupyter/glue_jupyter/bqplot/view.py in __init__(self, session)
     71                                                    icons=["arrows", "pencil-square-o"])
     72         self.button_action.observe(self.change_action, "value")
---> 73         self.change_action()  # 'fire' manually for intial value
     74 
     75 #         self.state.add_callback('y_att', self._update_axes)

~/Desktop/jupyter/glue-jupyter/glue_jupyter/bqplot/view.py in change_action(self, *ignore)
    108         self.figure.interaction = self.interact_map[self.button_action.value]
    109         if self.is2d:
--> 110             self.brush.selected = []
    111             self.brush_y.selected = []
    112         self.brush_x.selected = []

AttributeError: can't set attribute

What could this be due to?

bqplot histogram large_data_size is quite small

The bqplot histogram viewer has large_data_size = 1e5 which is quite small. The state class actually has a method to find the histogram (which uses fast-histogram behind the scenes) and this would be fast up to ~1e8 points.

show() should be optional

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

Right now the visualizations always get shown whenever a glupyter visualization is executed. But there are times when it's useful to create the widget but not show it until it is the last line of a cell. While I can see the merit of either way of doing it, there should be a way to control this so that it's possible to not get the show() on create beahvior

Problem with binder version of Investigating star formation in the W5 region

Seems like the notebook on binder is maybe missing an import? Cell 4:

scatter_viewer = app.scatter2d('[4.5]-[5.8]', '[8.0]', data=data_catalog)

fails with the following traceback:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-6ae31bc350b4> in <module>
----> 1 scatter_viewer = app.scatter2d('[4.5]-[5.8]', '[8.0]', data=data_catalog)

/srv/conda/lib/python3.6/site-packages/glue_jupyter/app.py in scatter2d(self, x, y, data, widget, color, size, viewer_state, layer_state)
    183     def scatter2d(self, x=None, y=None, data=None, widget='bqplot', color=None, size=None, viewer_state=None, layer_state=None):
    184         if widget == 'bqplot':
--> 185             from .bqplot import BqplotScatterView
    186             viewer_cls = BqplotScatterView
    187         elif widget == 'matplotlib':

/srv/conda/lib/python3.6/site-packages/glue_jupyter/bqplot/__init__.py in <module>
----> 1 from .view import BqplotScatterView, BqplotImageView, BqplotHistogramView

/srv/conda/lib/python3.6/site-packages/glue_jupyter/bqplot/view.py in <module>
    241 from glue.viewers.image.composite_array import CompositeArray
    242 
--> 243 from .image import BqplotImageLayerArtist
    244 from .scatter import BqplotScatterLayerArtist
    245 from ..utils import rgba_to_png_data

/srv/conda/lib/python3.6/site-packages/glue_jupyter/bqplot/image.py in <module>
      3 import numpy as np
      4 import bqplot
----> 5 from ipyastroimage.astroimage import AstroImage
      6 import ipywidgets as widgets
      7 import ipywidgets.widgets.trait_types as tt

ModuleNotFoundError: No module named 'ipyastroimage'

Show drop-down menu for subsets instead of a list

We should replace the list of subsets by a drop-down combo box which shows the active subset (like in the dev version of glue). One option can be None/Create New. We can also make it so that if the edit subset mode is changed programmatically to select multiple subsets, we show 'Multiple subsets' as an option, but I think that's lower priority (for now we can just support single subsets).

Add proper index page on RTD

At the moment the index page on RTD is just a template - it'd be good to just have a real index page even with just a paragraph to say that things are under development.

scatter*d should have color/scale options

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

The scatter2d and scatter3d functions should have color, size, and marker options. This is related to #33 and #34 but those are about after the fact, whereas this issue is about on-creation. Also potentially connected to #36 since that could be the underlying mechanism... but the key point of this issue is that it should be possible.

Support >2 dimensional data in image viewer

It would be nice to be able to show cubes in the image viewer. This will require including a tab for viewer state and then including sliders as needed, as for the Qt version.

Set up JupyterLab on binder

This is just a reminder that we should investigate at some point how to set up JupyterLab on binder so as to be able to demo glue-jupyter.

Individual fits hdus cannot be passed in

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

It would be much more natural to be able to associate data sets with specific HDUs. E.g. prefer this:

f814w = fits.open('some_file814.fits')
f475w = fits.open('some_file475.fits')
app.add_data(f814w=f814w_image['SCI'], f475w=f475w_image['SCI'])

It seems like that should work and provide WCS and everything... but for whatever reason it currently does not.

Add an option to change the behavior of the debounce function

When panning around, the current debounce method works nicely. However, when changing slice in the n-dimensional data, it would be nice to have the image change while the slice is being changed, but at the same time we don't want all the calls to build up, so we still want something similar to debounce, but which does guarantee execution of the function as fast as possible, dropping any calls that pile up.

npm installed buy pip saying it's not there

Hi @astrofrog, @ibusko and I both ran into this same problem. We installed npm but the pip install claims it's not there. Looking at the error message i'm wondering if this is a permissions problem? We don't have admin permissions on our ST machines. Here's the error, version of npm I have installed is 0.1.1

(pyinsky) moka:glue-jupyter ogaz$ pip install -e .
Obtaining file:///Users/ogaz/glue-jupyter
Collecting glue-core (from glue-jupyter==0.0.0)
  Using cached https://files.pythonhosted.org/packages/5b/02/dbcf55e0354099bdcbadd0b22d20157af7b51c266a47cb9fa63361e532ac/glue_core-0.14.2-py2.py3-none-any.whl
Collecting glue-vispy-viewers (from glue-jupyter==0.0.0)
  Using cached https://files.pythonhosted.org/packages/e8/26/7f4c0485dd831b285f09155a75e3e5489ead1c2253a4e9b6936acd51df2c/glue_vispy_viewers-0.11-py2.py3-none-any.whl
Requirement already satisfied: notebook in /Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/site-packages (from glue-jupyter==0.0.0) (5.7.8)
Collecting ipympl (from glue-jupyter==0.0.0)
  Using cached https://files.pythonhosted.org/packages/f3/95/0f81671c9b71ef50e39508e85395f8987734d1211833ec349509e7a78356/ipympl-0.2.1-py2.py3-none-any.whl
Collecting ipyvolume (from glue-jupyter==0.0.0)
  Using cached https://files.pythonhosted.org/packages/6c/e4/4a6754d2c390ee627f82aeaae76b34a1daf30eea80af41215eebedb0f5ce/ipyvolume-0.5.1-py2.py3-none-any.whl
Requirement already satisfied: ipywidgets@ git+https://github.com/jupyter-widgets/ipywidgets.git#egg=ipywidgets from git+https://github.com/jupyter-widgets/ipywidgets.git#egg=ipywidgets in /Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/site-packages (from glue-jupyter==0.0.0) (7.4.2)
Collecting bqplot@ git+https://github.com/maartenbreddels/bqplot@scatter_webgl#egg=bqplot from git+https://github.com/maartenbreddels/bqplot@scatter_webgl#egg=bqplot (from glue-jupyter==0.0.0)
  Cloning https://github.com/maartenbreddels/bqplot (to revision scatter_webgl) to /private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot
Branch 'scatter_webgl' set up to track remote branch 'scatter_webgl' from 'origin'.
Switched to a new branch 'scatter_webgl'
    Complete output from command python setup.py egg_info:
    setup.py entered
    $PATH=/Users/ogaz/miniconda3/envs/pyinsky/bin:/Users/ogaz/jfrog:/Users/ogaz/gcc/installation:/usr/local/mysql/bin:/Users/ogaz/miniconda3/bin:/sw/lib/perl5/ExtUtils:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/opt/X11/bin
    running egg_info
    running jsdeps
    `npm` unavailable.  If you're running this command using sudo, make sure `npm` is available to sudo
    rebuilding js and css failed
    missing files: ['/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/bqplot/static/extension.js', '/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/bqplot/static/index.js']
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/setup.py", line 219, in <module>
        setup(**setup_args)
      File "/Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/setup.py", line 88, in run
        raise e
      File "/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/setup.py", line 81, in run
        self.distribution.run_command('jsdeps')
      File "/Users/ogaz/miniconda3/envs/pyinsky/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/setup.py", line 156, in run
        raise ValueError(msg)
    ValueError: Missing file: /private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/bqplot/static/extension.js
    npm is required to build a development version of widgetsnbextension
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/w_/t1dtpm391bq6vyvhf6_lmn4m0003cg/T/pip-install-x7amirvz/bqplot/

Tabs for incompatible/disabled layers should be disabled

If I have a tabular and image dataset and make a selection in the tabular dataset, the subset for the image can't be computed, which is fine - but currently the layer is still shown as visible:

screen shot 2018-08-26 at 15 00 44

We should uncheck the visible checkbox and disable the checkbox in this case, or consider disabling the whole tab (or even hiding it).

Have default attributes for viewers

For the histogram viewer, if no attribute is specified, we should just pick the first one. For the scatter viewer, we should pick the first two (or twice the first one if there is only one attribute). And so on.

Matplotlib viewers very slow to resize

When resizing the Matplotlib viewers, there is a resizing animation that is very slow because it causes the data to be called many times. We need to find a way to disable this animation.

There should be an way to set a subset's color from the subset

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

It would be useful to have programatic control of the color used for a subset across all visualizations. Alternatively/ideally, also set the color of a non-subset in the same manner.

No obvious way to change marker symbols

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

This may be just something that needs to be implemented (as opposed to something that's implemented but hard to find), but there should be a one-liner to make the marker symbols of a scatter plot be something other than the default shape. This is possible in bqplot but doesn't seem to be exposed in glupyter?

Consider using new aspect ratio infrastructure from glue

In glue-viz/glue#1894, I made it so that we now deal with the aspect ratio stuff directly in the state class for any of the 2d viewers rather than delegate to Matplotlib. The idea is that if the Qt or Jupyter viewer call _set_axes_aspect_ratio on the state class, passing the aspect ratio of the axes, the limits will automatically be updated in future to provide square pixels (if aspect='equal'). This avoids having to change the size of the axes as done in #40 - whatever size the axes are, the limits are automatically calculated.

pytest glue_jupyter fails with an error associated with pymaterialui

Got the following error when running pytest glue_jupyter:

(astroconda36) ~/s/g/glue-jupyter ❯❯❯ pytest glue_jupyter

=================================================================== test session starts ====================================================================
platform darwin -- Python 3.6.8, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /Users/hcferguson/software/git-clones/glue-jupyter, inifile:
plugins: remotedata-0.3.1, openfiles-0.3.1, doctestplus-0.1.3, arraydiff-0.3
collected 13 items / 1 errors                                                                                                                              

========================================================================== ERRORS ==========================================================================
________________________________________________ ERROR collecting glue_jupyter/bqplot/tests/test_bqplot.py _________________________________________________
ImportError while importing test module '/Users/hcferguson/software/git-clones/glue-jupyter/glue_jupyter/bqplot/tests/test_bqplot.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
glue_jupyter/bqplot/__init__.py:1: in <module>
    from .view import BqplotScatterView, BqplotImageView, BqplotHistogramView
glue_jupyter/bqplot/view.py:3: in <module>
    import ipymaterialui as mui
E   ModuleNotFoundError: No module named 'ipymaterialui'

Went to the GitHub repo for ipymaterialui and followed instructions to pip install it, but got the following error:

(astroconda36) ~/s/g/glue-jupyter ❯❯❯ pip install ipymaterialui                                                                                           ⏎
Collecting ipymaterialui
  Could not find a version that satisfies the requirement ipymaterialui (from versions: )
No matching distribution found for ipymaterialui

Add the ability to show world coordinates for sliders

#75 added the ability to have sliders for n-dimensional cubes. This issue is a reminder that we still need to add support for optionally showing the world coordinates next to the sliders instead of the pixel slice. We can use a similar approach to glue-core of showing the coordinates at the center of the cube and emitting a warning if any coordinate axes are correlated.

Changing size mode can crash bqplot scatter viewer

Let's say I turn on the linear scaling of the points, and the default attribute for that has a min and max of 10 and 20 respectively. Now let's say I change to use a different attribute which has a very different range of values, such as 1e6 and 2e6. The way the code works right now, it looks like the bqplot viewer updates after the attribute changes but before the min/max changes, then again when min changes, then again when the max changes. This can temporarily lead to incredibly large point sizes which just crashes the browser.

We should make sure that bqplot doesn't listen for a change in attribute (since it should only care about the min/max) and that we delay the callbacks from min/max until both have been set (the latter may be something that's needed on the glue side, not sure)

Do RGB color compositing in the shader

At the moment, #75 implemented color-compositing by re-using the infrastructure from glue-core, which operates on the CPU. However, in principle we could re-work this so that it happens in the shader. This could be implemented in ipyastroimage. This would then speed up any changes related to color, bias, contrast, and so on. Changing slices in n-dimensional data would still have a lag since that would require CPU and sometimes I/O operations, but that's going to be difficult to get around.

This is not super high priority, and it would be better to focus on polishing the rest of the functionality, but just opening this for the future.

API change: Make "data" the first keyword argument

For example, I loaded a cube or image from your data = app.load_data(filename) method. Then intuitively (and given the lack of API doc on RTD), I tried:

app.imshow(data)

or

app.volshow(data)

However, doing that, I got a traceback. It turns out that currently I needed to provide data=data explicitly, which I find non-intuitive.

xref spacetelescope/dat_pyinthesky#28

Make cmap_mode='Linear' work

When I tried to set cmap_mode to linear on a scatter layer, it didn't seem to do anything. Is it a bug that nothing happened or is this a "not yet implemented" situation?

DataCollection.new_subset_group should be easier

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

While trying to go a step further with #28 I wanted to create my own custom subsets programatically. This requires using something like this:


gaia_data.add_component(d, 'cmd_distance')
app.data_collection.new_subset_group('isoc2', gaia_data.id['cmd_distance']<.2)

that took quite a bit of seplunking with tab-completion to figure out. I think this could be much more done with a convenience function like app.add_subset('isoc2', d<.2) or, failing that, at least app.add_subset_newdata('isoc2', d<.2, d, 'cmd_distance')

Data class is difficult to use naturally in a notebook context

The first in a series of issues that are "confusing elements of the API" from work on #28 :

I find the glue Data classes a bit difficult to work with in a notebook context. It seems natural to create Data objects and pass them into multiple places in glue, but because Data objects are tied to a glue app you can get into trouble.

So I'd say in the glupyter workflow, perhaps data objects are sort of an "implementation detail"? That is, the user should be expected to generally app.add_data which should then automatically wrap the input in Data (although then the Data constructor has to be rather flexible...).

This works now with add_data, so this issue might be more of a documentation item that it should just be stated that's the preferred way.

Use accordion instead of tabs for layers

The current model of using tabs for layers doesn't work well when there are more than 2-3 layers, and the names of layers are often too long anyway. I think the tabs should be 'General' and 'Layers', and 'Layers' could contain an Accordion widget with all the layers?

Crash when loading two datasets with the same shape

If we load in two datasets with the same shape, glue crashes because it tries to call _choose_merge which is not implemented in the Jupyter app. We should just make it so that we never merge by default.

Exception: Could not load data
(Traceback (most recent call last):
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/application_base.py", line 25, in wrapper
    return func(*args, **kwargs)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/application_base.py", line 213, in load_data
    skip_merge=skip_merge, auto_merge=auto_merge)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/application_base.py", line 324, in add_datasets
    merges, label = cls._choose_merge(data, other, suggested_label)
  File "/Users/tom/Dropbox/Code/Glue/glue/glue/core/application_base.py", line 339, in _choose_merge
    raise NotImplementedError
NotImplementedError
)

bqplot module has no attribute ScatterGL

I'm trying to get glupyter installed and run some example code from your notebooks but am running into some issues. I ran pip install -e . from within the glue-jupyter repo. I installed the dev version of ipyastroimage. (pip install failed). When I try to create a 2d scatter plot, I'm getting

AttributeError: module 'bqplot' has no attribute 'ScatterGL'

glue-jupyter installed bqplot version 0.11.2. I can't find any reference to ScatterGL in any docs or references for bqplot. Is there a custom version of bqplot I should have installed?

Here is my code, which loads a small catalog as a table, and as test, tries to create an RA, Dec 2d scatter plot:

import glue_jupyter as gj
from glue.core.component_link import ComponentLink
from glue.core.data_factories import load_data
from glue import core as gcore
from astropy.io import fits
from astropy.table import Table
tic = Table.read('/Users/Brian/Dropbox/tess_work/data/catalog_66_-67.fits')
tic_data = gcore.Data('TIC', **tic)
app = gj.jglue(tic_data)
app.scatter2d('ra', 'dec')

**state should be possible when creating views

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

It's useful programatically to be able to set the state all at once on view-creation. The natural way it seems to me to implement this is that the view-creation functions (e.g. app.scatter2d) should accept kwargs that then get applied directly as state. Alternatively, a state dictionary could be passed in, but that feels a bit less natural/easy to use.

Change default point size

The 2D scatter plot point sizes are too large by default - we should probably make them ~half the size.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.