Repository navigation
Conversation
3587080 to
7033dd4
Compare
|
Found the culprit (actually there are 2). @astrofrog , now that you have the traceback, what would be your recommendation as a proper fix? /home/travis/build/astropy/astropy/docs/visualization/wcsaxes/custom_frames.rst:10: WARNING: Exception occurred in plotting custom_frames-1
from /home/travis/build/astropy/astropy/docs/visualization/wcsaxes/custom_frames.rst:
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 651, in render_figures
figman.canvas.figure.savefig(img.filename(format), dpi=dpi)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/figure.py", line 1573, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2200, in print_figure
**kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 545, in print_png
FigureCanvasAgg.draw(self)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 464, in draw
self.figure.draw(self.renderer)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/figure.py", line 1144, in draw
renderer, self, dsu, self.suppressComposite)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
a.draw(renderer)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/core.py", line 341, in draw
ticklabels_bbox=self._ticklabels_bbox)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/coordinate_helpers.py", line 438, in _draw
ticklabels_bbox=ticklabels_bbox)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/ticklabels.py", line 187, in draw
'calculations: {}'.format(dist))
ValueError: Invalid denominator for tick label calculations: 0.0/home/travis/build/astropy/astropy/docs/visualization/wcsaxes/custom_frames.rst:37: WARNING: Exception occurred in plotting custom_frames-2
from /home/travis/build/astropy/astropy/docs/visualization/wcsaxes/custom_frames.rst:
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 651, in render_figures
figman.canvas.figure.savefig(img.filename(format), dpi=dpi)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/figure.py", line 1573, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2200, in print_figure
**kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 545, in print_png
FigureCanvasAgg.draw(self)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 464, in draw
self.figure.draw(self.renderer)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/figure.py", line 1144, in draw
renderer, self, dsu, self.suppressComposite)
File "/home/travis/miniconda/envs/test/lib/python3.6/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
a.draw(renderer)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/core.py", line 341, in draw
ticklabels_bbox=self._ticklabels_bbox)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/coordinate_helpers.py", line 438, in _draw
ticklabels_bbox=ticklabels_bbox)
File "/home/travis/build/astropy/astropy/build/lib.linux-x86_64-3.6/astropy/visualization/wcsaxes/ticklabels.py", line 187, in draw
'calculations: {}'.format(dist))
ValueError: Invalid denominator for tick label calculations: 0.0 |
|
@pllim - Could you make this ready for final review? It would have the advantage that I can make sure @astrofrog review this while we're both here... |
|
@bsipocz , rebased and added change log (I feel like this is a bug fix) for v2.0. If @astrofrog thinks the default is reasonable, feel free to merge. I don't think it is critical bug to warrant a 1.3.3 tag. Basically we need to handle cases where |
|
Someone please corner @astrofrog over there in Leiden and make him review this. 😂 |
|
@pllim - Already did that, he promised to have a look :) |
|
I'm investigating this - I'm not satisfied with the fix for now since I don't understand why this happens - this indicates somehow that the bounding box is a point, which seems... weird. |
|
Minimal example to reproduce the warning: from astropy.wcs import WCS
from astropy.io import fits
from astropy.utils.data import get_pkg_data_filename
from astropy.visualization.wcsaxes.frame import EllipticalFrame
import matplotlib.pyplot as plt
filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits')
hdu = fits.open(filename)[0]
wcs = WCS(hdu.header)
ax = plt.subplot(projection=wcs, frame_class=EllipticalFrame)
plt.savefig('test.png') |
|
Investigating how to properly fix... |
|
Superseded by #6063. |
This removes
RuntimeWarningfromwcsaxesin Sphinx build test log. This was part of #5997 but then taken out here. Also see #5992 (comment).@astrofrog I don't know how to add regression test to visualization code, so I am making it raise an exception instead and then see what value is causing the warning in the first place. Maybe this will give us a clue on the proper fix.
TODO: