Lorenzo Isella | 18 Aug 16:58

SciPy, MPI and OpenMP

Dear All,
I have recently attended a crash course on MPI and OpenMP. The
examples always involved C or Fortran code.
Now, I have a thought: if working on a single processor, I hardly need
to use pure C or pure Fortran. I usually write a Fortran code for the
bottlenecks and compile it with f2py to create a python module I then
import.
Hence two questions:
(1) Can I do something similar with many processors? E.g.: write a
Python code, embed some compiled Fortran code which is supposed to run
on many processors, get the results and come back to Python.

Python--->Fortran on many processors--->back to Python.
(2)Is it also possible to directly parallelize a Python code? I heard
about thread locking in Python.

I did some online research, there seems to be a lot of projects trying
to combine Python and MPI/OpenMP, but many look rather "experimental".
In particular, of course, I would like to hear about SciPy and
parallel computing.
Many thanks

Lorenzo
Ryan Krauss | 18 Aug 16:24

from scipy import *, from scipy import signal

I upgraded to svn this morning and am having a rough time.  I think I eventually got everything to compile, but I am having problems running the script I am working with.  I have two primary problems (I think).

1. I have a lot of legacy code of mine that starts with "from scipy import *".  But with the current svn versions, this doens't seem to do what it used to (it doesn't seem to bring in signal and integrate at least).

2. Secondly, adding "from scipy import signal" to fix problem #1, produces this message:

In [2]: from scipy import signal
---------------------------------------------------------------------------
<type 'exceptions.RuntimeError'>          Traceback (most recent call last)


<type 'exceptions.RuntimeError'>: module compiled against version 1000009 of C-API but this version of numpy is 100000a
_um=None



What is the easiest way to resolve these two issues?

Thanks,

Ryan
_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
Pierre Raybaut | 17 Aug 21:54

[ Python(x,y) ] New release : 2.0.2

Hi all,

As you may already know, Python(x,y) is a free scientific-oriented
Python Distribution based on Qt and Eclipse providing a self-consistent
scientific development environment.

Release 2.0.2 is now available on http://www.pythonxy.com.
(Full release, and update patch for 2.0.0 only because of disk space 
quota - If you have already installed the 2.0.1 release, please take a 
look at http://code.google.com/p/pythonxy for an update in a three parts 
archive which will be soon available)
Note: GDCM will be included but only in the next release

Changes history
08 -17 -2008 - Version 2.0.2 :

     * Updated:
           o Enthought Tool Suite 3.0.0
           o ITK 3.8

Regards,
Pierre Raybaut
Pierre Raybaut | 16 Aug 09:29

Re: [ Python(x,y) ] New release : 2.0.1

>
> Message: 2
> Date: Thu, 14 Aug 2008 13:59:34 -0400
> From: "william ratcliff" <william.ratcliff <at> gmail.com>
> Subject: Re: [SciPy-user] [ Python(x,y) ] New release : 2.0.1
> To: "SciPy Users List" <scipy-user <at> scipy.org>
> Message-ID:
> 	<827183970808141059u1069a322xe4af0b421a24c7f6 <at> mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thanks for all of your work on this!  A quick question about your VTK
> distribution--there is an option to compile VTK to use GL2PS to allow the
> export of scene's to eps, ps, pdf, etc. see:
> http://davis.lbl.gov/Manuals/VTK-4.5/classvtkGL2PSExporter.html
>
> Is your version compiled with this option.  I believe it is not the default
> due to licensing issues.
>
>
> Thanks,
> William
Hi William,

Actually yes, the VTK version included in Python(x,y) was compiled with 
this option.
Thank for your message.

Regards,
Pierre
Sebastian Haase | 15 Aug 22:41

bezier splines from given control points (2D)

Hi,
I am looking for a way to calculate x,y-coordinates for a polygon
interpolating a cubic or (better) a quadratic bezier spline.
The bezier spline would be defined by known x,y coordinates of n control points.
I found spline references both in scipy.interpolate and in scipy.signal.

Which of the spline "stuff" in scipy in best suited for me ?

Thanks for any help,
Sebastian Haase
Andrew Collette | 15 Aug 00:56

ANN: HDF5 for Python (h5py) 0.3.0

=======================================
Announcing HDF5 for Python (h5py) 0.3.0
=======================================

HDF5 for Python (h5py) is a general-purpose Python interface to the
Hierarchical Data Format library, version 5.  HDF5 is a versatile,
mature scientific software library designed for the fast, flexible
storage of enormous amounts of data.  The h5py project has been under
informal development for a few months now, and has reached the point
where it might be generally useful to others.

