sirrice / pygg

ggplot2 syntax in python. Actually wrapper around Wickham's ggplot2 in R
MIT License
73 stars 9 forks source link

Python 3 compatibility #19

Open ivan-krukov opened 7 years ago

ivan-krukov commented 7 years ago

This is the resolution for #17.

I had to change the way the module is imported. Now instead of

Rscript bin/make_ggplot2_functions.R >> pygg/pygg.py, one would

Rscript bin/make_ggplot2_functions.R > pygg/ggplot2_functions.py

I think this is a little cleaner. It should also probably be added into the build script.

The functions are imported in __init__.py through a series of exec statements given the content of pygg/ggplot2_functions.py.

All of the above is to allows to cleanly import everything through __all__ without having to do from pygg import *, which would not work in py3.

The rest of the changes are of a cosmetic nature (print -> print(), etc.)

Thanks for a great module!

sirrice commented 7 years ago

this is awesome! will take a look in the next day.