We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was able to correct a couple issues and make simple plots.
Patch below
diff --git a/python/vaex/image.py b/python/vaex/image.py index 70fe8a0..78f63fb 100644 --- a/python/vaex/image.py +++ b/python/vaex/image.py @@ -1,12 +1,15 @@ __author__ = 'maartenbreddels' import PIL.Image import PIL.ImageDraw -import StringIO import collections import numpy as np import matplotlib.colors import warnings from base64 import b64encode +try: + from StringIO import StringIO +except: + from io import StringIO def rgba_2_pil(rgba): with warnings.catch_warnings(): @@ -15,7 +18,7 @@ def rgba_2_pil(rgba): return im def pil_2_data(im, format="png"): - f = StringIO.StringIO() + f = StringIO() im.save(f, format) return f.getvalue() @@ -37,7 +40,7 @@ cairo_modes["saturate"] = (lambda aA, aB: np.minimum(1, aA + aB), cairo_modes["add"] = (lambda aA, aB: np.minimum(1, aA + aB), lambda aA, xA, aB, xB, aR: (aA*xA + aB*xB)/aR) -modes = pdf_modes.keys() + cairo_modes.keys() +modes = list(pdf_modes.keys()) + list(cairo_modes.keys()) def background(shape, color="white", alpha=1, bit8=True): rgba = np.zeros(shape + (4,)) rgba[:] = np.array(matplotlib.colors.colorConverter.to_rgba(color))
The text was updated successfully, but these errors were encountered:
thx for the patch, I'll make sure it's covered by the unittests and apply this.
Sorry, something went wrong.
I added unittests that covers this, let me know if it works.
No branches or pull requests
I was able to correct a couple issues and make simple plots.
Patch below
The text was updated successfully, but these errors were encountered: