Robert Kern | 1 May 01:09 2007
Picon

Re: ndimage crash on Rocks 4.0

Gennan Chen wrote:
> Hi! All,
> 
> scipy.ndimage gave me seg fault on Rocks 4.0, python 2.3.4. Anyone has a
> solution?

Can you rerun the tests with scipy.ndimage.test(verbosity=2)? That will put the
test framework into verbose mode and print out the name of the test before it's
run. That way, we can know which test failed.

A gdb backtrace would also be helpful if you know how to get one.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
Stefan van der Walt | 1 May 01:18 2007
Picon
Picon

Re: ndimage crash on Rocks 4.0

Hi Gen

On Mon, Apr 30, 2007 at 03:59:09PM -0700, Gennan Chen wrote:
> scipy.ndimage gave me seg fault on Rocks 4.0, python 2.3.4. Anyone has a
> solution?

Please add any debug information you can to

http://projects.scipy.org/scipy/scipy/ticket/404

I'm busy tracing this bug (which especially annoys me since I don't
see these errors on my machine).

The problem should only influence ndimage.generic_filter*.

Cheers
Stéfan
Stef Mientki | 1 May 01:36 2007
Picon

Python Reference Card

have you seen the Python Reference card:
  http://www.limsi.fr/Individu/pointal/python/pqrc/

this is really a must have for newbies and
most scipy users (because they probably will not use these general 
functions so often).

Oh, wouldn't it be nice to have reference cards for Scipy ;-)

cheers,
Stef Mientki
Gennan Chen | 1 May 02:45 2007
Picon

Re: ndimage crash on Rocks 4.0

Here is the debug info:

In [4]: scipy.ndimage.test(verbosity=2)
  Found 398 tests for scipy.ndimage
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage._nd_image' from '...ges/scipy/ndimage/_nd_image.so'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage._ni_support' from '.../scipy/ndimage/_ni_support.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.filters' from '...ages/scipy/ndimage/filters.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.fourier' from '...ages/scipy/ndimage/fourier.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.info' from '...ackages/scipy/ndimage/info.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.interpolation' from '...cipy/ndimage/interpolation.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.measurements' from '...scipy/ndimage/measurements.pyc'>
Warning: No test file found in /usr/lib/python2.3/site-packages/scipy/ndimage/tests for module <module 'scipy.ndimage.morphology' from '...s/scipy/ndimage/morphology.pyc'>
  Found 0 tests for __main__
