Magnus Lie Hetland wrote:
> Perhaps only useful for morale/enthusiasm, I'd think this sort of  
> thing is still on topic, so... :->
>
> I've been having problems with part of my code. I ended up rewriting a  
> very similar piece of code somewhere else, and it was **much** faster.  
> Didn't quite get it, but just shrugged and let it go.
>
> Then I wanted to run some more ambitious experiments with the old  
> code. My progress bar told me (when it finally got enough progress to  
> tell me anything) that the experiment would probably take a couple of  
> weeks! Now, this estimate was probably highly inaccurate, but still a  
> bit too high for my taste -- I had hoped to get some results by the  
> next day... (Actually, I found this estimate when I looked at the  
> computer the morning after I started the experiment.) So I just gave  
> up. Until a colleague convinced me to have another look.
>
> It turns out I had renamed my iteration variables, and some related  
> variables used to index a rather large NumPy array ... but I *hadn't*  
> updated the cdef declarations -- so they were still for the old names.
>
> Easy enough to fix. Now half the experiment has run, and there's an  
> estimated 20 minutes left :-D
>   
Thanks for the morale booster! The problem you had here can be reduced 
when the planned "undeclared" warning/error is supported:

@cython.errors(undeclared=True)
def f():
    cdef int speling
    cdef object x
    x = 3 # ok
    spelling = 3 # gives error
 

Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to