Once I learned about Python, I stopped trying out different languages

It’s
hard to believe that Pearu Peterson doesn’t have any computer
background. He has a Masters degree in Natural Sciences and a PhD in studying interactions of water waves. But he is also the author of  F2PY (Fortran to Python Interface generator)  and has contributed to various Python based scientific computing tools
like, SciPy, GiNaC and GMPY. He is also involved in the Python numpy.distutils package.

In this interview he not only tells us why Python is his preferred langauge but also talks about Python’s evolution and developments on his various open source projects like SciPy.

PythonThreads >>  Hello Pearu, We are glad to have you on PythonThreads. Could you introduce yourself?
Pearu Peterson >>
Thank you for inviting! It took some time to get back to you due to my marriage in August 2006 and I appreciate your patience with me.

My academic work is about modeling extreme waves (also known as freak or rogue waves) to better understand such waves and apply this knowledge for deterministic generation of waves in hydrodynamic laboratories. I defended my PhD in Tallinn, 2001. My PhD work was about using soliton theory in describing interactions of water waves. Currently I work as Senior Researcher in the Centre of Nonlinear Studies in the Institute of Cybernetics at TTU. I also do Python software consulting in self-employed business.

In free time I do boat racing [http://www.veemoto.ee] and help organising international motorboating events including several World and European
Championships that were held in Estonia. During the summer I am usually occupied in teaching kids sailing in a summer camp [http://merelaager.ee]. Finally, I have a German Shepherd dog who I train for obedience competitions. This year we won the Estonian Champion title in dog obedience:)

PythonThreads >>  What inspired you to develop F2PY (Fortran to Python interface generator) ?
Pearu Peterson >>
It was 1999 when I needed to use few Fortran subroutines from Python and I wrote wrappers to this programs by hand. Soon I realized that I could write a Python script to do all the tedious work of handling Fortran subroutine arguments (there was more than 20 of them in this particular case). So, from this simple script borne a long-term project now called as F2PY. More about the history of F2PY can be read in http://pearu.blogspot.com/2006/07/f2py-history-and-future.html

“Python can easily handle the tedious work of handling Fortran subroutine arguments…”

PythonThreads >>  How do you see F2PY in the short and long term? Any new developments you wish to share?
Pearu Peterson >>
Yes, f2py will have important changes ahead, especially for Fortran 90 users. The current f2py lacks support for Fortran 90 derived types and pointers making its uses for wrapping Fortran 90 codes limited. In May I started working on F2PY G3 – the 3rd generation of F2PY – that will support these Fortran constructs. In addition, the F2PY G3 will have many interesting applications rather than just being Fortran to Python interface generator. It could be used to implement the F2C tool in pure Python as well as Fortran to Perl or Tcl etc interface generators.

“F2PY G3 will have many interesting applications rather than just being Fortran to Python interface generator…”

PythonThreads >>  In 2001, you along with Travis Oliphant and Eric Jones merged your modules in one scientific package called SciPy. Could you tell us about it ?
Pearu Peterson >>
I met Travis via Internet when I started to work on f2py.py script (that is historically the first implementation of F2PY). Travis might be the first F2PY user beside me and his main contribution was the callback support (calling Python functions from Fortran) in F2PY. We also worked together on a Multipack package that aimed at collecting Python wrappers to various Fortran or C libraries. Multipack sources are still available in http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/multipack/ that is kept available only for historical use.

Around 2001 Eric Jones contacted Travis and me to join the efforts of collecting various tools for scientific computing within Python. The tools from Multipack and Eric’s collections were copied to just borne SciPy project. More about SciPy history and its relation with Numeric, Numarray, and NumPy packages can be found in http://scipy.org/History_of_SciPy

“The tools from Multipack and Eric’s collections were copied to just borne SciPy project….”

PythonThreads >>  SciPy is similar to MATLAB. What strengths or advantages does SciPy have over MATLAB ?
Pearu Peterson >> SciPy provides scientific computing tools for Python. Python language itself has many advantages over MATLAB language in that it is a more modern and complete programming language. This makes Python with tools in SciPy a perfect environment for prototyping that scientific research is all about.

“Python language itself has many advantages over MATLAB….”

PythonThreads >>  How widely is SciPy used? Are there particular segments that are a good match for SciPy?
Pearu Peterson >> SciPy users list has currently more than 700 subscribers. SciPy developers list has more than 250 subscribers. These figures speak for itself. There is increasing interest to SciPy as the new NumPy – the replacement of Numeric and Numarray packages – is approaching its first 1.0 release soon.

“NumPy will replace Numeric and Numarray packages ….”

PythonThreads >>  Could you tell our readers more about your other projects like polyhedron, pyvtk, pyginac ?
Pearu Peterson >>
Well, I needed these projects for my PhD work but they can be useful in general. In short, polyhedron contains Python wrappers for the cddlib [http://www.ifor.math.ethz.ch/~fukuda/cdd_home/cdd.html] that I used for computing interaction patterns of solitons (my online PhD thesis contain more details).

pyvtk is a small pure Python package that makes creating VTK input files more convenient from Python object Pyginac is an attempt to wrap the GiNaC library [http://www.ginac.de/] to Python. I was using Boost.Python but compilation time and memory consumption were increasing to high that I decided that using Boost.Python was inappropriate for the given task. The current SWIG is much more efficient in wrapping C++ libraries. However, I have not given up in working out a model for doing symbolic algebraic manipulations in Python, several my projects would need it.

“SWIG is much more efficient in wrapping C++ libraries ….”

PythonThreads >>  For almost all the Development and Research Projects you have used Python as a developing tool, Why did you choose Python ?
Pearu Peterson >> I discovered Python around 1998 when I was looking for a free programming language to do scientific computing. Before knowing about Python I had used mainly Matlab for my MSc thesis computations, I had used C, Fortran, Pascal, Lisp and many other languages for various projects but once I learned about Python, I stopped trying out different languages and stuck to Python for almost anything that needed some programming.

“once I learned about Python, I stopped trying out different languages and stuck to Python ….”

PythonThreads >>  What developments are you keenly following in Python or even other languages?
Pearu Peterson >>
Since I am mostly responsible for the current numpy.distutils package, I am following the development of Python distutils as well as the language itself. I am also interested in the development of plotting tools for Python such as VTK, Matplotlib, Mayavi2 and many others.

“I am interested in the development of plotting tools for Python ….”

PythonThreads >>  Have you noticed any Python software development trends over the years, maybe at the SciPy conference? What do you expect to see at this year’s conference?
Pearu Peterson >> Unfortunately I have never got a change to attend at SciPy conferences though I am following it with great interest through SciPy web site. In Python development I really like that the Python is getting faster.

“Python is getting faster….”

PythonThreads >>  Thanks Pearu. It’s been good talking to you. Could you share your blog url or email address with our readers?
Pearu Peterson >>
Sure. My email is [email protected] and I have blogs at http://pearu.blogspot.com .

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!

Leave a Reply