Menu

#11 upgrade to numpy

closed
nobody
None
5
2010-08-04
2010-07-21
brice
No

I am interested in the python port. I modified a bit the Makefile so as to add the correct include directories and I managed to generate biosig.py for python2.6 and numpy. I then ran the test. Although there was no execution error, the results do not seem to be correct (for instance the last line says: "status channel, peak to peak amplitude of sin at 3.000000 Hz: 94.465793 (should be 0.000000)").

Discussion

  • brice

    brice - 2010-07-21
     
  • brice

    brice - 2010-07-21

    Sorry, I posted accidentally before finishing writing...

    I am interested in the python port. Numeric is not available on my system (debian squeeze). I believe it has now been replaced by numpy and is deprecated... Maybe you should consider upgrading.

    I modified a bit the Makefile so as to add the correct include directories and I managed to generate biosig.py for python2.6 and numpy. I then ran the test. Although there was no execution error, the results do not seem to be correct (for instance the last line says: "status channel, peak to peak amplitude of sin at 3.000000 Hz: 94.465793 (should be 0.000000)").

     
  • brice

    brice - 2010-07-21

    I tested biosig.py (using numpy and python2.6). I loaded the Newtest17-256.bdf file with it and compared with data loaded in EEGLAB. they are the same.
    So it seems that the upgrade to numpy only require simple changes in python/swig.i and python/Makefile.

    Some warnings appeared when loading the data:
    >>> data = biosig.sread(0, HDR.NRec, HDR)
    demo.py:1: DeprecationWarning: PyArray_FromDims: use PyArray_SimpleNew.
    ####### Demo for Python interface to BioSig" #####################
    demo.py:1: DeprecationWarning: PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr.
    ####### Demo for Python interface to BioSig" #####################

    Besides that everything seems OK.

     
  • Alois Schloegl

    Alois Schloegl - 2010-07-29

    Thanks for your interest. The message is in fact misleading, the data is correctly loaded.
    As far as I see, the transition from numeric to numpy was done in Dec 2009, and is included in v0.91 and later.

    You mentioned that you had to make some changes in python/swig.i and python/Makefile. Would you mind sharing this changes ?

     
  • brice

    brice - 2010-07-30

    I had to
    - add -I/usr/share/pyshared/numpy/core/include/numpy in the python/Makefile for rules for targets biosig.py and _biosig.so
    - change #include <Numeric/arrayobject.h> into #include <arrayobject.h> in swig.i

     
  • Alois Schloegl

    Alois Schloegl - 2010-08-04
    • status: open --> closed
     
  • Alois Schloegl

    Alois Schloegl - 2010-08-04

    The suggested changes are included. Thanks.