affine_transform 1 ... ok
affine transform 2 ... ok
affine transform 3 ... ok
affine transform 4 ... ok
affine transform 5 ... ok
affine transform 6 ... ok
affine transform 7 ... ok
affine transform 8 ... ok
affine transform 9 ... ok
affine transform 10 ... ok
affine transform 11 ... ok
affine transform 12 ... ok
affine transform 13 ... ok
affine transform 14 ... ok
affine transform 15 ... ok
affine transform 16 ... ok
affine transform 17 ... ok
affine transform 18 ... ok
affine transform 19 ... ok
affine transform 20 ... ok
affine transform 21 ... ok
binary closing 1 ... ok
binary closing 2 ... ok
binary dilation 1 ... ok
binary dilation 2 ... ok
binary dilation 3 ... ok
binary dilation 4 ... ok
binary dilation 5 ... ok
binary dilation 6 ... ok
binary dilation 7 ... ok
binary dilation 8 ... ok
binary dilation 9 ... ok
binary dilation 10 ... ok
binary dilation 11 ... ok
binary dilation 12 ... ok
binary dilation 13 ... ok
binary dilation 14 ... ok
binary dilation 15 ... ok
binary dilation 16 ... ok
binary dilation 17 ... ok
binary dilation 18 ... ok
binary dilation 19 ... ok
binary dilation 20 ... ok
binary dilation 21 ... ok
binary dilation 22 ... ok
binary dilation 23 ... ok
binary dilation 24 ... ok
binary dilation 25 ... ok
binary dilation 26 ... ok
binary dilation 27 ... ok
binary dilation 28 ... ok
binary dilation 29 ... ok
binary dilation 30 ... ok
binary dilation 31 ... ok
binary dilation 32 ... ok
binary dilation 33 ... ok
binary dilation 34 ... ok
binary dilation 35 ... ok
binary erosion 1 ... ok
binary erosion 2 ... ok
binary erosion 3 ... ok
binary erosion 4 ... ok
binary erosion 5 ... ok
binary erosion 6 ... ok
binary erosion 7 ... ok
binary erosion 8 ... ok
binary erosion 9 ... ok
binary erosion 10 ... ok
binary erosion 11 ... ok
binary erosion 12 ... ok
binary erosion 13 ... ok
binary erosion 14 ... ok
binary erosion 15 ... ok
binary erosion 16 ... ok
binary erosion 17 ... ok
binary erosion 18 ... ok
binary erosion 19 ... ok
binary erosion 20 ... ok
binary erosion 21 ... ok
binary erosion 22 ... ok
binary erosion 23 ... ok
binary erosion 24 ... ok
binary erosion 25 ... ok
binary erosion 26 ... ok
binary erosion 27 ... ok
binary erosion 28 ... ok
binary erosion 29 ... ok
binary erosion 30 ... ok
binary erosion 31 ... ok
binary erosion 32 ... ok
binary erosion 33 ... ok
binary erosion 34 ... ok
binary erosion 35 ... ok
binary erosion 36 ... ok
binary fill holes 1 ... ok
binary fill holes 2 ... ok
binary fill holes 3 ... ok
binary opening 1 ... ok
binary opening 2 ... ok
binary propagation 1 ... ok
binary propagation 2 ... ok
black tophat 1 ... ok
black tophat 2 ... ok
boundary modes/usr/lib/python2.3/site-packages/scipy/ndimage/interpolation.py:41: UserWarning: Mode "reflect" may yield incorrect results on boundaries. Please use "mirror" instead.
  warnings.warn('Mode "reflect" may yield incorrect results on '
... ok
center of mass 1 ... ok
center of mass 2 ... ok
center of mass 3 ... ok
center of mass 4 ... ok
center of mass 5 ... ok
center of mass 6 ... ok
center of mass 7 ... ok
center of mass 8 ... ok
center of mass 9 ... ok
correlation 1 ... ok
correlation 2 ... ok
correlation 3 ... ok
correlation 4 ... ok
correlation 5 ... ok
correlation 6 ... ok
correlation 7 ... ok
correlation 8 ... ok
correlation 9 ... ok
correlation 10 ... ok
correlation 11 ... ok
correlation 12 ... ok
correlation 13 ... ok
correlation 14 ... ok
correlation 15 ... ok
correlation 16 ... ok
correlation 17 ... ok
correlation 18 ... ok
correlation 19 ... ok
correlation 20 ... ok
correlation 21 ... ok
correlation 22 ... ok
correlation 23 ... ok
correlation 24 ... ok
correlation 25 ... ok
brute force distance transform 1 ... ok
brute force distance transform 2 ... ok
brute force distance transform 3 ... ok
brute force distance transform 4 ... ok
brute force distance transform 5 ... ok
brute force distance transform 6 ... ok
chamfer type distance transform 1 ... ok
chamfer type distance transform 2 ... ok
chamfer type distance transform 3 ... ok
euclidean distance transform 1 ... ok
euclidean distance transform 2 ... ok
euclidean distance transform 3 ... ok
euclidean distance transform 4 ... ok
line extension 1 ... ok
line extension 2 ... ok
line extension 3 ... ok
line extension 4 ... ok
line extension 5 ... ok
line extension 6 ... ok
line extension 7 ... ok
line extension 8 ... ok
line extension 9 ... ok
line extension 10 ... ok
extrema 1 ... ok
extrema 2 ... ok
extrema 3 ... ok
extrema 4 ... ok
find_objects 1 ... ok
find_objects 2 ... ok
find_objects 3 ... ok
find_objects 4 ... ok
find_objects 5 ... ok
find_objects 6 ... ok
find_objects 7 ... ok
find_objects 8 ... ok
find_objects 9 ... ok
ellipsoid fourier filter for complex transforms 1 ... ok
ellipsoid fourier filter for real transforms 1 ... ok
gaussian fourier filter for complex transforms 1 ... ok
gaussian fourier filter for real transforms 1 ... ok
shift filter for complex transforms 1 ... ok
shift filter for real transforms 1 ... ok
uniform fourier filter for complex transforms 1 ... ok
uniform fourier filter for real transforms 1 ... ok
gaussian filter 1 ... ok
gaussian filter 2 ... ok
gaussian filter 3 ... ok
gaussian filter 4 ... ok
gaussian filter 5 ... ok
gaussian filter 6 ... ok
gaussian gradient magnitude filter 1 ... ok
gaussian gradient magnitude filter 2 ... ok
gaussian laplace filter 1 ... ok
gaussian laplace filter 2 ... ok
generation of a binary structure 1 ... ok
generation of a binary structure 2 ... ok
generation of a binary structure 3 ... ok
generation of a binary structure 4 ... ok
generic filter 1Segmentation fault

And Stefan is right. The problem is generic_filter. 

Gen

On Apr 30, 2007, at 4:09 PM, Robert Kern wrote:

Gennan Chen wrote:
Hi! All,

scipy.ndimage gave me seg fault on Rocks 4.0, python 2.3.4. Anyone has a
solution?

Can you rerun the tests with scipy.ndimage.test(verbosity=2)? That will put the
test framework into verbose mode and print out the name of the test before it's
run. That way, we can know which test failed.

A gdb backtrace would also be helpful if you know how to get one.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
_______________________________________________
SciPy-user mailing list


_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
Anne Archibald | 1 May 07:48 2007
Picon

Re: ode/programming question

On 30/04/07, Trevis Crane <t_crane <at> mrl.uiuc.edu> wrote:

> I have a system of linear equations.  Each equation has the exact same form:
>
> phi_dot = Ij - Ic*sin(phi)
>
> Each of the equations has a different value for Ij, Ic, and phi, and indeed
> their coupling is through these parameters.  Ij and Ic change dynamically
> with in time subject to various constraints, including the way in which
> they're coupled.  Whenever t changes, I have to recalculate several
> parameters that are then used to determine Ij and Ic, but when the next time
> step comes, I need to use the most recent values of Ij and Ic in order to
> calculate the next values.  Furthermore, this evolution needs to continue
> until the energy versus time of the system flattens out.  And the energy is
> determined based upon these continually updating parameters.  Does this make
> sense?  I have this simulation working in Matlab, but as I've mentioned I
> want to try using Python in the future, so I thought I'd start with
> something for which I already have a correct answer.

That description - Ij and Ic need to be calculated based on previous
values - is a bit vague. Is this a question of efficient computation,
or one of definition? Are the Ij and Ic actually evolving according to
a differential equation as well, perhaps?

> Now here's another question -- I'm trying to pass an extra argument to
> odeint like this
>
> y = odeint(y0,t,x)
>
> where x is the extra argument (a parameter I want to pass to the helper
> function).  But this returns an error that tells me extra arguments must be
> in a tuple.  I'm not sure what the appropriate syntax for this would be.
> Any help is appreciated...

If you want to make one item into a tuple, python uses the odd-looking
syntax (x,) (the brackets are often but not always necessary):

y = odeint(F,y0,ts,(x,))

You can avoid needing to use this by doing:

y = odeint(lambda y, t: F(y,t,x), y0, ts)

This also allows you to rearrange t y and x and supply keyword
arguments, if you like.

Anne
iCy-fLaME | 1 May 10:58 2007
Picon

Re: Installation SciPy on FC5

You should really upgrade to the latest FC release if possible, FC has
a rather short life cycle.

FC6 repo does contain a scipy, however, I always build my own latest release.

"yum install" the following:

python-devel
python-numarray

lapack
lapack-devel

atlas
atlas-devel

# depend on what extensions your machine support
# cat /proc/cpuinfo will give you some ideas.
atlas-3dnow
atlas-3dnow-devel

atlas-sse
atlas-sse-devel

atlas-sse2
atlas-sse2-devel

fftw
fftw-devel

fftw2
fftw2-devel

You will also need the standard development libs and tools, so you can
do "yum groupinstall" for the following:

"Development Libraries"
"Development Tools"

Yes, "yum remove" the following packages if you already have them installed:

numpy
scipy
python-numeric
gnuplot

They tend to be rather out-dated and doesnt make use of all your existing libs.

python-numeric is the old Numeric lib, should be replace by numpy in
new codes, use only if you have some old codes that needs it.

Terminal support in the standard gnuplot package is terrible, takes
more effort to fix it than rebuild it. If you are likely to use
gnuplot, compile your own.

Download the source code for numpy and scipy then compile them
yourself, should go pretty smoothly.

--

-- 
iCy-fLaME
------------------------------------------------
The body maybe wounded, but it is the mind that hurts.
Jesús Carrete Montaña | 1 May 14:58 2007

Question about scipy.stats

Hi to all,

   I get the following error when trying to evaluate the probability 
density function for a Poisson distribution:

from scipy import *

d2=stats.poisson(loc=1.,scale=2.)
x=arange(1,10,1)
d2.pdf(x)

---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most 
recent call last)

