gordon | 1 Apr 01:06
Picon

code using Numeric and LinearAlgebra

i came across some code that uses calls like
LinearAlgebra.eigenvectors(L) and Numeric.matrixmultiply(v, x) which
gives compilation errors on my new numpy installation.Is it possible
to get such code compiled while using new version of numpy?

when evalues, evectors = LinearAlgebra.eigenvectors(L) is computed for
a symmetric covariance matrix L ,how are eigenvectors arranged in
evectors? are they in columns?can i simply replace the above  call by
linalg.eigh()?

Similarly can i just replace Numeric.matrixmultiply(v, x) with
numpy.dot() ,
or is there something i must watch for in the above two cases?
Robert Kern | 1 Apr 04:51
Picon
Gravatar

Re: code using Numeric and LinearAlgebra

On Mon, Mar 31, 2008 at 6:06 PM, gordon <nodrogbrown <at> gmail.com> wrote:
> i came across some code that uses calls like
>  LinearAlgebra.eigenvectors(L) and Numeric.matrixmultiply(v, x) which
>  gives compilation errors on my new numpy installation.Is it possible
>  to get such code compiled while using new version of numpy?
>
>  when evalues, evectors = LinearAlgebra.eigenvectors(L) is computed for
>  a symmetric covariance matrix L ,how are eigenvectors arranged in
>  evectors? are they in columns?can i simply replace the above  call by
>  linalg.eigh()?

Columns, yes, and yes.

>  Similarly can i just replace Numeric.matrixmultiply(v, x) with
>  numpy.dot() ,

Yes. matrixmultiply() was a deprecated alias even in Numeric.

>  or is there something i must watch for in the above two cases?

Not particularly, no.

--

-- 
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
(Continue reading)

Robert Kern | 1 Apr 05:06
Picon
Gravatar

Re: Numpy installation

On Mon, Mar 31, 2008 at 4:17 PM, Amit Itagi <aitagi <at> gmail.com> wrote:
> Hi,
>
> I am having problems with numpy installation.
>
> 1) These is an atlas 3.8.0 library installed somewhere in the search path.
> However, the installation gives errors with that installation. Is there a
> way to tell the installer to install the default (possibly slower) blas,
> instead of using the one in the path ?

Create a site.cfg file with the appropriate section; copy and modify
the site.cfg.example file.

> 2) Also, my main Python directory is called Python-2.5.2. When I try to
> configure with the install<prefix>, it changes Python-2.5.2 to
> "python-2.5.2" and creates a new directory. How can I make the installer not
> convert the upper-case "P" to a lower-case ?

Can you give more information like the platform you are on, the full
path to this directory, the exact commands that you executed, and the
results of these commands?

--

-- 
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
(Continue reading)

Robert Kern | 1 Apr 05:18
Picon
Gravatar

Re: Trouble using f2py on successful numpy build from SVN (1.0.5 dev4951)

On Mon, Mar 31, 2008 at 9:11 AM, Joshua Lippai <discerptor <at> gmail.com> wrote:
> Ah, good call. I did previously have an easy_install of numpy but I
>  assumed the setup.py install would just overwrite anything from that
>  install outside the site-packages folder. Thanks. Is there anything
>  else I might run into as a side effect of my sloppiness?

The f2py script should be the only thing outside of site-packages. You
may want to edit site-packages/easy-install.pth to remove the old
reference to the numpy egg.

--

-- 
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
Joshua Lippai | 1 Apr 05:51
Picon

Re: Trouble using f2py on successful numpy build from SVN (1.0.5 dev4951)

I eliminated everything easy-install related already since I actually
was aiming to reinstall everything without it (though, alas, dateutil
seems to require it now).

On Mon, Mar 31, 2008 at 8:18 PM, Robert Kern <robert.kern <at> gmail.com> wrote:
> On Mon, Mar 31, 2008 at 9:11 AM, Joshua Lippai <discerptor <at> gmail.com> wrote:
>  > Ah, good call. I did previously have an easy_install of numpy but I
>  >  assumed the setup.py install would just overwrite anything from that
>  >  install outside the site-packages folder. Thanks. Is there anything
>  >  else I might run into as a side effect of my sloppiness?
>
>  The f2py script should be the only thing outside of site-packages. You
>  may want to edit site-packages/easy-install.pth to remove the old
>  reference to the numpy egg.
>
>  --
>
>
> 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 <at> scipy.org
>  http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
(Continue reading)

Picon

Re: numpy installation

Dear sir
while installing numpy i'm getting following errors:
o/p is attached here below.
in that mkl libraries are not found in that  path but the thing is that all mkl libraries are available in the same path!!
so please advice me that what should i do for all these errors!!!

OUTPUT:
Running from numpy source directory.
F2PY Version 2_2522
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in /home/user17/intel/mkl/10.0.1.014/lib/em64t/
  libraries mkl,vml,guide not found in /home/user17/pulsar/PYTHON-PKG/python/lib
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
Setting PTATLAS=ATLAS
Setting PTATLAS=ATLAS
  FOUND:
    libraries = ['ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/home/user17/pulsar/PYTHON-PKG/atlas']
    language = c
    include_dirs = ['/home/user17/pulsar/PYTHON-PKG/ATLAS/include']

  FOUND:
    libraries = ['ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/home/user17/pulsar/PYTHON-PKG/atlas']
    language = c
    define_macros = [('ATLAS_INFO', '"\\"?.?.?\\""')]
    include_dirs = ['/home/user17/pulsar/PYTHON-PKG/ATLAS/include']

lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in /home/user17/intel/mkl/10.0.1.014/lib/em64t/
  libraries mkl,vml,guide not found in /home/user17/pulsar/PYTHON-PKG/python/lib
  NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
numpy.distutils.system_info.atlas_threads_info
Setting PTATLAS=ATLAS
Setting PTATLAS=ATLAS
  FOUND:
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/home/user17/pulsar/PYTHON-PKG/atlas']
    language = f77
    include_dirs = ['/home/user17/pulsar/PYTHON-PKG/ATLAS/include']

  FOUND:
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    library_dirs = ['/home/user17/pulsar/PYTHON-PKG/atlas']
    language = f77
    define_macros = [('ATLAS_INFO', '"\\"?.?.?\\""')]
    include_dirs = ['/home/user17/pulsar/PYTHON-PKG/ATLAS/include']

running install
running build
running config_fc
running build_src
building py_modules sources
building extension "numpy.core.multiarray" sources
  adding 'build/src.linux-ia64-2.3/numpy/core/config.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/src' to include_dirs.
numpy.core - nothing done with h_files= ['build/src.linux-ia64-2.3/numpy/core/src/scalartypes.inc', 'build/src.linux-ia64-2.3/numpy/core/src/arraytypes.inc', 'build/src.linux-ia64-2.3/numpy/core/config.h', 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h']
building extension "numpy.core.umath" sources
  adding 'build/src.linux-ia64-2.3/numpy/core/config.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/__ufunc_api.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/src' to include_dirs.
numpy.core - nothing done with h_files= ['build/src.linux-ia64-2.3/numpy/core/src/scalartypes.inc', 'build/src.linux-ia64-2.3/numpy/core/src/arraytypes.inc', 'build/src.linux-ia64-2.3/numpy/core/config.h', 'build/src.linux-ia64-2.3/numpy/core/__ufunc_api.h']
building extension "numpy.core._sort" sources
  adding 'build/src.linux-ia64-2.3/numpy/core/config.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h' to sources.
numpy.core - nothing done with h_files= ['build/src.linux-ia64-2.3/numpy/core/config.h', 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h']
building extension "numpy.core.scalarmath" sources
  adding 'build/src.linux-ia64-2.3/numpy/core/config.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h' to sources.
  adding 'build/src.linux-ia64-2.3/numpy/core/__ufunc_api.h' to sources.
numpy.core - nothing done with h_files= ['build/src.linux-ia64-2.3/numpy/core/config.h', 'build/src.linux-ia64-2.3/numpy/core/__multiarray_api.h', 'build/src.linux-ia64-2.3/numpy/core/__ufunc_api.h']
building extension "numpy.core._dotblas" sources
  adding 'numpy/core/blasdot/_dotblas.c' to sources.
building extension "numpy.lib._compiled_base" sources
building extension "numpy.dft.fftpack_lite" sources
building extension "numpy.linalg.lapack_lite" sources
  adding 'numpy/linalg/lapack_litemodule.c' to sources.
building extension "numpy.random.mtrand" sources
Could not locate executable gfortran
Could not locate executable f95
customize GnuFCompiler
customize GnuFCompiler
customize GnuFCompiler using config
gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC'
compile options: '-Inumpy/core/src -Inumpy/core/include -I/home/user17/pulsar/PYTHON-PKG/python/include/python2.3 -c'
gcc: _configtest.c
_configtest.c:7:2: #error No _WIN32
_configtest.c:7:2: #error No _WIN32
failure.
removing: _configtest.c _configtest.o
building data_files sources
running build_py
copying build/src.linux-ia64-2.3/numpy/__config__.py -> build/lib.linux-ia64-2.3/numpy
copying numpy/distutils/system_info.py -> build/lib.linux-ia64-2.3/numpy/distutils
copying build/src.linux-ia64-2.3/numpy/distutils/__config__.py -> build/lib.linux-ia64-2.3/numpy/distutils
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize GnuFCompiler
customize GnuFCompiler
customize GnuFCompiler using build_ext
running build_scripts
  adding 'build/scripts.linux-ia64-2.3/f2py2.3' to scripts
running install_lib
copying build/lib.linux-ia64-2.3/numpy/__config__.py -> /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy
copying build/lib.linux-ia64-2.3/numpy/distutils/system_info.py -> /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy/distutils
copying build/lib.linux-ia64-2.3/numpy/distutils/__config__.py -> /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy/distutils
byte-compiling /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy/__config__.py to __config__.pyc
byte-compiling /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy/distutils/system_info.py to system_info.pyc
byte-compiling /home/user17/pulsar/PYTHON-PKG/python/lib//lib/python2.3/site-packages/numpy/distutils/__config__.py to __config__.pyc
running install_scripts
changing mode of /home/user17/pulsar/PYTHON-PKG/python/lib//bin/f2py2.3 to 775
running install_data


_______________________________________________
Numpy-discussion mailing list
Numpy-discussion <at> scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Picon
Picon
Favicon

Re: Project for Cython integration with NumPy

Hi Dag

On Tue, Apr 1, 2008 at 12:52 AM, Dag Sverre Seljebotn
<dagss <at> student.matnat.uio.no> wrote:
> > I am going to apply for a Google Summer of Code project about "Developing
>  > Cython towards better NumPy integration" (Cython: http://cython.org).
>  > Anyone interested in how this is done can have a look at the links below,
>  > any feedback is welcome.
>  >
>
> > The application I am going to submit (to Python Foundation):
>  > http://wiki.cython.org/DagSverreSeljebotn/soc
>
>  I now have time to actively discuss and improve it so any feedback from
>  the NumPy community is greatly appreciated.

Sorry for only responding now; I was traveling back from Europe.

The project your propose has important implications for NumPy.
Currently, much of the core is implemented in C and very few people
have in-depth knowledge of its inner workings.  We therefore have
fewer eyes on that code than we'd like.  Furthermore, there are only
two ways of extending the core: 1) use Python callbacks, which are
slow or 2) learn the C API and deal with reference counting -- too
much to ask from a scientist who simply wishes to implement a fast
algorithm.

There are also some other projects, like scipy.ndimage, that could do
with a fair bit of refactoring, and this task would be so much easier
if Cython could generate the C-level ndarray code; we have precious
little developer resources available as it is, and would rather spend
it on solving problems than on arranging low-level API calls.

