What’s new in glue?¶
On this page you will find information about significant changes in each release. Many smaller improvements and bug fixes are not mentioned here but can be found in the full list of CHANGES.md file if you are interested.
Before we get started, here’s a reminder on how to install/update glue. You can easily update glue if you are using Anaconda/Miniconda by doing:
conda install -c glueviz glueviz=0.14
If instead you installed glue with pip, you can update with:
pip install glueviz[all] --upgrade
If you have any questions about any of the functionality described below or about glue in general, you can find information here about contacting us and/or reporting issues.
What’s new in glue v0.14?¶
Documentation about plugins¶
Changes in behavior¶
There are a couple of changes in behavior in glue that we want to mention here:
The first is that when saving session files, the default has now changed to be to include relative paths to the data files (as opposed to absolute paths).
The second is that when accessing string components in datasets, you will now get back a specialized Numpy array class that behaves like an array of strings, but also has a
.codesattribute to get the numerical category for each value, as well as a
.categoriesattribute to get the unique categories:
>>> from glue.core import Data >>> d = Data(x=['a', 'b', 'c', 'a', 'a']) >>> d['x'] categorical_ndarray(['a', 'b', 'c', 'a', 'a'], dtype='<U1') >>> d['x'].codes array([0., 1., 2., 0., 0.]) >>> d['x'].categories array(['a', 'b', 'c'], dtype=object)
In previous versions,
d['x']returns the numerical
.codesdirectly but it was not easy to access the original labels.
This release includes a number of significant performance enhancements (both in terms of speed and memory usage). In particular, the histogram and profile viewers have been updated to be able to compute histograms and profiles in the background without causing the rest of the application to hang - in this case the viewers will look like this while they are updated:
Documentation about creating custom viewers [advanced]¶
We have now written extensive documentation on writing fully customized viewers for glue. The new pages available are:
This is intended for developers working on plugin packages that define new viewers. If you are a user and want to make Matplotlib-based custom viewers, we recommend that you start off with the existing Writing a simple custom data viewer page.
Abstract data classes [advanced]¶
By default, data objects in glue are instances of the Data class, and this class assumes that the data are stored in one or more local n-dimensional arrays. However, glue now includes a way of defining a wider variety of data objects, which may rely for example on large remote datasets, or datasets that are not inherently stored as regular n-dimensional arrays. We have written up documentation on Defining your own data objects.
Better isolation of Qt code [advanced]¶
The code related to the data viewers has been significantly re-organized to split out as much as possible of the code to make it non-Qt-specific. This will enable other interfaces, such as Jupyter widgets, to re-use as much of the code as possible.
What’s new in glue v0.13?¶
Scatter density maps¶
The 2D scatter viewer can now show data using a density map rather than individual markers - this makes it possible to now plot tens to hundreds of millions of points efficiently.
Whether data is shown as a density map or markers can be controlled for each layer, and by default glue will automatically decide which one to use depending on the size of the data. It is also possible to color-code points by a third variable as for markers:
Previously, the 2D image viewer only allowed multiple datasets to be shown at the same time if all pixel coordinates were linked between the different datasets. The image viewer will now automatically overlay data even if it is linked by world coordinates instead of pixel coordinates:
For astronomers: this means being able to overplot images and cubes with different WCS transformations, provided that you have set up links between the world coordinates - and this includes being able to show 2D images and 3D spectral cubes at the same time (if you do this, note that the reference data needs to be the dataset you want to slice over, i.e. the cube, not the 2D image).
Arithmetic attribute editor¶
Glue has long had the ability to define so-called ‘arithmetic’ attributes/components, which are data attributes that depend on other data attributes via an arithmetic expression. However, editing or removing existing arithmetic attributes was not possible. We have now re-written the dialog for arithmetic attributes to make it possible to go back and edit existing expressions or remove unneeded arithmetic attributes:
and the equation editor itself has also been improved:
The arithmetic attribute editor is accessible via a new toolbar button:
Organize data attributes¶
We have also added a new dialog that can be used to rename or reorder existing attributes in the data. In future, this dialog will be used to also change the types of attributes (for example to indicate that an attribute should be interpreted as a time):
This dialog can be found in the Data Manager menu as Reorder/rename data attributes.
Export data/subset dialog¶
While exporting datasets and subsets has been possible in the past by control-clicking on datasets/subsets in the data collection view in the top left of the glue window, we have now added a new Export Data/Subsets dialog which provides a more intuitive interface for exporting data and subsets:
This dialog is accessible via the Export Data/Subsets button in the toolbar:
Data objects have a
.meta attribute that can be used to store arbitrary
metadata. For example for FITS files (in astronomy), this contains the header of
the file. We have now added the ability to visualize this metadata:
To view the metadata for a given dataset, control-click on the dataset in the top left data collection view and select View metadata/header.
Glue now features a new profile viewer that can be used to show data collapsed along all but one dimension using a variety of functions (mean, median, maximum, minimum, and so on). This new viewer replaces the previous ‘spectrum’ tool (which was restricted to 3 dimensions and mostly designed to work with astronomical data) and includes the same functionality to fit models to profiles or collapse data in an image viewer based on an interval selected in the profile viewer. The new profile viewer makes it possible to visualize the profile for subsets as well as for the whole dataset.
To create a profile viewer, either click on the profile icon () in an image viewer, or drag a dataset onto the main canvas and select 1D Profile.
Single-pixel extraction tool¶
We have also added a new subset selection mode in the image viewer which is to select a single pixel in the image plane. When used in conjunction with the profile viewer, this makes it possible to hover over an image and see the profile (e.g. spectrum) at the current mouse position:
Export Python scripts¶
While it has been possible for a while to export plots to e.g. PNG, PDF, or EPS files from different image viewers it is now possible to export a Python script that can be used to reproduce the plot for some of the core viewers (including the 2D scatter and image viewers and the histogram viewer). To use this functionality, click on the Save icon and select Save Python script to reproduce plot. This functionality is still experimental, and will be extended to more data viewers in future.
Datasets that include attributes with a Numpy
datetime64 dtype will now
be recognized by the scatter and histogram viewers, which will correctly format
the axis labels using dates/times. In future we will make it possible to use
this functionality to format dates/times read from files.
Relative paths in session files¶
When exporting a session file from glue, it is now possible to select to refer to the data files using relative paths rather than absolute paths. The relative paths are determine relative to the location of the session file. This makes it easier to send small session files to other users who have the same data already on disk.
Mouse interaction with subsets in the image viewer¶
It is now possible to select and manipulate subsets in the image viewer using the mouse. Previously, only newly created subsets could be resized and relocated. Now it is possible to relocate any subset simply by left-clicking on it and dragging it to a new location. Right-clicking on an existing subset opens a context menu with an option for deleting that subset. Note that for now this only works with the image viewer but in future we will generalize this to other viewers.
This release includes a number of significant performance enhancements (both in terms of speed and memory usage). The linking infrastructure has been refactored to be much more efficient (previously, linking more than a dozen datasets together could lead to significant performance issues), and the propagation of selections across datasets in the presence of linking functions has also been improved. Reading HDF5 files will now use memory mapping when possible to avoid loading all the data into memory, and 3D selections are represented in a much more memory-efficient way.
Glue 0.13 is now compatible with the PySide2 library (the Python bindings for Qt5 developed by the Qt company). Since PySide2 was still in pre-release at the time of writing, we recommend using Glue with PyQt5 for now. In parallel with this, support for PyQt4 and PySide has now been removed from glue.
What’s new in glue v0.12?¶
Improved 2D scatter viewer¶
It is now possible to show arrows/vectors in the 2D Scatter viewer:
To use this, see the new Vectors tab below the layer list when using the 2D Scatter viewer. In addition, we have made a number of improvements to the user interface of this viewer to make it easier to enable/disable different visualizations (markers, lines, errorbars, and vectors).
User interface improvements¶
We have made a number of improvements to the user interface and general usability. In particular, selecting disabled layers in a viewer will now give a clear explanation that the layer is disabled and will give possible causes, rather than relying solely on visual cues (such as graying out a layer).
Custom startup actions¶
It is now possible to define custom startup actions to execute when glue starts up by writing simple Python functions in a config.py file or in plugin packages. Startup actions are executed once glue is open and any data provided on the command-line (if any) has been opened. Find out more about writing custom startup actions.
Custom data/subset actions¶
It is now possible to specify custom actions that can be accessed by right/control-clicking on a dataset or subset, using the new @layer_action decorator. The following screenshot shows an example of a custom action added by a user to smooth data in a particular way:
Experimental SAMP plugin¶
A number of Astronomy applications including TOPCAT, Aladin, DS9, WorldWideTelescope and more support a message-passing system that allows data and subsets to be exchanged between applications. We have now developed a plugin that adds SAMP capabilities to glue. To try this out, you will need to install the glue-samp package, using:
conda install -c glueviz glue-samp
if you use conda, or:
pip install glue-samp
otherwise. To use this, once inside glue, go to the Plugins menu, then select Open SAMP plugin. The window that open will provide information on using this plugin. Note however that this plugin is experimental and is still missing a number of features. In addition, SAMP implementation in other applications is sometimes buggy, so you may encounter issues unrelated to glue.
Improved performance in 3D viewers¶
The 3D Volume Rendering is now significantly faster for large datasets. In particular, the resolution of the rendering is now reduced when rotating or zooming, and we have made it so that the viewer is now much more efficient in terms of memory.
Experimental fixed layout/dashboards [advanced]¶
By default, glue uses a free-form canvas to contain viewers, which gives you the ability to arrange the data viewers in any way you like. However, for certain applications, it can be helpful to defined tabs that contain data viewers in a predefined layout. This is now possible, although note that this is still an experimental feature and requires some knowledge of how to set up Qt widgets. In future, we will make it possible to define layouts in a more intuitive way.
What’s new in glue v0.11?¶
The v0.11 release of glue includes a number of exciting new features and improvements, so let’s take a look at what’s new!
New Slack community¶
We have now set up Slack for any glue help/discussions, and we encourage you to sign up! You will need to first get an account here after which you will be able to sign in to https://glueviz.slack.com.
The main interface of the application has been improved, and now features a toolbar at the top with quick access to common functionality, as well as a clearer link to the error console (which replaces the square in the bottom right of the interface).
We’ve also done a lot of work to improve the layout of many of the option widgets, fixing font sizes, and so on. We hope you like the updated interface!
New built-in viewers¶
The built-in histogram, scatter, and image viewers have now been completely re-written and now include new functionality. For example, the scatter viewer now includes the ability to color-code or resize points based on another attribute (this was previously possible in the 3D scatter viewer only):
The scatter viewer now also includes the ability to show symmetric error bars in the x and/or y direction.
Finally, this viewer also allows you to plot the data using a continuous line rather than individual points.
The image viewer has also seen an overhaul - the main change in user experience is that multi-color images are now made via layers instead of using a special RGB mode, and any number of images can be combined using an arbitrary number of colormaps or colors, rather than being restricted to RGB colors:
Subset mask importers and exporters¶
While it was already possible to export data subsets as actual subsets of the data, it is now possible to import and export the boolean masks for subsets. At the moment, there is only built-in support for importing/exporting from FITS files, but defining new importers/exporters can easily be done, as described in Custom subset mask importers and Custom subset mask exporters. In future, we will add built-in support for a wider range of file formats.
This release includes a number of significant performance improvements. For example, there should now no longer be any delays when setting up links, and selections should propagate between viewers more efficiently.
Experimental WorldWide Telescope plugin¶
We have developed a plugin that provides a WorldWide Telescope (WWT) viewer inside glue:
To use this viewer, you will need to install the glue-wwt plugin, using:
conda install -c glueviz glue-wwt
if you use conda, or:
pip install glue-wwt
otherwise. This viewer is experimental and is still missing a number of features. For example, it can only be used to show datasets that have RA/Dec columns (not other types of coordinates). Please report any issues or feature requests here. If you would be interested in contributing to or help maintaining this plugin, we would also love to hear from you! (see here for different ways of getting in touch).
Experimental geospatial plugin¶
We have started to develop a plugin which aims to collect functionality relevant to the analysis of geospatial data. For now, the plugin provides a data factory that uses the rasterio package to read geospatial raster data. This includes reading in the coordinate system and showing longitude/latitude lines in image viewers, and also allows longitude/latitude scatter data to be overplotted:
To use this, you will need to install the glue-geospatial plugin, using:
conda install -c glueviz glue-geospatial
if you use conda, or:
pip install glue-geospatial
This plugin is experimental, and if you run into any issues or would like to see new features, please open an issue here. If you would be interested in contributing to or help maintaining this plugin, we would also love to hear from you! (see here for different ways of getting in touch).
If you programmatically create viewers from Python scripts, if you currently set attributes on viewers, you will need to update this code if using the built-in histogram, scatter, or image viewers.
The main change is that the viewer classes have been renamed as follows:
In addition, attributes related to the visualization are no longer set directly
on the viewer object but instead using a
state attribute on the viewers. For
example to set the
x attribute on the scatter plot viewer, you should set:
>>> viewer.state.x_att = ...
>>> viewer.xatt = ...
The motivation for this change is that the
state object is a new object that
represents the state of the viewer in a GUI-framework-independent way, and is a
cleaner way to encapsulate all the information needed to control the
visualization. See the Programmatically configuring viewers section for more details.
New conda glueviz channel¶
We now provide our own conda channel called
glueviz (rather than using
conda-forge), which should help alleviate installation issues some users have
reported in the past. This channel contains the stable versions of glue and
various plugin packages.
Note that it is also possible to install the latest developer version from the
glueviz/label/dev channel, though be aware that while you will get the
latest cutting-edge features, you may also be more prone to bugs/breakage.
What’s new in glue v0.10?¶
New data/subset exporters¶
It is now possible to easily export datasets and subsets by right-clicking (or control-clicking) on them and selecting Export Data or Export Subsets.
Custom data/subset exporters can be easily be defined by users - see Custom Data/Subset Exporters for more details. Currently only a small number of formats are supported by default but this will be expanded in future.
Performance has been significantly improved (in some cases by factors of 10-100) for cases where 2D datasets were linked with 3D or higher-dimensional datasets, and selections were made in 2D.
Ginga plugin now moved to a separate package¶
pip install glue-ginga
Compatibility with PyQt5 and Matplotlib 2.x¶
Glue and the 3D viewers are now fully compatible with PyQt5 and Matplotlib 2.x, which together provide sharper plots on high DPI (e.g. retina) displays.
Creating subset states for categorical components [advanced]¶
For users who like to create subsets programmatically or in the built-in IPython console, it is now possible to create subset states for categorical components using e.g.:
d.id['source'] == 'name'
What’s new in glue v0.9?¶
New table viewer¶
Glue now includes a table viewer for data with 1-dimensional components (such as tables). The table viewer highlights selections made in other viewers, and also allows selections to be made in the viewer:
To make a selection in the table, either select an existing subset in the Data Collection panel in the top left if you want to modify a subset, or make sure no subset is selected to make a new subset (as in other viewers), then click the button on the left in the table viewer toolbar, select rows you want to include in the subset, and press enter to validate the selection. You can also combine this with the usual logical selections (‘and’, ‘or’, etc.) from glue to modify existing subsets by adding/removing rows.
Improvements to 3D viewers¶
There have been a number of improvements to the 3D viewers provided by the glue-vispy-viewers package (now automatically installed with glue).
The main changes are:
The axes now include ticks, tick labels, and axis labels. For volume renderings, the values are the pixel coordinates for now, but in future we will allow the world coordinates to be shown.
Catalogs/tables can now be overplotted on top of volume renderings, as for the 2-d image viewer. To use this, you will first need to make sure that you link three components of the catalog/table to the three world coordinates of the cube shown in the volume rendering, then drag the catalog/table dataset onto the volume rendering. By selecting the layer corresponding to the catalog, you can then change the appearance of the markers.
There is now an option in the bottom left options panel to remove data that falls outside the coordinate axes box. This can be used for both the scatter viewer and volume rendering viewer.
There is also now an option to show the data in its original aspect ratio, assuming that the voxels are cubes. By default, the 3D viewers stretch the data so that it fills a cube.
It is now possible to visualize datasets of any dimensionality in the scatter plot viewer - however, note that this viewer currently becomes slow above a million points.
Improved plot.ly exporter¶
Glue has included the ability to export plots to the plot.ly service for a few versions now, but there was no way to control the privacy level of the resulting plots. When exporting to plotly, you will now be presented with a window that allows much finer control over the export:
World coordinates in slices¶
When viewing 3+ dimensional data in the image viewer, if the data has a world coordinate system defined, the coordinates can now be shown in the image slicers:
If the world coordinate system is not linearly related to the pixel slices, a warning will be shown to indicate that the world coordinates are measured along a line that goes down the center of the cube.
Improvements to Astronomy-specific functionality¶
If you have the spectral-cube package installed, glue can now use this to read in spectral cubes in FITS format. To use this, you will need to go through the Open Data Set menu item and explicitly select FITS Spectral Cube from the list:
We haven’t enable this by default at this time because this modifies the order of the axes, and splits the Stokes components into glue data components, which may not always be desirable.
In addition, units are now properly read from FITS and VO tables, and are shown in the table viewer. In future, we will also show the units in the different viewers.
Finally, a new linking function is now available to link celestial Galactic coordinates to 3D Galactocentric coordinates.
join_on_key() method can be used for advanced
linking scenarios - for instance linking datasets by e.g. an ID in two different
datasets. In this version, we have added some advanced possibilities, for
example linking by combinations of keys, as well as allowing one-to-many and
many-to-one linking. For more information, see the documentation for
This functionality is still experimental, and we will provide in future a window in the graphical user interface to explain and make it easy for users to set up these kinds of links.
Data updating [advanced]¶
A new method,
update_values_from_data() has been
added to allow values in datasets to be updated based on another dataset. This
allows users to open a dataset, create different viewers, make selections,
and then load a more recent version of the dataset and update the values,
keeping all the viewers open.
Infrastructure changes [advanced]¶
The code to handle toolbars in viewers has now been completely refactored, and it is much easier for people developing their own viewers to define toolbars and tools for their viewers. A new page, Custom tools for viewers and custom toolbars, has been added to the documentation to show how to use this functionality.
What’s new in Glue v0.8?¶
Playback controls for image slicing¶
When using the image viewer to view datasets with more than two dimensions, the sliders snow include playback controls that you can use to animate the slicing.
By clicking multiple times on the play forward or play back button (the buttons on either side of the stop button), you can speed up the animation.
Improved new component window¶
The Define New Component window has now been significantly improved. The syntax of the expression for the new component is now validated on-the-fly, and the component cannot be created until the expression validates:
Adding data to glue from Python¶
If you make use of the
qglue() function to launch glue from IPython
or the Jupyter notebook, you can now easily continue to add data to glue from
that Python session, by doing e.g.:
>>> app = qglue(data1=array1) >>> app.add_data(data2=array2)
More details can be found here.
New preferences dialog¶
A new dialog for preferences is now available via File -> Edit Preferences, and allows you to change the settings for the foreground/background color of viewers, as well as the default data color and transparency:
Improved feedback window¶
The Send Feedback functionality available through the Help menu and the window to send crash reports to the developers now also provide the option to specify an email address in case you want to be contacted about the feedback/bug report:
Circular and polygonal profile extraction¶
The spectrum/profile extraction tool for the image viewer now supports extraction using circular and polygonal regions.
What’s new in Glue v0.7?¶
Code and development reorganization¶
Since the v0.6.x releases, a lot of work has gone into reorganizing the Glue code base to make it more modular and more accessible for new developers. The documentation has also been completely reorganized and expanded, and now includes a description of some aspects of the Glue architecture and information for anyone interested in getting involved in Glue development.
We also have a new mailing list glue-viz-dev for anyone interested in development, so if you are interested in getting involved, please join the list and let us know!
As a result of the code reorganization, some imports may need to be updated if you are using glue from scripts. Please see this page for more details on what’s changed!
Layer artist options¶
When visualizing data in one of the data viewers, the list of layers is given in the ‘Plot Layers’ list in the left sidebar. While it was possible to edit the style of these layers via a contextual menu previously, we have now made the options more visible below the list:
This is currently implemented for the scatter and histogram viewers, and will be extended to other viewers in future.
Glue is now able to read in
.npz files produced by Numpy.
Thanks to Adrian Price-Whelan for contributing this feature!
Bug fixes and usability improvements¶
A number of usability issues have been fixed. Of particular note, in the v0.6.x releases, lasso selection no longer worked in scatter plots with categorical components on one or more of the axes, but this has now been fixed (thanks to Will Dampier for refactoring the way selection of categorical components is handled internally!).
What’s new in Glue v0.6?¶
Improved file readers¶
A significant amount of work has gone into improving the build-in readers for various data formats. In particular:
Glue now supports a wider range of ASCII table formats. Any format that can be read by the Astropy package can now be read by Glue. If you run into ASCII tables that cannot be read, please let us know!
The HDF5 file reader will now read in all datasets from a file, including both tabular and gridded data. The path to the HDF5 dataset is now reflected in the label for the dataset in Glue.
The Excel file reader is now significantly more robust. In particular, it can now read in files with multiple sheets, and the sheet name is now included in the label for the data.
The FITS file reader (a data format commonly used in Astronomy) will now read in all header-data units (HDUs) from FITS files rather than simply reading the first. In addition, FITS files with compressed HDUs will now be read correctly.
In Glue v0.5, we introduced the ability to develop separate plugin packages and have these be registered automatically with glue once installed. In some cases it can be useful to disable/enable specific plugins, so the Plugins menu now includes a plugin manager that can be used to enable/disable plugins. This is then stored in a configuration file in the user’s home directory, and the configuration is preserved from one session to the next:
Improvements to image viewer¶
The image viewer now includes an Aspect setting that can be used to control the aspect ratio of the pixels:
If this is set to Square Pixels (the default), the data is always shown with square pixels, which may result in empty space around the data but is more correct when the data is an actual image:
On the other hand, if this is set to Automatic, the data is distorted to fill the axes:
For data cubes, the slider(s) used to move through slices along the extra dimension(s) now includes the ability to manually specify the slice to move to, as well as buttons to step through slices, and go to the first or last slice:
Finally, when extracting a spectrum/profile from a data cube, the box used to extract the spectrum can now be moved around by pressing the control key and dragging the box around, resulting in the spectrum/profile being updated in real time.
For anyone developing custom data factories, the
can now accept a
priority= argument that should be set to a positive
integer value (with the default being zero). This priority is then used in
case of multiple data factories being able to read a given file. For example,
if you are develop a data factory that reads FITS files in a special way, and
want it to take precedence on all other data factories, you can set the
priority to a large value.
Experimental support for PyQt5¶
Python 2.6 support¶
This will be the last major release to support Python 2.6. Future releases will support only Python 2.7 and 3.3 and above.
In addition to the new features described above, we have made a number of internal improvements to the code structure, and have fixed a number of usability bugs reported by users.
What’s new in Glue v0.5?¶
Python 3 compatibility¶
Glue v0.5 is now fully compatible with Python 2.6, 2.7, and 3.3 and later.
Installation with conda¶
If you make use of Anaconda or Miniconda, Glue can now be installed very easily by doing:
conda install glueviz
This will install glue itself as well as all of the required and many optional dependencies.
Glue v0.5 includes a number of new features, in particular:
The ability to include a copy of all datasets in
.glusession files, to make it easier to exchange session files with other users. When saving a session file, choose the option to include all data from the drop-down menu:
An improved interface for creating new components, including tab-completion and color highlighting of component names.
The ability to pass
HDUListobjects when using
The ability to define floating-point and text parameter boxes when defining custom viewers.
Support for more coordinate frames for the Astronomy coordinate system transformations.
The ability to drag existing selection regions by pressing ‘control’, selecting a selection, and moving it around.
In addition to the new features described above, we have made a number of internal improvements to the code structure, and have fixed a number of usability bugs reported by users.