tag:blogger.com,1999:blog-85455644860860404042024-03-12T22:58:49.119-07:00spyderSpyder is a free open-source development environment for the Python programming language providing MATLAB-like features in a simple and light-weighted software, available for all major platforms (Windows, Linux, MacOS X).Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-8545564486086040404.post-65014334901261522292016-08-05T01:59:00.002-07:002016-08-05T01:59:41.200-07:00Qt Charts (PyQt5.QtChart) as (Py)Qwt replacementI've just discovered an interesting alternative to PyQwt for plotting curves efficiently. That is <a href="http://doc.qt.io/qt-5/qtcharts-index.html">Qt Charts</a>, a module of Qt which exists at least since 2012 according to <a href="https://www.riverbankcomputing.com/software/pyqtchart/intro">PyQtChart</a> changelog (PyQtChart is a set of Python bindings for Qt Charts library).<br />
<br />
Here is a simple example which is as efficient as PyQwt (and much more efficient than PythonQwt):<br />
(the associated Python code is <a href="https://github.com/PierreRaybaut/plotpy/wiki/Using-Qt-Charts-(PyQtChart)-to-plot-curves-efficiently-in-Python!">here</a>)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBhjUKKPIyBcI3VuW-PqT4wp7GvLQedxAEcnWvfqNZFtnY8lV_9mzSaqWBPAAouLk1OvDmElXZ8wsWHtT7fyKfoqMDcuV4uT7rl5TFTR573vVNdXN7X1yqF-m5de7ezXcZ5hCq7BkVlsN0/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBhjUKKPIyBcI3VuW-PqT4wp7GvLQedxAEcnWvfqNZFtnY8lV_9mzSaqWBPAAouLk1OvDmElXZ8wsWHtT7fyKfoqMDcuV4uT7rl5TFTR573vVNdXN7X1yqF-m5de7ezXcZ5hCq7BkVlsN0/s1600/Capture.PNG" /></a></div>
<br />
<br />Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com0tag:blogger.com,1999:blog-8545564486086040404.post-87045489162622314112014-12-03T13:26:00.000-08:002015-01-06T13:31:50.953-08:00Spyder 2.3.2 is released!Hi all,<br />
<br />
On the behalf of Spyder's <a href="http://code.google.com/p/spyderlib/people/list">development team</a>, I'm pleased to announce that Spyder 2.3.2 has been released and is available for Windows XP/Vista/7/8, GNU/Linux and MacOS X: https://bitbucket.org/spyder-ide/spyderlib/downloads<br />
<br />
This release represents more than 2 months of development since 2.3.1 and introduces major enhancements and new features:<br />
<br />
- Editor<br />
- Improve cells visualization<br />
- Add support for drag selection and improve look of line number area<br />
- Open on it any text file present in the Variable Explorer<br />
- View and edit IPython notebooks as Json files<br />
- Syntax highlighting for Json and Yaml files<br />
<br />
- Variable Explorer:<br />
- Import csv files as Pandas DataFrames<br />
- Improve browsing speed for NumPy arrays and DataFrames with more than 1e5 elements<br />
<br />
- IPython Console<br />
- Add a stop button to easily stop computations<br />
<br />
We fixed almost 40 bugs, merged 13 pull requests from 8 authors and added about 150 commits between these two releases.<br />
<br />
This is a very important bugfix release which solves a lot of unicode problems in our consoles, the variable explorer and the main interface, so everyone is encouraged to update.<br />
<br />
For a full list of fixes see our <a href="https://code.google.com/p/spyderlib/wiki/ChangeLog">changelog</a>Carloshttp://www.blogger.com/profile/11855259147337546469noreply@blogger.com2tag:blogger.com,1999:blog-8545564486086040404.post-12745691658177677692014-07-13T21:18:00.000-07:002015-01-06T13:34:46.668-08:00Spyder 2.3 is released!<span style="font-size: small;">Hi all,<br /><br />On the behalf of Spyder's <a href="http://code.google.com/p/spyderlib/people/list">development team</a>, I'm pleased to announce that Spyder 2.3 has been released and is available for Windows XP/Vista/7/8, GNU/Linux and MacOS X here: <a href="https://bitbucket.org/spyder-ide/spyderlib/downloads">https://bitbucket.org/spyder-ide/spyderlib/downloads</a><br /><br />This release represents 14 months of development since version 2.2 and introduces major enhancements and new features:<br /> </span><br />
<ul>
<li><span style="font-size: small;">Python 3 support (versions 3.2, 3.3 and 3.4 are supported).</span></li>
<li><span style="font-size: small;">Drop Python 2.5 support. </span></li>
<li>Various Editor improvements:</li>
<ul>
<li>Use the Tab key to do code completions</li>
<li>Highlight cells</li>
<li>First-class support for Enaml files</li>
<li>Improve how calltips are shown</li>
<li>Better looking Object Inspector</li>
</ul>
</ul>
<ul>
<li><span style="font-size: small;">Several refinements to the user interface to make it easier and more intuitive</span> </li>
<li>And many other changes: <a href="http://code.google.com/p/spyderlib/wiki/ChangeLog">http://code.google.com/p/spyderlib/wiki/ChangeLog</a></li>
</ul>
<span style="font-size: small;">Spyder 2.2 has been a huge success (being downloaded more than 400,000 times!) and we hope 2.3 will be as successful as it. For that we fixed 70 important bugs, merged 30 pull requests from 11 authors and added almost 1000 commits between these two releases.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">Enjoy,</span><br />
<span style="font-size: small;">- Carlos</span>Carloshttp://www.blogger.com/profile/11855259147337546469noreply@blogger.com3tag:blogger.com,1999:blog-8545564486086040404.post-76367516371844892322013-12-24T05:26:00.000-08:002013-12-24T05:26:04.891-08:00WinPython, a portable scientific Python distribution for Windows(32&64bit)Following <a href="http://spyder-ide.blogspot.fr/2012/08/scientific-python-distribution-for.html">my recent post</a> on a free open-source 64-bit Python distribution for Windows, I was able to create the project (<a href="http://winpython.sourceforge.net/">WinPython</a>, "a portable scientific Python distribution for Windows") and write some code to generate a portable Python distribution from scratch (actually from existing distutils packages).<br />
<br />
I've just uploaded <a href="http://winpython.sourceforge.net/">WinPython</a> v2.7.3.0beta2 for both 32-bit and 64-bit Windows platforms.<br />
<br />
WinPython has its <a href="https://sourceforge.net/projects/winpython/">SourceForge project</a> and everything is ready for <a href="https://sourceforge.net/projects/winpython/files">downloads</a>, <a href="https://sourceforge.net/p/winpython/discussion/">discussions</a>, <a href="https://sourceforge.net/p/winpython/tickets/">bug reports and feature requests</a>.<br />
<br />
Enjoy! (I hope)Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com4tag:blogger.com,1999:blog-8545564486086040404.post-54313399285118522422013-01-24T12:24:00.000-08:002013-12-24T05:26:27.699-08:00Spyder v2.1.14 supports Python 3<a href="http://code.google.com/p/spyderlib/source/checkout?repo=v21">Spyder v2.1.14</a> is an experimental release of Spyder which I've been working on lately. Its purpose is to demonstrate the possibility for supporting both Python 2 and Python 3 with a single code base.<br />
<div>
<br /></div>
<div>
Great news: it works!</div>
<div>
(and I must admit that it was quite easy and that it took me far less time than expected)</div>
<div>
<br /></div>
<div>
So now you may switch to Python 3 with Spyder at your side.</div>
<div>
For example, Windows users may already start working with a full featured scientific Python ecosystem including Spyder thanks to <a href="http://winpython.sourceforge.net/">WinPython v3.3</a> which first beta was released recently. WinPython is now supporting both 32bit and 64bit versions of both Python 2 and Python 3, and all this in a portable way. In other words, with WinPython, you may run four versions of Python on the same machine without any prior configuration and without any interference: fast switching from a Windows-integrated (Windows explorer/registry integration) Python version to another is even possible!</div>
<div>
<br /></div>
<div>
Note that even if <a href="http://code.google.com/p/spyderlib/source/checkout?repo=v21">Spyder v2.1.14</a> supports Python 3, the forthcoming Spyder v2.2 release won't support it: Python 3 support will be officially implemented in Spyder v2.3 which will hopefully be released shortly after v2.2.</div>
Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com7tag:blogger.com,1999:blog-8545564486086040404.post-48453271810029600832012-08-05T07:05:00.001-07:002012-08-10T04:39:24.059-07:00Scientific Python distribution for Windows 64bitAs one of my image processing software (mainly based on NumPy, SciPy, guidata and guiqwt) is being limited by the "2GB per application" memory limit due to the fact that I'm using a 32bit build of Python on Windows, I'm currently thinking of switching to Python 64bit. That's why I've been recently investigating the 64bit/Windows/Python ecosystem. <br />
<br />
<b>1. The NumPy/SciPy building issue on Windows 64bit.</b><br />
<br />
According to experienced developers, there is no decent open-source (free) Fortran compiler for the Windows 64bit platform. As a consequence, it's impossible to build NumPy or SciPy on this platform using only free and open-source tools. That's why there is no official Windows 64bit binaries for these two libraries. The only ready-to-use installers available out there were prepared by Christoph Gohlke (using Intel Fortran compiler, a.k.a. 'ifort') and these are clearly unofficial binaries. Furthermore, Christoph has built two different installers for NumPy: one unoptimized and one optimized with the Intel Math Kernel Library (MKL), hence providing better performance. And Gohlke's SciPy 64bit binary package (the only one available freely online) require NumPy MKL. The problem is that, according to Christoph Gohlke, the MKL license does not allow me (or anyone else) to redistribute these binaries, unless I have purchased such a license. It is still unclear to me if the end user would also require this license too. Hopefully no. Let's assume that. Besides, after reading carefully the Intel MKL License terms, I'm quite sure that I can redistribute the MKL-based NumPy built because it's just runtime redistribution. So I think I will purchase an Intel Fortran Compiler license (including MKL) to be able to rebuild NumPy and SciPy in the near future but in the meantime I will just redistribute the packages built by Christoph Gohlke. <br />
<br />
<b>2. The distribution: how? when?</b><br />
<br />
I'm planning on releasing publicly a completely free 64bit Python distribution by the end of 2012 (and I'll probably release a 32bit version too). To achieve this, I can't go on with Python(x,y): the concept has its limits and it's beginning to be difficult to maintain. So I'm thinking of something completely different: a portable Python distribution with a built-in package manager which would be able to install/uninstall Python packages to/from the distribution using standard Python installers (made with the standard Python library 'distutils') - support for eggs won't be added as I had very disappointing results with their unconventional way of installing packages, sometimes messing with the sys.path list. This portable distribution would also embed some useful tools like SciTE, WinMerge or TortoiseHg. But, unfortunately, as mentioned above (point 1.), there won't be any integrated C/C++/Fortran compiler in the 64bit edition (I'll probably integrate MinGW with gfortran in the 32bit edition of the distribution). <br />
<br />
<b>3. First experiments...</b><br />
<br />
I've already done a bunch of tests and this is working great. I just have to take the time to write scripts automating the distribution creation process from scratch: installing the official Python distribution (.msi file) to a folder, install PyQt by unzipping the official NSIS installer, create the batch scripts for running Python (or Spyder) in the appropriate environment, and so on. My current portable distribution test is able to run Spyder with all basic scientific packages. That is very interesting: a complete and ready-to-use (without any installation requirement) scientific Python distribution on a USB key!<br />
<br />
<i>To be continued...</i><br />
<br />
<br />
<b>Update</b><br />
This new project has now a name: this is WinPython. Check out the <a href="http://code.google.com/p/winpython/">website</a> for more informations. Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com6tag:blogger.com,1999:blog-8545564486086040404.post-90291762002676898282011-11-04T04:10:00.000-07:002011-11-04T04:10:51.333-07:00Spyder v2.1 is availableAfter a year of hard work on stability, performance and new features, Spyder v2.1 is now available for Windows XP/Vista/7, GNU/Linux and MacOS X.<br />
<br />
This release introduces major enhancements and new features:<br />
<ul>
<li>Large performance and stability improvements</li>
<li>PySide support (PyQt is no longer exclusively required)</li>
<li>PyQt API v1 and v2 support </li>
<li>New profiler plugin (thanks to Santiago Jaramillo, a new contributor)</li>
<li>Experimental support for IPython v0.11+</li>
<li>And many <a href="http://code.google.com/p/spyderlib/wiki/ChangeLog">other changes</a></li>
</ul>
<br />
We [the Spyder development team] are all very excited by this new release: Spyder is now becoming <u>the</u> [GUI-based] scientific development environment. Its future seems very promising. First there is the PySide support and the PyQt API v1/v2 support which were strategically essential (this will also help us supporting Python 3 in time). Second there is a cleaner and optimized code: this was critical for Spyder's behavior to be the closest possible to a standard Python interpreter. Third there is a very stable application: a lot of crashes and segmentation faults were fixed during the last year. Last, but not least, the future looks bright thanks to the new <b><a href="http://code.google.com/p/spyderlib/people/list">project members</a></b>: we are now 5 committers and 6 contributors.<br />
<br />
<i><b>Stand-alone executable on Windows platforms</b></i><br />
Note that, on Windows platforms, Spyder is also available as a stand-alone executable (don't forget to disable UAC on Vista/7). This all-in-one portable version is still experimental (for example, it does not embed sphinx -- meaning no rich text mode for the object inspector) but it should provide a working version of Spyder for Windows platforms without having to install anything else (except Python 2.x itself, of course).<br />
<br />
<i><b>Help needed</b></i><br />
More than ever, we welcome any contribution that helps making Spyder an efficient scientific development/computing environment. <a href="http://code.google.com/p/spyderlib/wiki/NoteForContributors">Join us</a> to help creating your favourite environment!Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com10tag:blogger.com,1999:blog-8545564486086040404.post-71666520919076511382011-09-11T02:14:00.000-07:002011-09-11T02:16:43.044-07:00New enhanced scientific Python interpreterAs I mentionned in my previous post, the standard Python interpreter provided by Spyder's console has been considerably enhanced. Moreover, despite these interesting enhancements, this is based on a real Python interpreter, not an emulation.<br />
<br />
The scientific startup script mentionned in my previous post was integrated in Spyder's development version (under the name <a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/scientific_startup.py">scientific_startup.py</a>).<br />
<br />
The goal of all these recent changes was to provide a MATLAB-like experience with a minimum of requirements: NumPy, SciPy, Matplotlib and Spyder, that's all.<br />
<br />
And here are two screenshots of the result (Spyder was executed in `light` mode: `spyder --light`):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_CbIcq5afIYV4NXNslixl0ftTEcVxXSGgs8gGSH_a9U6lo9Ypi0yM-J-6wA33-DOh5n4-ftRYeGQAzZdvergLW7rXtHv_ATB_1nj6usXS5I-h_3Y8xKKzZ6SrOQab4s8dXe0VYwrpr5se/s1600/sl_scientific.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_CbIcq5afIYV4NXNslixl0ftTEcVxXSGgs8gGSH_a9U6lo9Ypi0yM-J-6wA33-DOh5n4-ftRYeGQAzZdvergLW7rXtHv_ATB_1nj6usXS5I-h_3Y8xKKzZ6SrOQab4s8dXe0VYwrpr5se/s400/sl_scientific.png" width="351" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX1pd-oqsfshVGAVeiRWbQnSxHuVZqSd-t3I6otV7mXJxdQAFrZ-UmkWGl9qDS0EJlUwE3YoGiz1TYrkaFEAa_3MK7ZLfi-piPA48_hiHKabluPj9rHz6wSSZ9pFnEzyk3MoWJO-hG0Sk_/s1600/sl_scientific2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX1pd-oqsfshVGAVeiRWbQnSxHuVZqSd-t3I6otV7mXJxdQAFrZ-UmkWGl9qDS0EJlUwE3YoGiz1TYrkaFEAa_3MK7ZLfi-piPA48_hiHKabluPj9rHz6wSSZ9pFnEzyk3MoWJO-hG0Sk_/s400/sl_scientific2.png" width="390" /></a></div>
Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com4tag:blogger.com,1999:blog-8545564486086040404.post-85677484921947155612011-09-04T07:22:00.000-07:002011-09-11T01:29:38.338-07:00No IPython v0.11 support in Spyder's console, but standard Python interpreter enhancementsIt's been a month since IPython v0.11 public release and I've been trying to solve issues related to <a href="http://code.google.com/p/spyderlib/issues/detail?id=727">IPython support in Spyder's console</a>, all in vain. At first, I thought that it was only a problem on Windows platforms, but apparently <a href="http://code.google.com/p/spyderlib/issues/detail?id=743">it is not</a>. The more I think about it (and the more I spend time on it), the more I doubt that there will ever be a decent support of IPython >=v0.11 in Spyder's console. In the meantime, I have fixed a couple of bugs related to the new <a href="http://spyder-ide.blogspot.com/2011/08/preview-of-new-ipython-plugin-for.html">IPython plugin</a>: this new plugin will probably be the only way to run IPython >=v0.11 within Spyder.<br />
<br />
So, to compensate this lack of IPython support in Spyder's console, I have implemented the following enhancements for the standard Python interpreter (this is not much, but it provides all the IPython features I am using personnally):<br />
<br />
<ol>
<li>I have <a href="http://code.google.com/p/spyderlib/source/detail?r=187d52472ec8616ccce5713c09bcf9b73ea4f1fb">fixed the PyQt input hook issue on Windows platforms</a>. Before this revision, the console was crashing (non-responsive actually) on Windows platforms after trying to manipulate Qt objects interactively, like interactive plotting with Matplotlib for example. Now, when enabling the "Replace PyQt input hook by Spyder's" option (which is enabled by default on Windows platforms), the standard Python interpreter may be used to do interactive plotting, even on Windows.</li>
<li>Plus, I have implemented some basic special commands in the standard Python interpreter (see <a href="http://code.google.com/p/spyderlib/source/detail?r=07394d8b179087e8be2f6a629e096ed3c4c4c14e">here</a> more details), adding support for %pwd, %ls, %clear or !dir (or !ls on UNIX platforms), etc. (I haven't implemented the %edit, %run and other similar commands which have really no use within Spyder).</li>
<li>And I have fixed a bug with <a href="http://code.google.com/p/spyderlib/source/detail?r=2d7929020f3e7756dfc4456d5653fda66759c3c9">PYTHONSTARTUP substitution option</a> (the packages imported in the startup script were not available in the Python interpreter).</li>
</ol>
<br />
These three changesets were intended to facilitate the use of standard Python interpreter as an interactive computing shell. I've also created two PYTHONSTARTUP scripts (on my machine), one to support <a href="http://matplotlib.sourceforge.net/">Matplotlib</a>'s pylab interface and the other to support <a href="http://code.google.com/p/guiqwt/">guiqwt</a>'s interactive plotting mode:<br />
<br />
<ul>
<li><u>Matplotlib's startup script</u>:</li>
</ul>
<div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">print "Running pylab startup script...",</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Import modules following official guidelines:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import numpy as np</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import scipy as sp</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import matplotlib as mpl</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import matplotlib.pyplot as plt</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Pollute the namespace but also provide MATLAB-like experience:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">from pylab import *</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Enable Matplotlib's pylab mode:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ion()</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">print "done."</span></div>
</div>
<div>
<ul>
<li><u>guiqwt startup script</u>:</li>
</ul>
<div>
<div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">print "Running guiqwt startup script...",</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Import modules following official guidelines:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import numpy as np</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import scipy as sp</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import guiqwt.pyplot as plt</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">import guiqwt.io as io</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Pollute the namespace but also provide MATLAB-like experience:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">from numpy import *</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">from guiqwt.pyplot import *</span></div>
<div>
<span class="Apple-style-span" style="color: #999999; font-family: 'Courier New', Courier, monospace;"># Enable guiqwt's interactive mode:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ion()</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">print "done."</span></div>
</div>
</div>
</div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span></div>
With these startup scripts, I have my own IPython shell (not as powerful as IPython, of course) but it suits my needs... why not yours?<br />
<br />
To select you own startup script, go to Tools > Preferences > Console > Advanced settings:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1wwYRhKj2NMTWWYo93uCsgyuO5DPqem8qs1ZEPmj6nUehEN8grjZEtNsojF3xHNJvKH1i25ShH-LEgjvdrQEqHNagIGu3o2oMj22tq-3q3z0P0qRDzf6ImiWsrsKFLs_9d6kbt2YcyXv/s1600/a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1wwYRhKj2NMTWWYo93uCsgyuO5DPqem8qs1ZEPmj6nUehEN8grjZEtNsojF3xHNJvKH1i25ShH-LEgjvdrQEqHNagIGu3o2oMj22tq-3q3z0P0qRDzf6ImiWsrsKFLs_9d6kbt2YcyXv/s1600/a.png" /></a></div>
I think I'll add these startup scripts to Spyder v2.1 but I don't know how exactly. Maybe the simplest way would be to change the settings GUI above and add a third choice: "Build-in startup script: " with a combo box allowing to choose a script between the two scripts above (and others).Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com2tag:blogger.com,1999:blog-8545564486086040404.post-54648528056727907182011-08-13T08:42:00.000-07:002011-08-13T08:42:43.577-07:00Preview of the new IPython plugin for SpyderHere is a first preview of the <a href="http://code.google.com/p/spyderlib/source/detail?r=95f5eaa15e09b6382a5c53111089f6b39df2dab7">new IPython plugin</a> which will be available in Spyder v2.1 (to be released in September 2011, but the first beta will hopefully be available in a few days):<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeEDHDfjcSrdbJ8pDbBOBLA62prd0hLGQ1qCTAGiuUkfv3WNuFrr-kMd1Q3Z2gkkUFNv83yGUEc6esZL8qDyQdWzJpRkyXOkC4XJXlpjla_Ea92jMqOXjfJ1hxvZRtvBWQeyb3qTspvGU9/s1600/spyder_ipython012b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeEDHDfjcSrdbJ8pDbBOBLA62prd0hLGQ1qCTAGiuUkfv3WNuFrr-kMd1Q3Z2gkkUFNv83yGUEc6esZL8qDyQdWzJpRkyXOkC4XJXlpjla_Ea92jMqOXjfJ1hxvZRtvBWQeyb3qTspvGU9/s640/spyder_ipython012b.png" width="640" /></a></div><br />
<u>Important notes</u> :<br />
<br />
<ul><li>This feature is still experimental and will remain so until Spyder v2.2 (scheduled for December 2011).</li>
<li>It requires IPython v0.12dev (i.e. the current IPython development version, available through the github repository).</li>
</ul><br />
The idea is to start a new IPython kernel within the "Console" plugin (bottom left of the screenshot above), then a new IPython frontend dockwidget is created automatically (top left of the screenshot above). This first implementation already supports the Variable Explorer (top right of the screenshot above) through the IPython kernel associated to the frontend but nothing else is supported (link with the Editor, the Object Inspector, and so on).<br />
<br />
In the "Console" plugin preference page, the user may change the IPython kernel command line options (defaults are: "python --pylab=inline").Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com3tag:blogger.com,1999:blog-8545564486086040404.post-71515461096145537072011-08-09T07:07:00.000-07:002011-08-09T07:12:52.080-07:00IPython has taken a huge step forward!Two years of efforts were necessary for the IPython development team to achieve their goal and take a huge step forward with <a href="http://ipython.org/ipython-doc/rel-0.11/whatsnew/version0.11.html">IPython v0.11</a>, providing a powerful interactive shell with outstanding new features, a cleaner source code... and a brand new <a href="http://ipython.org/">great-looking website</a>! (at last... the old one was really minimalist)<br />
<br />
To my opinion, the most impressing new feature is the standalone Qt console (see the screenshot below): combined with the brand new "inline pylab mode", it allows plotting figures directly in the console itself, between lines of code (like in a notebook).<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://ipython.org/ipython-doc/rel-0.11/_static/qtconsole.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://ipython.org/ipython-doc/rel-0.11/_static/qtconsole.png" width="364" /></a></div><br />
But there are <a href="http://ipython.org/ipython-doc/rel-0.11/whatsnew/version0.11.html">other interesting new features</a> such as high-level interactive parallel computing features, an improved vim integration, an integration in Python Tools for Visual Studio and support for Python 3 (the last major scientific library which does not support Python 3 is now <a href="http://matplotlib.sourceforge.net/">matplotlib</a>... hurry up guys!).<br />
<br />
<i><b>New IPython v0.11 breaks Spyder's IPython support</b></i><br />
Unfortunately for Spyder users, this new version will break the IPython support within the "Console" plugin. We were not expecting this release until a few weeks from now, so we were not able to prepare Spyder for this.<br />
However, some preliminary changes were made to both v2.0 and v2.1 branches to make them compatible with IPython v0.11:<br />
<br />
<ul><li>For <u>v2.0.12 users</u>, simply copying and replacing the original files by the following should be sufficient to add support for IPython v0.11 (at least on Linux and MacOS X):</li>
<ul><li><a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/externalshell/monitor.py?repo=v20&r=94c3f2ae1734594553783c1fe9baabd2dadd26c5">monitor.py</a></li>
<li><a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/externalshell/startup.py?repo=v20&r=94c3f2ae1734594553783c1fe9baabd2dadd26c5">startup.py</a></li>
</ul><li>If you are using the development version (<u>v2.1.0</u>), you may simply update your local repository.</li>
</ul><b><i>Support for IPython v0.11 in Spyder's Console</i></b><br />
Anyway, the most disappointing thing about IPython v0.11 for Spyder users is that it's now using Python's PyOS_InputHook mechanism to support GUI event loops. This is, from a general point of view, a good thing because this is much cleaner than the old thread-based implementation. But, on Windows platforms, PyQt's input hook is implemented in such a way that, when enabled, it's blocking the standard output redirection pipe with the remote process (I don't know why), thus blocking the whole shell (that's why an option to disable the PyQt's input hook was added a long time ago to Spyder's console preferences and this option is enable by default on Windows platforms). In other words, when running IPython in pylab mode (i.e. with matplotlib's interactive mode turned on), matplotlib's figures will freeze. That's why there is a warning message in Spyder v2.1.0 when it's running with IPython v0.11 on Windows: "Spyder does not support GUI interactions with IPython >=v0.11 on Windows platforms (only IPython v0.10 is fully supported).".<br />
<br />
<b><i>The future of IPython support in Spyder</i></b><br />
Currently, in Spyder v2.0.12 and v2.1.0, IPython is supported simply by running an IPython shell in Spyder's console: a Python script running an IPython shell is executed in a separate process (QProcess). This was a very efficient way to support IPython, as there was a lot of code refactoring between the pure Python interpreter and the IPython interpreter (code completion, variable explorer, ...).<br />
Now that IPython v0.11 is using a two-process model like Spyder, they were able to implement a GUI-based console (the "standalone Qt console" mentioned above) which could be integrated directly into Spyder.<br />
What needs to be done:<br />
<br />
<ol><li>The first step to make it possible is to add support for PyQt's API #2 in Spyder: this is now done (see previous post)</li>
<li>Implement a specific "IPython plugin" that will encapsulate the IPython Qt console widget</li>
<li>Add options support to customize IPython</li>
<li>Add links with the Editor (run scripts, run selection, debug, breakpoints support, ...) and the Object inspector</li>
<li>Add support for the Variable explorer (after some tests, I think <u>this is a hard one</u> and will probably require a lot of interactions with the IPython development team)</li>
</ol>This is a lot of work but it's worth the effort.Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com1tag:blogger.com,1999:blog-8545564486086040404.post-66059770407474564992011-06-22T12:55:00.000-07:002011-07-05T09:59:22.413-07:00PyQt API #1, PyQt API #2 and PySide compatibilityOne year after its creation, the new Python library for Qt named <i>PySide</i> has reached version 1.0 for a while now. Even if Python developers are still hesitating to use intensively this new library despite its permissive license (LGPL), the fact is that <i>PySide</i> has brought a constructive competition in a field which was exclusively dominated by <i>PyQt</i>, the historical Python-Qt library which is still distributed under non-permissive licensing terms (GPL or commercial license). So, a lot of projects have already chosen to make the necessary changes to be able to migrate from <i>PyQt</i> to <i>PySide</i> when it's time, i.e. when <i>PySide</i> is mature enough (version 1.0 is still moving fast: very nasty bugs have been fixed between v1.0.0 and the latest v1.0.3 release). For example, in scientific Python ecosystem, IPython (with its <a href="http://ipython.scipy.org/doc/manual/html/development/ipython_qt.html">new Qt frontend</a> which will be integrated in a future Spyder version), <a href="http://matplotlib.sourceforge.net/">Matplotlib</a> and <a href="http://blog.enthought.com/enthought-tool-suite/experimental-pyside-support-in-ets/">Enthought Tool Suite</a> have made the choice to move forward.<br />
<div><br />
</div><div><i>PySide</i> is intended to be compatible with <i>PyQt</i>'s API #2 which was introduced with PyQt v4.6 (this is the default API for Python 3). So the first step to migrate from <i>PyQt</i> to <i>PySide</i> is to switch from API #1 to API #2, which means no more <i>QString, QStringList</i> or <i>QVariant</i> objects (replaced by Python objects):</div><div><a href="http://developer.qt.nokia.com/wiki/Differences_Between_PySide_and_PyQt">http://developer.qt.nokia.com/wiki/Differences_Between_PySide_and_PyQt</a></div><div><br />
</div><div>For Spyder, I chose to deal with this transition period with the following solution. The idea is to be able to test alternatively (and without changing too much code) the three cases (PyQt API #1, PyQt API #2 and PySide) by implementing a transitional package that your code will import instead of importing directly PyQt or PySide. See for example the Spyder's Qt transitional package :</div><div><a href="http://code.google.com/p/spyderlib/source/browse/#hg%2Fspyderlib%2Fqt">http://code.google.com/p/spyderlib/source/browse/#hg%2Fspyderlib%2Fqt</a></div><div>(in the rest of the code, all <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><b>import PyQt4.QtGui</b></span> statements are for example replaced by <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><b>import spyderlib.qt.QtGui</b></span>)</div><div><br />
</div><div>At first, I thought that the best solution was to migrate directly to PyQt API #2, hence breaking the compatibility with PyQt API #1 (it's hard to resist to the temptation of getting rid of <i>QString</i> and <i>QVariant</i> objects!). But then I realized that other projects using the Spyder's widgets (source code editor, array editor or dictionnary editor widgets) like <i><a href="http://guidata.googlecode.com/">guidata</a></i> would be forced to perform this migration at the same time: this was not acceptable and would lead to maintain two different versions of <i>Spyder</i>, one compatible with API #1 (Spyder v2.1) and the other with API #2 (Spyder v2.2). So I'm now convinced that the best solution is to change the code to make it compatible with both APIs and this is quite easy to do (it's now done in v2.1): <i>QString</i> objects can be used implicitely and <i>QVariant</i> objects and methods may be replaced by simple conversion functions (see 'from_qvariant' and 'to_qvariant' in <i>spyderlib</i>'s code):</div><div><a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/qt/compat.py">http://code.google.com/p/spyderlib/source/browse/spyderlib/qt/compat.py</a></div><div><br />
</div><div>Here is the example of the <i>NumPy</i> arrays editor widget which is compatible with PyQt API #1, API #2 and PySide:</div><div><a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/arrayeditor.py">http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/arrayeditor.py</a></div><div><br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Another difference between PyQt and PySide is the way the QFileDialog static methods are wrapped. In PyQt, <i>getOpenFileName</i> returns only the filename. With PySide, the same function returns a tuple containing the filename and the selected filter. So we have to deal with it and the best way is to write wrappers that ensure full compatibility with PyQt (API #1 and #2) and PySide. This is done here:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/qt/compat.py#77">http://code.google.com/p/spyderlib/source/browse/spyderlib/qt/compat.py#77</a></div><div><br />
</div></div><div>There are still a lot of bug to fix for Spyder to be fully compatible with PySide (only Spyder's light mode is running with PySide, with very minor bugs) but that's a great start!</div>Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com2tag:blogger.com,1999:blog-8545564486086040404.post-55056248214493111012011-06-15T13:23:00.000-07:002011-06-17T04:24:56.847-07:00Welcome to Spyder's blogThis is the <a href="http://spyder.googlecode.com/">Spyder</a>'s official blog.<br />
<br />
Of course this is the right place to keep you informed about the new features, the philosophy and the future directions of the project. But Spyder is more than a development environment: it's a realistic and very efficient replacement for MATLAB or IDL. In other words, Spyder is intimately related to the scientific Python ecosystem (the Python language and all the Python packages available out there): this is a global solution for your scientific development projects as well as for your data analysis/visualization work, the perfect companion for all your numerical computing needs. So from this perspective, this is also the right place for presenting our subjective thoughts on this scientific Python world.<br />
<br />
Note that there are a lot of interesting online resources on scientific Python but the best starting point would probably be the <a href="http://www.scipy.org/">SciPy</a> website: home page of the SciPy conference and the SciPy Python library (see the mailing lists, the blogs, the cookbook and the brand new "<a href="http://ask.scipy.org/">Ask SciPy</a>" Q&A forum).Pierrehttp://www.blogger.com/profile/07971720438741545943noreply@blogger.com0