/home/kuantiko/latex/2006-2007/lFNyP/memoria/≤ipython console>

/usr/lib/python2.4/site-packages/scipy/stats/distributions.py in 
pdf(self, x)
    104         self.dist = dist
    105     def pdf(self,x):
--> 106         return self.dist.pdf(x,*self.args,**self.kwds)
    107     def cdf(self,x):
    108         return self.dist.cdf(x,*self.args,**self.kwds)

AttributeError: poisson_gen instance has no attribute 'pdf'

   Perhaps I'm using this module incorrectly, but I've noticed that te 
same code works with a gaussian distribution:

d1=stats.norm(loc=1.,scale=2.)
d1.pdf(x)
Out[12]:
array([ ... ])

   Is it a bug or am I missing something? I am using Scipy hversion 
0.5.2 on Debian Sid.

Thanks,

Jesús
Rob Clewley | 1 May 16:09 2007
Picon

Re: ode/programming question

On 01/05/07, Anne Archibald <peridot.faceted <at> gmail.com> wrote:
> On 30/04/07, Trevis Crane <t_crane <at> mrl.uiuc.edu> wrote:
>
> > I have a system of linear equations.  Each equation has the exact same form:
> >
> > phi_dot = Ij - Ic*sin(phi)
> >
> > Each of the equations has a different value for Ij, Ic, and phi, and indeed
> > their coupling is through these parameters.  Ij and Ic change dynamically
> > with in time subject to various constraints, including the way in which
> > they're coupled.  Whenever t changes, I have to recalculate several
> > parameters that are then used to determine Ij and Ic, but when the next time
> > step comes, I need to use the most recent values of Ij and Ic in order to
> > calculate the next values.  Furthermore, this evolution needs to continue
> > until the energy versus time of the system flattens out.  And the energy is
> > determined based upon these continually updating parameters.  Does this make
> > sense?  I have this simulation working in Matlab, but as I've mentioned I
> > want to try using Python in the future, so I thought I'd start with
> > something for which I already have a correct answer.
>
> That description - Ij and Ic need to be calculated based on previous
> values - is a bit vague. Is this a question of efficient computation,
> or one of definition? Are the Ij and Ic actually evolving according to
> a differential equation as well, perhaps?

