Skip to content
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

Fix mypy checks and jax installation in CI pipeline #6945

Merged
merged 7 commits into from
Oct 11, 2023

Conversation

michaelosthege
Copy link
Member

@michaelosthege michaelosthege commented Oct 6, 2023

What is this PR about?
Fixing the ❌ mypy job in our CI pipelines.

We were on an outdated mypy==0.990 which failed to even run correctly.
I upgraded to the currently latest version and proceeded to fix the errors it found.

In addition, I also fixed some more typing errors, thereby removing three files from the list of expected failures.

The jax installation was fixed by pinning jax and jaxlib to the same version 0.4.16 which is the jax version that got installed in recent CI runs (probably due to a pin in an upstream package?).

Closes #6940
Closes #6941

Checklist

Bugfixes

  • Several type hints got fixed

Maintenance

  • Fixed mypy job
  • Fixed jax installation in CI environments

📚 Documentation preview 📚: https://pymc--6945.org.readthedocs.build/en/6945/

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #6945 (3957f16) into main (602234b) will increase coverage by 0.00%.
The diff coverage is 90.62%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6945   +/-   ##
=======================================
  Coverage   90.69%   90.70%           
=======================================
  Files         100      100           
  Lines       16833    16845   +12     
=======================================
+ Hits        15267    15279   +12     
  Misses       1566     1566           
Files Coverage Δ
pymc/gp/hsgp_approx.py 92.38% <100.00%> (+0.07%) ⬆️
pymc/model/core.py 91.29% <100.00%> (ø)
pymc/model_graph.py 80.74% <100.00%> (+0.31%) ⬆️
pymc/sampling/jax.py 0.00% <ø> (ø)
pymc/util.py 80.50% <100.00%> (+0.08%) ⬆️
pymc/model/transform/basic.py 90.47% <75.00%> (-4.53%) ⬇️
pymc/variational/opvi.py 87.38% <75.00%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes

@michaelosthege
Copy link
Member Author

Ah nice, the mypy upgrade helps. Now it just fails because mypy has things to complain about.

I'll try to fix these locally

@michaelosthege michaelosthege changed the title Fix mypy pre-commit step Fix mypy and jax installation steps in CI pipeline Oct 10, 2023
@michaelosthege michaelosthege changed the title Fix mypy and jax installation steps in CI pipeline Fix mypy checks and jax installation in CI pipeline Oct 10, 2023
@michaelosthege
Copy link
Member Author

This damn jax stuff 🤐

Going to give it its own environment yml now

@michaelosthege michaelosthege force-pushed the fix-mypy branch 2 times, most recently from 5aeda21 to 4728269 Compare October 10, 2023 22:05
@michaelosthege michaelosthege marked this pull request as ready for review October 10, 2023 22:09
ricardoV94
ricardoV94 approved these changes Oct 11, 2023
@ricardoV94
Copy link
Member

This damn jax stuff 🤐

Going to give it its own environment yml now

Great, one more :D

@ricardoV94 ricardoV94 added the bug label Oct 11, 2023
@ricardoV94 ricardoV94 merged commit df7b267 into pymc-devs:main Oct 11, 2023
@ricardoV94
Copy link
Member

Thanks @michaelosthege!

@ricardoV94 ricardoV94 added the no releasenotes Skipped in automatic release notes generation label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Github CI/CD jax no releasenotes Skipped in automatic release notes generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jax sampling type-hints incompatible with Python 3.9 run_mypy script failing (due to new Pandas behavior?)
2 participants