Skip to content

Commit

Permalink
fix ipynbplotutils.Plot3D
Browse files Browse the repository at this point in the history
meshgrid is in numpy now.
PIL now correctly refuses to store an RGBA as JPEG,
see python-pillow/Pillow#2609.
  • Loading branch information
ederag committed Feb 20, 2022
1 parent 81542c4 commit 0aeeea6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions pyoptools/gui/ipynbplotutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ def show(self):
'''Show the PIL image with the default viewer'''
self.image.show()

def _repr_jpeg_(self):
'''Ipython can embed the jpg image directly
from http://ipython.org/ipython-doc/dev/config/integrating.html
def _repr_png_(self):
'''return a png image
to be embedded directly by Ipython:
https://ipython.readthedocs.io/en/stable/config/integrating.html
'''
temppng = six.BytesIO()
self.image.save(temppng, "JPEG")
self.image.save(temppng, "PNG")
data = temppng.getvalue()
temppng.close()
return data
Expand Down
3 changes: 1 addition & 2 deletions pyoptools/raytrace/surface/surface.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ from warnings import warn
from sys import exit
from numpy import absolute, arccos, array, cos as npcos, dot, isinf as npisinf,inf, isnan as npisnan, \
power, sqrt as npsqrt, sometrue, zeros_like, ones_like, histogram2d, \
linspace, abs, indices, argwhere, tan, polyfit,arange,where
linspace, meshgrid, abs, indices, argwhere, tan, polyfit, arange, where
from numpy.fft import fft2, ifft2
from numpy.ma import array as ma_array

from scipy.signal import medfilt2d
from scipy import interpolate
from pylab import meshgrid

from inspect import getmembers, isroutine

Expand Down

0 comments on commit 0aeeea6

Please sign in to comment.