Having the following implemented would already be a vast improvement
on the current situation:

 - Array indexing
   x[1,2]
   x[1:2,3:4]
   x[1,...]
   x[1,:]

 - Assignment
   x[1,2] = 3
   x[1,...] = 1
   ...

 - Calling array methods:
   y = x.sum()

Doing this would be easier with Travis Oliphant's numpy developer's
reference at hand, and, if I recall the page on scipy.org (which is
currently down) correctly, he would provide it to you free of charge
on request.

I am very excited about your proposal, and I really hope it takes off.
 Let us know if there is anything we can do to help.

Best of luck,
Stéfan
Picon
Picon
Favicon

Re: Project for Cython integration with NumPy

Hi Dag

On Tue, Apr 1, 2008 at 12:52 AM, Dag Sverre Seljebotn
<dagss <at> student.matnat.uio.no> wrote:
> > I am going to apply for a Google Summer of Code project about "Developing
>  > Cython towards better NumPy integration" (Cython: http://cython.org).
>  > Anyone interested in how this is done can have a look at the links below,
>  > any feedback is welcome.
>  >
>
> > The application I am going to submit (to Python Foundation):
>  > http://wiki.cython.org/DagSverreSeljebotn/soc
>
>  I now have time to actively discuss and improve it so any feedback from
>  the NumPy community is greatly appreciated. See especially:
>
>
>  http://wiki.cython.org/enhancements/numpy

One more comment about the constructor described on the page above.
It would be good if we could have the same syntax as the current
numpy.ndarray, and then simply call through to the underlying C
constructor.  We'd also need zeros, empty, ones_like and some other
select functions.  The goal is to remain as faithful as possible to
the original API, so that there is hardly a distinction between Python
and Cython.

Cheers
Stéfan
izak marais | 1 Apr 09:10
Picon
Favicon

Re: Applying PIL patch

Thank you for the reply. I in fact did not have the latest PIL binary. It works beautifully now. Luckily I won't be needing RGBA support soon.

Izak

----- Original Message ----
From: Stéfan van der Walt <stefan <at> sun.ac.za>
To: Discussion of Numerical Python <numpy-discussion <at> scipy.org>
Sent: Monday, March 31, 2008 11:45:52 PM
Subject: Re: [Numpy-discussion] Applying PIL patch

Unfortunately, RGBA images cannot be read this way.  A patch that
fixes the issue was posted here:

http://www.mail-archive.com/image-sig <at> python.org/msg01482.html

No response from the Image SIG guys.

Regards
Stéfan

On Mon, Mar 31, 2008 at 6:29 PM, Christopher Barker
<Chris.Barker <at> noaa.gov> wrote:
> izak marais wrote:
>  > Sorry for the beginner question. I want to apply the PIL-numpy patch
>  > from http://www.scipy.org/Cookbook/PIL?highlight=%28PIL%29 . I have the
>  > latest windows binaries of numpy, scipy and PIL installed.
>
>  Then you have the patch already-- it was added to the latest PIL.
>
http://effbot.org/zone/pil-changes-116.htm
>
>  -Chris
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion <at> scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion <at> scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
izak marais | 1 Apr 10:08
Picon
Favicon

Re: Applying PIL patch

Stéfan wrote:
"Unfortunately, RGBA images cannot be read this way. "

Apparently it does not work with 16bit greyscale tif images either.
For anyone else stumbling upon this thread, there is a work-about to get the data into a numpy array.

i = Image.open('16bitGreyscaleImage.tif')
a = numpy.array(i.getdata())   # a 1d numpy array
a = a.reshape(i.size)  #2d numpy array

Perhaps there is a better way of doing it (?), but this works for me.

Izak

No Cost - Get a month of Blockbuster Total Access now. Sweet deal for Yahoo! users and friends.
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion <at> scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Gmane