Numarray, numeric, NumPy, scpy_core ??!!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J

    #1

    Numarray, numeric, NumPy, scpy_core ??!!

    Hi

    I hope the title of this message indicates my question. I am looking
    for basic
    array functionality in Python and it turns out that there are all these
    packages which
    are somehow related. Some are allegedly discontinued but still seem to
    get updated. Could we start a discussion about which package will or
    may or should survive ?

    I started to use numarray, but I have a bug that I just cannot find a
    solution for, so I started
    to look around again. Basically I want to provide scripting support to
    a graphics engine. All the
    matrices and vectors are in C++ and all I want to do is provide an
    interface to python. As a matter of fact, all of the matrix
    multiplication etc, could remain in the native C++ code, but I need a
    way to extend the python language with the array data type and somehow
    intercept operator calls such as *,+,- ....

    How is that done in the current libraries... Thx for any help.


    Cheers
    Jochen

  • Claudio Grondi

    #2
    Re: Numarray, numeric, NumPy, scpy_core ??!!

    J wrote:[color=blue]
    > Hi
    >
    > I hope the title of this message indicates my question. I am looking
    > for basic
    > array functionality in Python and it turns out that there are all these
    > packages which
    > are somehow related. Some are allegedly discontinued but still seem to
    > get updated. Could we start a discussion about which package will or
    > may or should survive ?
    >
    > I started to use numarray, but I have a bug that I just cannot find a
    > solution for, so I started
    > to look around again. Basically I want to provide scripting support to
    > a graphics engine. All the
    > matrices and vectors are in C++ and all I want to do is provide an
    > interface to python. As a matter of fact, all of the matrix
    > multiplication etc, could remain in the native C++ code, but I need a
    > way to extend the python language with the array data type and somehow
    > intercept operator calls such as *,+,- ....
    >
    > How is that done in the current libraries... Thx for any help.
    >
    >
    > Cheers
    > Jochen
    >[/color]

    I know the pain having similar trouble to understand the dependencies
    and what is what and why, so any enlightenment towards getting rid of my
    confusion to distinguish what is what and why is highly welcome.

    I decided to use numarray, so maybe you can report what your problem/bug
    is before I run into it myself? The reason why I decided to use numarray
    was, that the whole scpy_core story seems to get more or less commercial
    and its free version comes because of this with no documentation of
    newest features.

    Claudio

    Comment

    • Robert Kern

      #3
      Re: Numarray, numeric, NumPy, scpy_core ??!!

      J wrote:[color=blue]
      > Hi
      >
      > I hope the title of this message indicates my question. I am looking
      > for basic
      > array functionality in Python and it turns out that there are all these
      > packages which
      > are somehow related. Some are allegedly discontinued but still seem to
      > get updated. Could we start a discussion about which package will or
      > may or should survive ?[/color]

      You missed the discussion. The answer is numpy.



      The mailing list is numpy-discussion@list s.sourceforge.n et :

      http://sourceforge.net/mail/?group_id=1369

      --
      Robert Kern
      robert.kern@gma il.com

      "In the fields of hell where the grass grows high
      Are the graves of dreams allowed to die."
      -- Richard Harter

      Comment

      • Robert Kern

        #4
        Re: Numarray, numeric, NumPy, scpy_core ??!!

        Claudio Grondi wrote:
        [color=blue]
        > I decided to use numarray, so maybe you can report what your problem/bug
        > is before I run into it myself? The reason why I decided to use numarray
        > was, that the whole scpy_core story seems to get more or less commercial
        > and its free version comes because of this with no documentation of
        > newest features.[/color]

        No, numpy (which used to be scipy_core) is completely free. It will never turn
        into a proprietary package.

        The complete documentation, however, is currently available only as a PDF for
        purchase, but only until a certain number of copies have been sold, or enough
        time passes. Believe me, the old manuals for Numeric and numarray were never as
        complete. No one could ever commit the time to thoroughly document them for
        free. Charging for the documentation (for a limited time) was the only way
        Travis Oliphant could afford to spend the time to write the full documentation
        and write the code. I think the quality of the book speaks well for that choice.

        Of course, the docstring coverage is quite good, and we have explicitly welcomed
        efforts to produce free documentation. So far, those who have volunteered
        haven't produced anything. And as incomplete as the old Numeric manual was *for
        Numeric*, it and the free documentation that is actually distributed with numpy
        and describes the differences between the two goes a long way.

        --
        Robert Kern
        robert.kern@gma il.com

        "In the fields of hell where the grass grows high
        Are the graves of dreams allowed to die."
        -- Richard Harter

        Comment

        • Colin J. Williams

          #5
          Re: Numarray, numeric, NumPy, scpy_core ??!!

          J wrote:[color=blue]
          > Hi
          >
          > I hope the title of this message indicates my question. I am looking
          > for basic
          > array functionality in Python and it turns out that there are all these
          > packages which
          > are somehow related. Some are allegedly discontinued but still seem to
          > get updated. Could we start a discussion about which package will or
          > may or should survive ?
          >
          > I started to use numarray, but I have a bug that I just cannot find a
          > solution for, so I started
          > to look around again. Basically I want to provide scripting support to
          > a graphics engine. All the
          > matrices and vectors are in C++ and all I want to do is provide an
          > interface to python. As a matter of fact, all of the matrix
          > multiplication etc, could remain in the native C++ code, but I need a
          > way to extend the python language with the array data type and somehow
          > intercept operator calls such as *,+,- ....
          >
          > How is that done in the current libraries... Thx for any help.
          >
          >
          > Cheers
          > Jochen
          >[/color]
          numarray was intended to replace Numeric.

          numarray is stable and performs reaonably well.
          If you have a specific problem, you might post a problem report to:
          numpy-discussion@list s.sourceforge.n et
          You can also subscribe to the list.

          numpy is intended to perform better and is close to a production release.

          Colin W,

          Comment

          • J

            #6
            Re: Numarray, numeric, NumPy, scpy_core ??!!

            Ok, I will look at NumPy ...

            I have another question about performance. Are the array operations
            such as matrix multiplication implemented in
            python or in C ? I was under the impression that the function calls in
            numarray are only wrappers to C code, but now I suspect that matrix
            multiplicaiton is implemented in python and executed in the
            interpreter. Is that true ?

            Can someone also please point me to examples of how I could make my own
            array classes. Basically all I need is vectors and 3x3 matrices. I
            already have all of the multiplication code in my C++ classes and only
            need wrappers. But how can I create an array class and intercept
            operators calls like * + -. This is not neccessarily a solution that I
            want to follow, but it may be what
            I have to do for now.

            BTW, here is also the problem I have with a numarray. I have created a
            vector like so...

            mPyObject = PyArray_FromDim sAndData(GeoVec 4f::sD,GeoVec4f ::sDim,
            PyArray_FLOAT,( char*)mValue.mV alues);
            Py_INCREF(mPyOb ject);

            The PyObject is then used as a member called "gradient" in another
            embedded class. When I execute the following
            script

            x.gradient*3

            my app just crashes. But when I execute

            print (x.gradient)
            x.gradient*3

            everything works fine... I assum there must be some kind of reference
            count problem...


            Cheers
            Jochen

            Comment

            • Robert Kern

              #7
              Re: Numarray, numeric, NumPy, scpy_core ??!!

              J wrote:[color=blue]
              > Ok, I will look at NumPy ...
              >
              > I have another question about performance. Are the array operations
              > such as matrix multiplication implemented in
              > python or in C ? I was under the impression that the function calls in
              > numarray are only wrappers to C code, but now I suspect that matrix
              > multiplicaiton is implemented in python and executed in the
              > interpreter. Is that true ?[/color]

              No, not at all. In fact, if an optimized BLAS is available on your system, you
              can make numpy (or numarray or Numeric) use that to do your matrix
              multiplications much faster.
              [color=blue]
              > Can someone also please point me to examples of how I could make my own
              > array classes. Basically all I need is vectors and 3x3 matrices. I
              > already have all of the multiplication code in my C++ classes and only
              > need wrappers. But how can I create an array class and intercept
              > operators calls like * + -. This is not neccessarily a solution that I
              > want to follow, but it may be what
              > I have to do for now.[/color]

              It's a difficult problem, since you have to overload nearly every operation in
              order to return arrays of your subclass, not the basic array class. numpy has a
              new mechanism to try to alleviate this. You should look at the matrix subclass
              in numpy/core/defmatrix.py .

              --
              Robert Kern
              robert.kern@gma il.com

              "In the fields of hell where the grass grows high
              Are the graves of dreams allowed to die."
              -- Richard Harter

              Comment

              • J

                #8
                Re: Numarray, numeric, NumPy, scpy_core ??!!


                I will just jump in an use NumPy. I hope this one will stick and evolve
                into the mother of array packages.
                How stable is it ? For now I really just need basic linear algebra.
                i.e. matrix multiplication, dot, cross etc

                Cheers

                Comment

                • Robert Kern

                  #9
                  Re: Numarray, numeric, NumPy, scpy_core ??!!

                  J wrote:[color=blue]
                  > I will just jump in an use NumPy. I hope this one will stick and evolve
                  > into the mother of array packages.
                  > How stable is it ? For now I really just need basic linear algebra.
                  > i.e. matrix multiplication, dot, cross etc[/color]

                  That stuff isn't going to change on you.

                  --
                  Robert Kern
                  robert.kern@gma il.com

                  "In the fields of hell where the grass grows high
                  Are the graves of dreams allowed to die."
                  -- Richard Harter

                  Comment

                  • Travis E. Oliphant

                    #10
                    Re: Numarray, numeric, NumPy, scpy_core ??!!

                    J wrote:[color=blue]
                    > I will just jump in an use NumPy. I hope this one will stick and evolve
                    > into the mother of array packages.
                    > How stable is it ? For now I really just need basic linear algebra.
                    > i.e. matrix multiplication, dot, cross etc
                    >[/color]

                    There is a new release coming out this weekend. It's closer to 1.0 and
                    so should be more stable. It also has some speed improvements in
                    matrix-vector operations (if you have ATLAS BLAS --- or if you download
                    a binary version with ATLAS BLAS compiled in). I would wait for it.

                    -Travis

                    Comment

                    • Tom Anderson

                      #11
                      Re: Numarray, numeric, NumPy, scpy_core ??!!

                      On Sat, 21 Jan 2006, Travis E. Oliphant wrote:
                      [color=blue]
                      > J wrote:
                      >[color=green]
                      >> I will just jump in an use NumPy. I hope this one will stick and evolve
                      >> into the mother of array packages. How stable is it ? For now I really
                      >> just need basic linear algebra. i.e. matrix multiplication, dot, cross
                      >> etc[/color]
                      >
                      > There is a new release coming out this weekend. It's closer to 1.0 and
                      > so should be more stable. It also has some speed improvements in
                      > matrix-vector operations (if you have ATLAS BLAS --- or if you download
                      > a binary version with ATLAS BLAS compiled in). I would wait for it.[/color]

                      Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?

                      tom

                      --
                      It's the 21st century, man - we rue _minutes_. -- Benjamin Rosenbaum

                      Comment

                      • Robert Kern

                        #12
                        Re: Numarray, numeric, NumPy, scpy_core ??!!

                        Tom Anderson wrote:
                        [color=blue]
                        > Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?[/color]

                        Yes.

                        --
                        Robert Kern
                        robert.kern@gma il.com

                        "In the fields of hell where the grass grows high
                        Are the graves of dreams allowed to die."
                        -- Richard Harter

                        Comment

                        • Lawrence Oluyede

                          #13
                          Re: Numarray, numeric, NumPy, scpy_core ??!!

                          "J" <jstier@cs.uvic .ca> writes:
                          [color=blue]
                          > I hope the title of this message indicates my question. I am looking
                          > for basic
                          > array functionality in Python and it turns out that there are all these
                          > packages which
                          > are somehow related. Some are allegedly discontinued but still seem to
                          > get updated.[/color]

                          It's well explained in the homepage: numpy.scipy.org
                          AFAIK you should use numpy for future use.

                          --
                          Lawrence - http://www.oluyede.org/blog
                          "Anyone can freely use whatever he wants but the light at the end
                          of the tunnel for most of his problems is Python"

                          Comment

                          • Tom Anderson

                            #14
                            Re: Numarray, numeric, NumPy, scpy_core ??!!

                            On Sat, 21 Jan 2006, Robert Kern wrote:
                            [color=blue]
                            > Tom Anderson wrote:
                            >[color=green]
                            >> Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?[/color]
                            >
                            > Yes.[/color]

                            Excellent, thanks.

                            tom

                            --
                            forget everything from school -- you are programmer

                            Comment

                            • Sébastien Boisgérault

                              #15
                              Re: Numarray, numeric, NumPy, scpy_core ??!!


                              Robert Kern wrote:[color=blue]
                              > J wrote:[color=green]
                              > > I will just jump in an use NumPy. I hope this one will stick and evolve
                              > > into the mother of array packages.
                              > > How stable is it ? For now I really just need basic linear algebra.
                              > > i.e. matrix multiplication, dot, cross etc[/color][/color]

                              Same concern for me.

                              I discovered recently that I could not rely on numeric anymore
                              because 'eigenvalue' is now broken on my platform. This bug
                              has been referenced but not corrected AFAIK. Too bad that
                              numeric is not actively maintained anymore. Easy-to-install,
                              good doc, well-thought interface, really good stuff !

                              Bye-bye Numeric !

                              By the way, I tried numpy 0.9.4 10 minutes ago and guess
                              what ? 'eigenvalue' is broken too ... (hangs forever)

                              I do really hope the numpy will become the robust, best-of-breed
                              Python Array/Matrix lib that many people are waiting for. But in
                              the meantime, it's back to Matlab :(

                              SB

                              Comment

                              Working...