scarlet icon indicating copy to clipboard operation
scarlet copied to clipboard

Bug in notebook wavelet_model.ipynb - unsupported operand type(s) for @

Open rsav opened this issue 3 years ago • 1 comments
trafficstars

When running the notebook wavelet_model.ipynb, I get this error in the very last cell when computing the scalar product:

TypeError: unsupported operand type(s) for @: 'TabulatedSpectrum' and 'TabulatedSpectrum'

The offending line is:

C[j] = spectrum @ spectrum_ / np.sqrt(spectrum @ spectrum) / np.sqrt(spectrum_ @ spectrum_)

Workaround: use spectrum.get_model() and spectrum_.get_model() instead of spectrum and spectrum_

rsav avatar Jul 06 '22 15:07 rsav

Thanks for reporting. I confirm the bug, this is a leftover from a conversion of spectrum as a direct Parameter to it being a Model that has a parameter. The former one behaves like an array, so @ works, while the latter one doesn't.

The solution is to update the docs.

pmelchior avatar Jul 06 '22 15:07 pmelchior