yig / PySPQR

Python wrapper for the sparse QR decomposition in SuiteSparseQR.
Creative Commons Zero v1.0 Universal
34 stars 27 forks source link

qr() got an unexpected keyword argument 'economy' #16

Closed yustiks closed 3 years ago

yustiks commented 3 years ago

Hello, I am trying to run the code and have the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-73-0ceea0ee1cbe> in <module>
     39 print("Q shape:", Q.shape)  # Q shape: (20, 20)
     40 print("R shape:", R.shape)  # R shape: (20, 5)
---> 41 Q, R, E, rank = sparseqr.qr( M, economy=True )
     42 print("Q shape:", Q.shape)  # Q shape: (20, 5)
     43 print("R shape:", R.shape)  # R shape: (5, 5)

TypeError: qr() got an unexpected keyword argument 'economy'
yustiks commented 3 years ago

what could be the reason?

BurningKarl commented 3 years ago

I'm not the developer but I would suspect an outdated version of the sparseqr package. The version released on PyPI was published in 2017 and does not include the economy option. Try uninstalling your current version and install the version published on GitHub:

pip install git+https://github.com/yig/PySPQR.git#egg=sparseqr
yig commented 3 years ago

The version on PyPI has been updated. Marking as closed.