Closed OriolAbril closed 6 months ago
Is this related to any specific version of SciPy or any detail that could be made explicit? It's just curiosity, the change looks good.
The function has been moved, starting with next release trying to import it from scipy.signal instead of scipy.signal.windows will raise an error. The issue this PR will close is because this is already happening with the latest scipy pre-release
Hey! as the scipy 1.13 was released yesterday (https://pypi.org/project/scipy/1.13.0/) Will you cut a release with this fix soon 🙏 ?
Next time things like this happens, it would be more ideal to do something like:
try:
# import-change since version 1.13!
from scipy.signal.windows import gaussian
except:
from scipy.signal import gaussian
in this way you are backwards-compatible without these cascading problems.
(even when things like this was actually a mistake, it seems that gaussian
was always supposed to be imported from the windows
subpackage.)
We generally do that @zerothi. However in that case the issue is we missed the DeprecationWarning, so the issue and PR were open after the deprecation process, when scipy.signal.gaussian
was finally removed. IIRC, scipy.signal.gaussian
was removed in scipy 1.13, but scipy.signal.windows.gaussian
has been around since at least scipy 1.7, and ArviZ requires scipy >=1.9. There is no version of scipy supported by ArviZ where from scipy.signal.windows import gaussian
should fail.
Keep in mind the original code was probably written around scipy 1.0 at which time the scipy.signal.windows
submodule didn't exist yet: https://docs.scipy.org/doc/scipy-1.0.0/reference/signal.html#window-functions and it has probably changed locations within ArviZ but mostly copy pasting to restructure imports.
Ok, I agree with your comments! Thanks!!
Description
closes #2330
Checklist
📚 Documentation preview 📚: https://arviz--2332.org.readthedocs.build/en/2332/