On Tue, May 1, 2012 at 2:24 PM, Stéfan van der Walt <stefan@sun.ac.za>wrote:
Hi Nadav
On Mon, Apr 30, 2012 at 11:10 PM, Nadav Horesh <nadavh.horesh@gmail.com> wrote:
I have an unresolved problem (which caused me a delay of ~3 weeks) with applying a cython callback function, which I would like your help: how to make demo/example_not_working.py work?
I'd like to help, but unfortunately I can't get demo/example.py to work. Did you include all the relevant files in the archive? It seems filter_iter.py is missing. I can also help to get this into a git repo--feel free to ping me on google talk or via email.
Stéfan
I got an error when building the main package. For me, commenting the "package_data" (i.e. the pxd file) fixed the build. For ease of testing, maybe the demo should be in the parent directory, and there should be a subdirectory "filter_iter" which contains the filter implementation. That way you don't have to add "filter_iter" to your path in order to test. After all that though, I also get an error with example.py: Traceback (most recent call last): File "example.py", line 18, in <module> 'rand_select', (3,3)) File "../../filter_iter/gen_filter.py", line 55, in apply_C_filter File "_filter_iter.pyx", line 184, in filter_iter._filter_iter.gen_filter_matrix.filter_with_C_callback_float (./_filter_iter.c:4819) TypeError: an integer is required filter_iter_demo$ Changing the call the last argumet to an int gives an "'int' object is unsubscriptable" TypeError. As Stefan suggests, putting this into a git repo would be really helpful for testing and review. -Tony