Make all zips explicitly strict or non-strict
Description
- First commit: adding a
strict=Trueargument to all zips when it doesn't produce mistakes in the test suite (464 of them), andstrict=Falseto the others (28 of them) - Second commit: enable ruff rule requiring and explicit strict argument to all zips
- Rest of the commits: transform the non-strict zips into strict zips (18 of them for now)
There remains 10 non-strict zips that I find difficult to understand.
Related Issue
- [ ] Closes #
- [x] Related to #840
Checklist
- [x] Checked that the pre-commit linting/style checks pass
- [ ] Included tests that prove the fix is effective or that the new feature works
- [ ] Added necessary documentation (docstrings and/or example notebooks)
- [x] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [ ] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [ ] Maintenance
- [ ] Other (please specify):
@Armavica may be crazy work, but can we get a separate commit where we make the non-strict zips. That way it's easier to evaluate if it sounds correct or may be a bug somewhere?
Or I guess I can just ctrl+f for it
@ricardoV94 Yes, I was planning to present this PR(s) in several steps:
- Commits that add
strict=Trueto zips without tests failing - Commits that add
strict=Trueto zips and fix their failures (bugs) - Commits that add
strict=Falseto the remaining zips that need it, or rewrite them so they can be made strict How does that sound to you?
Sounds good @Armavica
Codecov Report
Attention: Patch coverage is 91.55556% with 19 lines in your changes missing coverage. Please review.
Project coverage is 82.12%. Comparing base (
6de3151) to head (a4d7bb4). Report is 102 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #850 +/- ##
=======================================
Coverage 82.12% 82.12%
=======================================
Files 183 183
Lines 47986 47986
Branches 8644 8644
=======================================
Hits 39409 39409
Misses 6411 6411
Partials 2166 2166
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pytensor/compile/builders.py | 88.66% <100.00%> (ø) |
|
| pytensor/compile/function/pfunc.py | 82.92% <100.00%> (ø) |
|
| pytensor/compile/function/types.py | 80.48% <100.00%> (ø) |
|
| pytensor/gradient.py | 77.57% <100.00%> (ø) |
|
| pytensor/graph/basic.py | 88.69% <100.00%> (ø) |
|
| pytensor/graph/op.py | 88.08% <ø> (ø) |
|
| pytensor/graph/replace.py | 84.21% <100.00%> (ø) |
|
| pytensor/graph/rewriting/basic.py | 70.43% <100.00%> (ø) |
|
| pytensor/link/c/basic.py | 87.48% <100.00%> (ø) |
|
| pytensor/link/c/cmodule.py | 60.48% <100.00%> (ø) |
|
| ... and 59 more |
Is this ready for review? Seems like all test are passing now
Is this ready for review? Seems like all test are passing now
There are still ~~11~~ 10 instances of non-strict zips that produce errors if I make them strict, I need to investigate them one by one to see if that's expected behaviour or not.
Actually, I find it difficult to make more progress here, so I am signalling this for review.
I added 464 easy strict=True, 18 less immediate ones, and there are still 10 strict=False that I find the most difficult to understand. I think that they could be handled in another PR. This one introduces 464+18 = 482 safeguards, which I think is a good score :)
@ricardoV94 Fixed all your points, let me know if there are more
Is it ready @Armavica ?
Yes I think I changed everything you pointed out, if not it's my mistake
Thanks 🙏🙏
Thank you for your review!