-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
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
Migrate matplotlib matplot_dep to Python 3.4 #252
Comments
How do you do imports in python 3.4, I am still a total noob in python 3 : ) |
You want fixes pushed to devel?
|
Either direct push (to devel) or through pull requests. Master gets only updated, when I have looked at the crosscompiler (#250). |
I think Max deserves some form of (at least partial) immunity from the On Wed, Sep 16, 2015 at 3:19 PM, Max Zwiessele [email protected]
|
Hints on migrating pylab to matplotlib from a novice to python(2.7 or 3.4) on conda 3.17: -some guidelines on good syntax can be found here: https://github.com/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb https://github.com/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb
o Import matplotlib o Import matplotlib.pyplot as plt o Import numpy as np
Hope this helps someone to take charge of updating GPy and notebook. From: Neil Lawrence [mailto:[email protected]] I think Max deserves some form of (at least partial) immunity from the On Wed, Sep 16, 2015 at 3:19 PM, Max Zwiessele <[email protected] mailto:[email protected] >
— |
I think I fixed this on the devel branch. Can someone double check please? |
I have systematically checked the notebooks for conformity with: %matplotlib inline Import matplotlib Import matplotlib.pyplot as plt Import numpy as np All the notebooks of GPy run smoothly after the usual print (m) and coherence of pb into plt with the exception of magnificationFactor.ipynb and sampling.ipynb In magnification Factor at: fig, axes = plt.subplots(1, 2, figsize=(15,5)) v1 = m_gplvm.plot_latent(labels=labels, ax=axes[0], updates=False, resolution=100) axes[0].set_title('Latent Space') v2 = m_gplvm.plot_magnification(labels=labels, ax=axes[1], updates=False) axes[1].set_title('Magnification') produces this error: NameError Traceback (most recent call last) in ()
----> 2 v1 = m_gplvm.plot_latent(labels=labels, ax=axes[0], updates=False, resolution=100)
C:\Users\Denis\Anaconda3\lib\site-packages\GPy\models\gplvm.py in plot_latent(self, labels, which_indices, resolution, ax, marker, s, fignum, legend, plot_limits, aspect, updates, **kwargs)
---> 84 plot_limits, aspect, updates, **kwargs) C:\Users\Denis\Anaconda3\lib\site-packages\GPy\plotting\matplot_dep\dim_reduction_plots.py in plot_latent(model, labels, which_indices, resolution, ax, marker, s, fignum, plot_inducing, legend, plot_limits, aspect, updates, predict_kwargs, imshow_kwargs)
--> 158 this_label = unicode(ul)
NameError: name 'unicode' is not defined In sampling.ipynb, plots(s) produces this error: TypeError Traceback (most recent call last) in () ----> 1 plt(s) TypeError: 'module' object is not callable And a few others below on “name xrange is not defined” Let me advocate the general use of this command in each notebook %reload_ext version_information %version_information conda, GPy, matplotlib, numpy Out[10]: Software Version Python 3.4.3 64bit [MSC v.1600 64 bit (AMD64)] IPython 4.0.0 OS Windows 8 6.2.9200 conda 3.18.1 GPy 0.8.8 matplotlib 1.4.3 numpy 1.9.3 Sat Oct 03 16:19:24 2015 South Africa Standard Time Thanks. From: Max Zwiessele [mailto:[email protected]] I think I fixed this on the devel branch. Can someone double check please? — |
Great I am doing the refactoring right now. Please have a look into the branch: plot_density It is still work in progress, but I expect it to be done tonight or tomorrow. It will also support multiple plotting libraries, which was the plan of the plotting module all along. If you don’t do everything yourself, no-one does ; )
|
On installing plot_density, I get the following error. Is “pypandoc” a module of GPy or some other package? Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Denis\AppData\Local\Temp\pip-_kpjl1k2-build From: Max Zwiessele [mailto:[email protected]] Great I am doing the refactoring right now. Please have a look into the branch: plot_density It is still work in progress, but I expect it to be done tonight or tomorrow. It will also support multiple plotting libraries, which was the plan of the plotting module all along. If you don’t do everything yourself, no-one does ; )
— |
can you try it again?
|
Here it is. Pandoc does not pip install properly in py3. !pip install --upgrade https://github.com/SheffieldML/GPy/archive/plot_density.zip Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip
From: Max Zwiessele [mailto:[email protected]] can you try it again?
— |
ach goddamit, better now?
|
One more time? !pip install --upgrade https://github.com/SheffieldML/GPy/archive/plot_density.zip Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip
From: Max Zwiessele [mailto:[email protected]] ach goddamit, better now?
— |
I am also having this issue and can reproduce the error messages mzwiessele posted above. |
We have a patch waiting in the branch plot_density! If you guys can check that out again, that would be great! There is still work left to do, but basic plotting works for matplotlib and plotting (see config file)
|
Max, As before in Python 3.4, plot_density does not install properly because pandoc pypandoc dependencies do not install correctly. The message is: Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Denis\AppData\Local\Temp\pip-izkplg2a-build As before my config is: Software Version Python 3.4.3 64bit [MSC v.1600 64 bit (AMD64)] IPython 4.0.0 OS Windows 8 6.2.9200 numpy 1.9.3 scipy 0.16.0 matplotlib 1.4.3 sympy 0.7.6.1 quantecon 0.2.2 GPy 0.8.8 climin pre-0.1 version_information 1.0.3 Mon Oct 12 10:41:19 2015 Turkey Daylight Time From: Max Zwiessele [mailto:[email protected]] We have a patch waiting in the branch plot_density! If you guys can check that out again, that would be great! There is still work left to do, but basic plotting works for matplotlib and plotting (see config file)
— |
pandoc is not a dependency. It is only for generating the pypi rst readme. It seems, that the exception occurs in f.read(), while reading the readme. there is unicode characters in the readme, that is why it breaks down. I have written a patch using the codecs module, maybe that knows how to handle windows. Can you try it again? |
Sry merge issues, the patch is now out. |
Almost there. Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Denis\AppData\Local\Temp\pip-atnr396i-build From: Max Zwiessele [mailto:[email protected]] Sry merge issues, the patch is now out. — |
Just fixed that one as well : )
|
It looks promising? |
One more step….. Collecting https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip Downloading https://github.com/SheffieldML/GPy/archive/plot_density.zip https://github.com/SheffieldML/GPy/archive/plot_density.zip (1.3MB)
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Denis\AppData\Local\Temp\pip-3cflln_n-build From: Max Zwiessele [mailto:[email protected]] It looks promising? — |
This I have never ever seen before. Have you got the newest version of numpy? In order to use the c libraries you will also need a compiler (e.g. mingw or visual) for this branch, as there are no build distros of this yet (it is in development :) |
When using conda try
Does that update? |
It does run on travis and on my local machine. So now it is windows related problems, and I do not have a windows machine at ease : ( We gonna have to find a solution for this together, I'm afraid. |
This is always the latest version. My config is: Software Version Python 3.4.3 64bit [MSC v.1600 64 bit (AMD64)] IPython 4.0.0 OS Windows 8 6.2.9200 numpy 1.9.3 scipy 0.16.0 matplotlib 1.4.3 sympy 0.7.6.1 quantecon 0.2.2 GPy 0.8.8 climin pre-0.1 version_information 1.0.3 From: Max Zwiessele [mailto:[email protected]] When using conda try conda update numpy Does that update? — |
If this works to your satisfaction on travis and your local machine, can you pls merge with devel branch as the matplotlib issue can be considered solved. The issue on windows and the possible use of c compiler will have to wait a few more days. Visual Studio, c and f compilers have been a nightmare on windows for years. However, there is light at the end of the tunnel: Continuum Anaconda will be releasing shortly Anaconda 2.4 with Python 3.5 as standard. In turn py3.5 meshes smoothly with Visual Studio Community 2015 as reported here: http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/ http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/ This would make windows finally comparable to linux in terms of efficiency. Another route is to wean GPy master and GPy devel from cython and move to numba and numbaPro. The demo notebooks on this score appear to favour the use of numba and jit instead of the cython approach. Thank you. From: Max Zwiessele [mailto:[email protected]] It does run on travis and on my local machine. So now it is windows related problems, and I do not have a windows machine at ease : ( We gonna have to find a solution for this together, I'm afraid. — |
Numba is still too unstable to be used in library code (features coming in and out, bugs... require keeping up with conda's development), and requires a specific version of LLVM, which means you are practically tied to Conda.. |
Fixed by #262. |
See open issue in notebook, SheffieldML/notebook#5
The trace in GPy.devel in running coregionalisation.ipnb is:
ImportError Traceback (most recent call last)
in ()
6 m.optimize()
7 print (m)
----> 8 plot_2outputs(m,xlim=(0,100),ylim=(-20,60))
in plot_2outputs(m, xlim, ylim)
5 ax1.set_xlim(xlim)
6 ax1.set_title('Output 1')
----> 7 m.plot(plot_limits=xlim,fixed_inputs=[(1,0)],which_data_rows=slice(0,100),ax=ax1)
8 ax1.plot(Xt1[:,:1],Yt1,'rx',mew=1.5)
9 #Output 2
C:\Users\Denis\Anaconda3\lib\site-packages\GPy\core\gp.py in plot(self, plot_limits, which_data_rows, which_data_ycols, fixed_inputs, levels, samples, fignum, ax, resolution, plot_raw, linecol, fillcol, Y_metadata, data_symbol, predict_kw, plot_training_data, samples_y, apply_link)
583 """
584 assert "matplotlib" in sys.modules, "matplotlib package has not been imported."
--> 585 from ..plotting.matplot_dep import models_plots
586 kw = {}
587 if linecol is not None:
C:\Users\Denis\Anaconda3\lib\site-packages\GPy\plotting\matplot_dep__init__.py in ()
2 # Licensed under the BSD 3-clause license (see LICENSE.txt)
3
----> 4 from . import base_plots
5 from . import models_plots
6 from . import priors_plots
ImportError: cannot import name 'base_plots'
The text was updated successfully, but these errors were encountered: