Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy interface #1

Closed
sfomel opened this issue Jun 22, 2006 · 5 comments
Closed

numpy interface #1

sfomel opened this issue Jun 22, 2006 · 5 comments

Comments

@sfomel
Copy link
Contributor

sfomel commented Jun 22, 2006

Update the python API from numarray to numpy.

Reported by: sfomel

@sfomel
Copy link
Contributor Author

sfomel commented Aug 1, 2006

Logged In: YES
user_id=801437

Follow the guidelines in

http://www.scipy.org/Converting_from_numarray?highlight=%28numarray%29

and change filt/lib/rsf.i

Original comment by: sfomel

@sfomel
Copy link
Contributor Author

sfomel commented Aug 3, 2006

Logged In: YES
user_id=1548166

There is also /filt/lib/rsf.py to change, but that is
quite simple – just replace automatically all instances of
the ‘numarray’ string with ‘numpy’ in any text editor.

Original comment by: nickvlad

@sfomel
Copy link
Contributor Author

sfomel commented Aug 4, 2006

Logged In: YES
user_id=1548166

I found out today that Python 2.5 (now available as beta
3) will include the ctypes module! So they will become the
recommended method for calling C. I read about ctypes in
Oliphant’s book (great resource on this topic). Apparently
there is no need for wrappers! Just import the ctypes
module and call the functions. The python layer mentioned
by Oliphant is if you want bounds-checking safety and the
like. It is what rsf.py provides to the c_rsf module
anyway. Ctypes was created especially for calling large
existing shared libraries from Python without a wrapper.
Numpy works well with it too. I will try to look into
redoing the API with ctypes, but: (1) my fiancee comes
tomorrow; (2) the wedding is in 2 weeks (3) after that I
have to move to another apartment and (4) I do not trust
my Python abilities very much. So I do not dare to even
ask to be assigned to this. I’ll see what I can do, but I
cannot promise anything.
Nick

Original comment by: nickvlad

@sfomel
Copy link
Contributor Author

sfomel commented Sep 4, 2006

Logged In: YES
user_id=801437

After converting to numpy, add a Python example to
http://rsf.sourceforge.net/wiki/index.php/Demo

Original comment by: sfomel

@sfomel
Copy link
Contributor Author

sfomel commented Oct 20, 2006

Logged In: YES
user_id=1541111

With the much appreciated help of Darren Thomson, we updated the API Python
from numarray to numpy. Note that if you have ONLY numarray, the API Python
will use numarray but if you have both numarray and numpy, or only numpy, API
Python uses numpy.

I also updated the Python example on the wiki.

Original comment by: hegilles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@sfomel and others