It sounds like you might want to define auxiliary functions of your
variables and parameters that return the necessary values of lj and
lc. That is a much cleaner way to do what you're probably trying to
do. I expect you would have to pass in the names of these functions
explicitly as additional arguments (in the form Anne has described) in
order for your right-hand side function F to "see" the functions.

In order to stop a simulation when a certain condition has become true
you will need to use a more sophisticated integrator such as those
provided by PyDSTool or SloppyCell that allow user-defined events.
Also, those typically run significantly faster.

-Rob
Lorenzo Isella | 1 May 18:09 2007
Picon

Numerical Achievements in SciPy

Dear All,
I was wondering whether it makes sense or not to think about an online
centralized repository containing numerical software relying on SciPy.
For instance, I am using integrate.odeint to solve a large system of
nonlinear coupled equations. If I succeed in my project, this code
could be interesting for those studying Bose-Einstein condensation or
coagulation of aerosols, to mention only a few.
My purpose is not to advertise my work; viceversa I think that it
would have helped me a lot to know whether someone else had already
tried his hands at integrate.odeint on a large number of equations, to
have a benchmark and so on.
It should be clear by now that I am thinking about an online "box"
containing a number of Python codes with a description of what they
do/solve and possibly a benchmark.
I'd like to hear the opinions from those on this very collaborative
mailing list.
Apologies if such a thing already exists, but my online searches did
not find it.
Kind Regards

Lorenzo
lorenzo bolla | 1 May 18:22 2007
Picon

Re: Numerical Achievements in SciPy

I'd very happy to share my codes about electromagnetic problems.
I was thinking about sharing them on empython.org, but that website doesn't seem to be very actively supported at the moment.
lorenzo.

On 5/1/07, Lorenzo Isella <lorenzo.isella <at> gmail.com> wrote:
Dear All,
I was wondering whether it makes sense or not to think about an online
centralized repository containing numerical software relying on SciPy.
For instance, I am using integrate.odeint to solve a large system of
nonlinear coupled equations. If I succeed in my project, this code
could be interesting for those studying Bose-Einstein condensation or
coagulation of aerosols, to mention only a few.
My purpose is not to advertise my work; viceversa I think that it
would have helped me a lot to know whether someone else had already
tried his hands at integrate.odeint on a large number of equations, to
have a benchmark and so on.
It should be clear by now that I am thinking about an online "box"
containing a number of Python codes with a description of what they
do/solve and possibly a benchmark.
I'd like to hear the opinions from those on this very collaborative
mailing list.
Apologies if such a thing already exists, but my online searches did
not find it.
Kind Regards

Lorenzo
_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user

_______________________________________________
SciPy-user mailing list
SciPy-user <at> scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user

Gmane