Re: [Numpy-discussion] Path to numpy installation

2010-11-03 Thread Juanjo Gomez Navarro
Ups, sorry, but I deleted everything just after sending the email xD. I
deleted everything related to Python in the Macbook and reinstalled again
from scratch (python 2.5, numpy, ipython and matplotlib). In this way I
managed to make it work properly, and, at least for the moment, it seems
that I have not broken anything... I guess the problem will come when I less
expect.

Anyway, thanks for the help. For the time being everything works as it
should.



2010/11/2 Robert Kern 

> On Tue, Nov 2, 2010 at 03:31, Juanjo Gomez Navarro
>  wrote:
> >  Ok, so in your opinion I have two independent python installations?
> That's
> > possible...
>
> It's certain.
>
> > The problem is that I want to use ipython, and this interpreter
> > seems to take the wrong version by default...
>
> That just means that you used the system Python to install ipython.
> Put the /Library/Frameworks/.../bin at the front of your $PATH like I
> explained before and reinstall IPython and numpy and all of the other
> packages you want to use using that python executable. Double-check by
> executing
>
> $ which python
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>
> > Do you think it is safe just to delete the folder
> > /System/Library/Frameworks/Python.framework to «uninstall» the wrong
> > version?
>
> No! Do not touch that! It is used by OS X.
>
> --
> 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
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Juan José Gómez Navarro

Departamento de Física
Centro de Investigacion en Óptica y Nanofísica (CIOyN)
Universidad de Murcia
Campus Espinardo
E-30100 Murcia
España

Tel : +34 968 398552
Fax : +34 968 39 8568
Email: juanjo.gomeznava...@gmail.com, jjgomeznava...@um.es
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Path to numpy installation

2010-11-02 Thread Juanjo Gomez Navarro
 Ok, so in your opinion I have two independent python installations? That's
possible... The problem is that I want to use ipython, and this interpreter
seems to take the wrong version by default...

Do you think it is safe just to delete the folder
/System/Library/Frameworks/Python.framework to «uninstall» the wrong
version?



2010/11/1 Robert Kern 

> On Mon, Nov 1, 2010 at 12:35, Juanjo Gomez Navarro
>  wrote:
> > Hi, I have just updated my old version of numpy 1.01 to the version 1.5
> in
> > my Mac. The problem is that the system does not seem to recognize the new
> > version.
> > When I type print numpy.__path__ I get
> >
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy
> > But the new version I have just installed is in
> >
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy
> > I don't know
> >
> how to change the path of the installation, or how to say python to search 
> numpy in the new path
> > Any idea???
>
> When you run "python", apparently you are picking up the system's
> Python executable in /System/Library, not the other Python interpreter
> that you installed under /Library. You need to adjust your $PATH
> environment variable to put
> /Library/Frameworks/Python.framework/Versions/Current/bin before
> /usr/bin. Then when you type "python", you will get this installation
> of Python and all of its libraries.
>
> --
> 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
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Juan José Gómez Navarro

Departamento de Física
Centro de Investigacion en Óptica y Nanofísica (CIOyN)
Universidad de Murcia
Campus Espinardo
E-30100 Murcia
España

Tel : +34 968 398552
Fax : +34 968 39 8568
Email: juanjo.gomeznava...@gmail.com, jjgomeznava...@um.es
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Path to numpy installation

2010-11-01 Thread Juanjo Gomez Navarro
Hi, I have just updated my old version of numpy 1.01 to the version 1.5 *in
my Mac*. The problem is that the system does not seem to recognize the new
version.

When I type print numpy.__path__ I get

/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy

But the new version I have just installed is in

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy

I don't know
how to change the path of the installation, or how to say python to
search numpy in the new path

Any idea???



2010/10/18 Ralf Gommers 

> On Mon, Oct 18, 2010 at 9:55 PM, Vincent Davis 
> wrote:
> > On Sun, Oct 17, 2010 at 5:35 AM, Ralf Gommers
> >  wrote:
> >> Hi,
> >>
> >> I am pleased to announce the availability of the first release
> >> candidate of NumPy 1.5.1. This is a bug-fix release with no new
> >> features compared to 1.5.0.
> >>
> >> Binaries, sources and release notes can be found at
> >> https://sourceforge.net/projects/numpy/files/.
> >> A note on the available binaries for OS X: these are known to not work
> >> on Intel-based OS X 10.5. We hope to have that problem fixed within a
> >> week.
> >>
> >> On Windows there are still two known test failures:
> >> - #1610, in fromfile (under Python 2.x)
> >> - #1633, a failing test for ldexp (under Python 2.5 only)
> >> Please report any other issues on the Numpy-discussion mailing list.
> >
> > Test pass for me.
> > osx 10.6 py27
> >
> > OK (KNOWNFAIL=4, SKIP=2)
> > 
> >
> Glad it works for you. But I just reopened the OS X gfortran issue,
> http://projects.scipy.org/numpy/ticket/1399.
>
> RC2 in one week. Two other issues to be fixed by then:
> http://projects.scipy.org/numpy/ticket/1610 (Pauli has suggested a fix
> already)
> http://projects.scipy.org/numpy/ticket/1633
>
> Cheers,
> Ralf
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Juan José Gómez Navarro

