-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Resolve mypy error in mcmc.py #7854
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
base: main
Are you sure you want to change the base?
Conversation
…nd.array and resolves mypy error
|
Still failing: https://github.com/pymc-devs/pymc/actions/runs/16338464408/job/46163429561?pr=7854#step:5:370 You can test locally by running |
I did and I was focused on only this
|
No, just mcmc, but as you can see it still fails on the CI. Does it pass locally for you? If so, you may not be installing the same dependencies (specially numpy) |
I've also noticed that the tests fail on the ubuntu runner. I'm unable to reproduce locally, as I use macOS |
I doubt that's the reason for the difference. Type hints are not OS-specific |
my environment has numpy 2.3.1, and I noticed requirements.txt has numpy >=1.25.0. Is there a specific numpy version I should use? |
You can check the versions the CI is installing in the log. It seems to be picking numpy 2.2.6 https://github.com/pymc-devs/pymc/actions/runs/16338464408/job/46163429561?pr=7854#step:4:22 |
I've been able to reproduce locally with numpy 2.2.6, is bumping the numpy version to 2.3.2 an option ( i understand, there's possible more to consider) |
We can just wait for the CI to start picking that version of numpy and the issue will auto-fix itself then? Or do we still need this change? |
I just checked. Yes, the change fixes the mypy error on numpy 2.3.1. Without the change, the mypy error persists even on numpy 2.3.1 |
In that case we can merge the changes but leave the mcmc.py as still failing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7854 +/- ##
==========================================
+ Coverage 89.25% 92.99% +3.73%
==========================================
Files 108 108
Lines 18327 18327
==========================================
+ Hits 16358 17043 +685
+ Misses 1969 1284 -685
🚀 New features to boost your workflow:
|
alright,
I have readded "sampling/mcmc.py" to the list of failing files, now waiting on CI to pass |
Description
Switching from list comprehension to np.fromiter converts the list to an NDArray which satisfies Mypy Type checks
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7854.org.readthedocs.build/en/7854/