-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAINT: avoid call to deprecated scipy.special.btdtr
and scipy.special.btdtri
functions
#884
Conversation
I noticed whilst making this change that we're importing functions from |
It seems there may be another change in, I think, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me
I think that the functions may not have existed in scipy.special at first, but only in ufuncs (at least this is my recollection). |
This is due to an incompatibility between gwpy and matplotlib, that Duncan said will be resolved by a future release of gwpy. |
I don't know, but I'd be in favour of changing it, especially with array api support coming soon for non |
Thanks @GregoryAshton and @ColmTalbot, given that I'll change the code to just import from |
Ah, I see, any thoughts on how to best avoid this? To me, the easiest option would probably be to just set matplotlib <3.10 in the CI. |
As a temporary workaround, sure, can we do it in a separate PR so it is easier to see/revert? |
Sure, here's the PR: #885 |
3dbdb54
to
df581f1
Compare
I'm unsure why the tests are still failing. I've created a local env with matploltib 3.10 and then downgraded to 3.9.4 and the tests then pass. Does anyone have any ideas? |
I think I've identified the issue and I'm trying to address it in #888 |
df581f1
to
01dc692
Compare
scipy.special.btdtri
functionscipy.special.btdtr
and scipy.special.btdtri
functions
After rebasing, the relevant tests now run and pass. However, an unrelated test is failing. I've opened a separate PR with the fix (#891) but I can also pull the changes into this one if we want. |
I'd personally prefer if changes in separate PRs stay separate! Hopefully no additional PRs will be needed. |
Replaces the call with the equivalent call to `betaincinv`.
01dc692
to
4e58bc4
Compare
scipy.special.btdtr
andscipy.special.btdtri
are deprecated and were removed inscipy
1.14.0 (see the docs here and here). The PR replaces the import and call withbetainc
andbetaincinv
which are equivalent.Motivation
Since this function has been removed, we have to change the code if we are going to support
scipy
>= 1.14.0.The CI was failing due to this import. See e.g. https://github.com/bilby-dev/bilby/actions/runs/12650850335
Testing
I've run the tests locally and they pass.
Other notes
I also reformatted the imports to follow the formatting used by
black