Departamento de Física
Centro de Investigacion en Óptica y Nanofísica (CIOyN)
Universidad de Murcia
Campus Espinardo
E-30100 Murcia
España

Tel : +34 968 398552
Fax : +34 968 39 8568
Email: juanjo.gomeznava...@gmail.com, jjgomeznava...@um.es
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy-discussion Digest, Vol 33, Issue 59

2009-06-10 Thread Juanjo Gomez Navarro
Thanks a lot, now I have a quite fast program to compute Fractals :D.
Nevertheless, I want to comment some more doubts.

The speed at which some points tend to infinite is huge. Some points, after
10 steps, reach a NaN. This is not problem in my Mac Book, but in the PC the
speed is really poor when some infinities are reached (in the mac, the
program takes 3 seconds to run, meanwhile in the PC it takes more than 1
minute). In order to solve this, I have added a line to set to 0 the points
who have reached 2.0 (so they are already out of the Mandelbrot set):
*
for n in range(1,ITERATIONS):
  print "Iteration %d" % n
  z *= z
  z += c
  fractal[(fractal == 1) & (abs(z) > 2.0)] = float(n) / ITERATIONS

# This is the new line to avoid series in some points to reach infinite,
which causes problems in my PC
  z[abs(z) > 2.0] = 0
*
This solves the problem for PC, but delays the calculation...

On the other hand, the number of calculations that *really need* to be done
(of points who have not yet been excluded from the Mandelbrot set) decreases
rapidly. In the beginning, there are, in a given example, 25 points, but
in the final steps there are only 6. Nevertheless, I'm calculating *
needlessly* the 25 points all the time, when only 10% of calculations
should need to be done! It is a waste of time.

Is there any way to save time in these useless calculations? The idea should
be to perform the update of z only if certain conditions are met, in this
case that abs(z)<2.

Thanks.

2009/6/9 


> ttp://mentat.za.net/numpy/intro/intro.html
>
> We never used it, but I still like the pretty pictures :-)
>
> Cheers
> St?fan
>

-- 
Juan José Gómez Navarro

Edificio CIOyN, Campus de Espinardo, 30100
Departamento de Física
Universidad de Murcia
Tfno. (+34) 968 398552

Email: juanjo.gomeznava...@gmail.com
Web: http://ciclon.inf.um.es/Inicio.html
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] How to remove fortran-like loops with numpy?

2009-06-08 Thread Juanjo Gomez Navarro
Hi all,

I'm new in numpy. Actually, I'm new in Python. In order to learn a bit, I
want to create a program to plot the Mandelbrot set. This program is quite
simple, and I have already programmed it. The problem is that I come from
fortran, so I use to think in "for" loops. I know that it is not the best
way to use Python and in fact the performance of the program is more than
poor.

Here is the program:

*#!/usr/bin/python*
>
> *import numpy as np*
> *import matplotlib.pyplot as plt*
>
> *# Some parameters*
> *Xmin=-1.5*
> *Xmax=0.5*
> *Ymin=-1*
> *Ymax=1*
>
> *Ds = 0.01*
>
> *# Initialization of varibles*
> *X = np.arange(Xmin,Xmax,Ds)*
> *Y = np.arange(Ymax,Ymin,-Ds)*
>
> *N = np.zeros((X.shape[0],Y.shape[0]),'f')*
>
> *## Here are inefficient the calculations *
> *for i in range(X.shape[0]):*
> *  for j in range(Y.shape[0]):*
> *z= complex(0.0, 0.0)*
> *c = complex(X[i], Y[j])*
> *while N[i, j] < 30 and abs(z) < 2:*
> *  N[i, j] += 1*
> *  z = z**2 + c*
> *if N[i, j] == 29:*
> *  N[i, j]=0*
> 
>
> *# And now, just for ploting...*
> *N = N.transpose()*
> *fig = plt.figure()*
> *plt.imshow(N,cmap=plt.cm.Blues)*
> *plt.title('Mandelbrot set')*
> *plt.xticks([]); plt.yticks([])*
> *plt.show()*
> *fig.savefig('test.png')*
>


As you can see, it is very simple, but it takes several seconds running just
to create a 200x200 plot. Fortran takes same time to create a 2000x2000
plot, around 100 times faster... So the question is, do you know how to
programme this in a Python-like fashion in order to improve seriously the
performance?

Thanks in advance

-- 
Juan José Gómez Navarro

Edificio CIOyN, Campus de Espinardo, 30100
Departamento de Física
Universidad de Murcia
Tfno. (+34) 968 398552

Email: juanjo.gomeznava...@gmail.com
Web: http://ciclon.inf.um.es/Inicio.html
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion