evangelistalab / qforte

GNU Lesser General Public License v3.0
49 stars 18 forks source link

Fix QPE after SciPy API Change #226

Closed JonathonMisiewicz closed 1 year ago

JonathonMisiewicz commented 1 year ago

Description

SciPy changed the API of their stats.mode function but didn't document it. This function adjusts our use of stats.mode so as not to raise an error. I have no idea what version first contained the change.

Checklist

JonathonMisiewicz commented 1 year ago

Unfortunately, this change causes the QPE tests to fail on my installation. My scipy version is: scipy 1.7.3 py310hfa59a62_0

Would it be too much to make the code agnostic to the version of scipy? For example, we could have an if statement checking the version of scipy or use try and except. Alternatively, in the installation instructions we can specify: conda install scipy>=x.xx to avoid such issues.

So I did some playing with scipy versions. The bug doesn't exist in 1.10.1 but does in 1.11.2. Based on commit history, I suspect this PR caused the behavior change.

I'd prefer putting a minimum SciPy version in.