Unlike the fantastic PyTables project, h5py aims to provide access to
the full HDF5 C library, although in a more Pythonic fashion. Almost
all of the HDF5 1.6.X API is covered, with improvements like:

    - object-oriented identifiers with reference counting
    - automatic raising of Python exceptions for HDF5 errors
    - conversion between NumPy and HDF5 datatypes

It also includes a set of high-level, pure-Python classes which
represent basic HDF5 abstractions like files, groups, and datasets,
using native Python and NumPy infrastructure.  For example, datasets
carry a shape tuple and dtype, and support partial I/O via the
standard extended slicing syntax.

The primary focus of the project is read/write interoperability with
existing HDF5 data; using Python and the NumPy package, you can
access data in HDF5 format, process it, and write files that any
HDF5-aware program can understand.

Automatic conversion is provided between NumPy and HDF5 datatypes;
almost all NumPy types can be transparently converted to their HDF5
equivalents.  This includes constructs like complex numbers in
addition to arbitrarily nested compound ("recarray") data types.

Resources
=========

Python 2.5 and Numpy >= 1.0.3 are required.  For UNIX, a C compiler
is also required which can build Python extensions.  HDF5 versions
1.6.5, 1.6.7, 1.8.0 and 1.8.1 are supported.  The Windows installer
includes HDF5 1.8.1.

Source installers for UNIX and an integrated installer for Windows
are available from the Google Code development page:
http://h5py.googlecode.com

Comprehensive documentation, including installation instructions and
a quick-start guide, is available at:
http://h5py.alfven.org

You can read more about the HDF5 library at the HDF Group web site:
http://www.hdfgroup.com/HDF5

*** This project is NOT affiliated with the HDF Group. ***

All code for this project is released under the BSD license.

Thanks
======

Thanks to D. Dale, D. Brooks, E. Lawrence for their comments and
suggestions in development, and the PyTables project for general
inspiration, along with "definitions.pxd". :)

----
    Andrew Collette
    http://www.alfven.org
    Mail: "h5py" at the domain "alfven.org"
Zane Selvans | 14 Aug 21:39

Finding local minima of greater than a given depth

Is there a function within scipy somewhere which will, given an array  
representing values of a function, find all the local minima having a  
depth greater than some specified minimum?  The following works great  
for smooth functions, but when the data has noise in it, it also  
returns all of the (very) local minima, which I don't want.  The  
functions I'm working with are periodic (hence the modulo in the  
indices for endpoint cases).  Or, if there isn't such a built in  
functionality, what's the right way to measure the depth of a local  
minimum?

def local_minima(fitlist):
     minima = []

     for i in range(len(fitlist)):
         if fitlist[i] < fitlist[mod(i+1,len(fitlist))] and fitlist[i]  
< fitlist[mod(i-1,len(fitlist))]:
             minima.append(fitlist[i])

     minima.sort()

     good_indices = [ fitlist.index(fit) for fit in minima ]
     good_fits = [ fit for fit in minima ]

     return(good_indices, good_fits)

--
Zane Selvans
Amateur Earthling
http://zaneselvans.org
zane <at> ideotrope.org
303/815-6866
PGP Key: 55E0815F
Pierre Raybaut | 14 Aug 19:18

[ Python(x,y) ] New release : 2.0.1

Hi all,

As you may already know, Python(x,y) is a free scientific-oriented
Python Distribution based on Qt and Eclipse providing a self-consistent 
scientific development environment.

Release 2.0.1 is now available on http://www.pythonxy.com.
(Full release, and update patch)
Note: ITK will be updated in the next release (3.6 -> 3.8) and GDCM
will be included.

Changes history
08-14-2008 - Version 2.0.1 :

** Added **
o Python(x,y) is now available in two versions (due to disk quota limits 
- and to the unusual size of the 2.0.1 update, the Basic Edition will 
not be available online, at least in the next few weeks): Full Edition 
(all Python
packages are installed, some are optional like ETS or ITK) and Basic
Edition (with essential Python libraries only: PyQt4, NumPy, SciPy,
IPython and matplotlib)
o SWIG 1.3.36 - SWIG is a compiler that integrates C and C++ with
several languages including Python
o Pyrex 0.9.8.4 - Pyrex is a language for writing Python extension
modules (Note: Cython - which is based on Pyrex - is already included in
the distribution)
o xy 1.0.2 - xy is a module that gathers all Python(x,y) tools

** Updated **
o Enthought Tool Suite 2.8.0
o NumPy 1.1.1
o matplotlib 0.98.3
o Pywin32 2.12
o pp (Parallel Python) 1.5.5
o SymPy 0.6.1
o PyTables 2.0.4
o Eclipse 3.4.0 (CDT 5.0)
o PyDev 1.3.19 (Eclipse plugin)
o Qt Eclipse Integration 1.4.1
o Photran 4.0b4 (Eclipse plugin)
o Wicked Shell 2.0.4 (Eclipse plugin)
o StartExplorer 0.0.4 (Eclipse plugin)
o Notepad++ 5.0.3 (and added Python script execution shortcut: Shift+F1)
o Console 2 installer: checking if an old configuration file exists (and
deleting it) before installation
o Console 2 configuration: window transparency has been disabled because
of display bugs with TVTK
o IPython(x,y) profile: added customizable startup script

** Corrected **
o IPython : IPython(x,y) profile startup script can now be customized
o PyQt4: installation folder is added to PATH, allowing to use directly
pyrcc4.exe, pylupdate.exe, ...
o Missing documentation in the following packages: Cython, GDAL, DAP,
MDP, PyXML, MinGW
o Minor bug in package uninstallers: dialog box with an error message
but without any consequence
o ITK module installer: Visual C++ 2008 libraries installer
"vcredist.exe" has a known bug which will be fixed in release 2008 SP1 -
some temporary files are erroneously copied to the system root -
meanwhile, these files are now deleted at the end of the installation
process

Regards,
Pierre Raybaut
Rohit Garg | 14 Aug 11:04

need lapack/atlas/fftw

Hi all,

I have installed scipy,numpy,lapack,atlas and fftw from the standard
fedora repositories. Does anybody here know with options were they
configured? I mean, when I am going to use the linalg module, am I
using the lapack which uses ATLAS beneath it? I read in the list
archives that scipy depends upon lapack and blas. Can I just set an
environment variable somewhere to make it use ATLAS and FFTW?
(probably not, but gotta ask). In case the answer is no, I guess the
only way to do it is compile every thing by hand :(

I am using fedora 9, 64 bit on dual core AMD machine. My machine supports sse2

Off topic - I understand that numpy does not make use of SSE and
multithreading. If that is the case, I propose using the framewave
library for implementing both of them. Their goal is not to bias it
towards any particular company's chips and license is apache, so that
should be no problem. I ask it here because numpy page has no links
for dev lists and because I am eager to write code to achieve this.

Cheers,

--

-- 
Rohit Garg
Junior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay
Benjamin Eberlei | 14 Aug 00:06

fmin_bfgs - Loglik Estimation leads to strange error


Hello everybody,

i am quite new to numpy/scipy and currently porting some algorithms i wrote
for Ox to python and run into a very strange error inside the bfgs
optimization algorithm I cannot track down. I want to estimate Log
Liklihood functions from different distributions. I prepared a small
snippet:

class fLoglik(object):
    def __init__(self, y):
        self._y = asmatrix(y).T
        pass

    def __call__(self, params):
        print params
        y = self._y
        a = _exp(-(params[0] * y))
        return asmatrix(a)

f = fLoglik( _log(data[:,16]) )

params = array(ones((1,1)))
max = fmin_bfgs(f, params)

data is a matrix so the input comes in correct. The fLoglik.__call__ is
called twice before a ValueError occurs exactly as in the following
backtrace:

[ 1.]
[ 1.00000001]

Traceback (most recent call last):
  File "/var/www/workspace/pydiplom/src/diploma/weibull.py", line 42, in
<module>
    max = fmin_bfgs(f, params)
  File "/usr/lib/python2.5/site-packages/scipy/optimize/optimize.py", line
723, in fmin_bfgs
    gfk = myfprime(x0)
  File "/usr/lib/python2.5/site-packages/scipy/optimize/optimize.py", line
95, in function_wrapper
    return function(x, *args)
  File "/usr/lib/python2.5/site-packages/scipy/optimize/optimize.py", line
617, in approx_fprime
    grad[k] = (f(*((xk+ei,)+args)) - f0)/epsilon
ValueError: setting an array element with a sequence.

What is weird to me, the first two function calls to fLoglik are correct,
that is the output [1] and [ 1.00000001] you see comes from the call func.

Does somebody maybe know thats going on?
Eric Bruning | 13 Aug 17:30

SOM in scipy.cluster

Greetings,

I'm considering using self-organizing maps for mining some lightning  
data, and info.py in scipy.cluster mentions that implementation of  
self-organizing maps is under development. I've found a few examples  
written in python around the web, but none that are likely to be  
efficient enough for my use.

Is there still interest in including SOM in scipy? I'd be happy to  
coordinate on a contribution if nothing else is under way.

Thanks,
Eric

Gmane