pywwt icon indicating copy to clipboard operation
pywwt copied to clipboard

Silent no-ops if call functions on (Jupyter?) WWT widget before showing it

Open pkgw opened this issue 5 years ago • 0 comments

I ran the following code in a Jupyter notebook:

from pywwt.jupyter import WWTJupyterWidget
from astropy.coordinates import SkyCoord
from astropy import units as u
kepler = SkyCoord(76.532562, 13.289502, unit='deg', frame='galactic')
wwt = WWTJupyterWidget()
wwt.center_on_coordinates(kepler, fov=40 * u.deg)
wwt

In my opinion, it's reasonable to expect that this will show a WWT Jupyter widget that is centered on the Kepler field. However, what you get is a WWT widget centered on the default field position.

If you rerun the center_on_coordinates() call after showing the widget, however, the view centers on the Kepler field. My best interpretation is that various calls like this can't take any effect until the widget is shown.

I can definitely imagine how there is a probably a technical limitation that we can't do anything until the widget is shown. But if this is indeed the case, function calls like center_on_coordinates() should probably throw an exception rather than silently doing nothing.

Edit: I don't think this can happen in the Qt widget since the view pops open as soon as you create the object.

pkgw avatar Apr 23 '19 16:04 pkgw