traceback while running getting started example

20 views
Skip to first unread message

martinakos

unread,
Aug 28, 2012, 8:43:05 AM8/28/12
to alg...@googlegroups.com
Hi,

I'm getting a traceback while running getting started example in http://packages.python.org/algopy/

the output is:
jacobian =  [ 135.42768462   41.08553692   15.        ]
gradient = [array([ 135.42768462,   41.08553692,   15.        ])]
Jacobian =
Traceback (most recent call last):
  File "AlgoPy_test.py", line 28, in <module>
    print 'Jacobian =', cg.jacobian([[3.,5,7]])
  File "C:\Python27\lib\site-packages\algopy\tracer\tracer.py", line 262, in jacobian
    self.pushforward(utpm_x_list)
  File "C:\Python27\lib\site-packages\algopy\tracer\tracer.py", line 103, in pushforward
    f.__class__.pushforward(f.func, f.args, Fout = f)
  File "C:\Python27\lib\site-packages\algopy\tracer\tracer.py", line 637, in pushforward
    out  = func(*args)
  File "C:\Python27\lib\site-packages\algopy\utpm\utpm.py", line 73, in __getitem__
    tmp = self.data.__getitem__((slice(None),slice(None)) + tuple(sl))
IndexError: invalid index

I'm using Python 2.7.3 and Numpy 1.6.2 and I have tried the example with algopy 0.3.1 and 0.3.1.dev, I get this error with both.
Any idea what's wrong?

Cheers
Martin 

Sebastian Walter

unread,
Aug 28, 2012, 12:06:02 PM8/28/12
to alg...@googlegroups.com
Hello Martin,

thanks of the bug report.

Can you download a fresh copy from https://github.com/b45ch1/algopy
and confirm that the getting started example works now?

cheers,
Sebastian

martinakos

unread,
Aug 28, 2012, 1:37:02 PM8/28/12
to alg...@googlegroups.com
Hi Sebastian

I removed a pair of square brackets from the line
print 'Jacobian =', cg.jacobian([[3.,5,7]])
and now it works. I assume that's the problem?

I've tried the fresh copy from github at it's the same, I have to remove the extra pair of brackets for it to work

cheers
Martin 
Reply all
Reply to author
Forward
0 new messages