vector
vector copied to clipboard
FIX: got rid of type: ignore[unreachable] comments #221
Description
Fixes #221 To fix this, we can use a TypeVar to bound the input cls to VectorProtocol. This avoids the inconsistent inheritance issue. We also don't need the unreachable ignores anymore since the code now typechecks correctly.
Checklist
- [x] Have you followed the guidelines in our Contributing document?
- [x] Have you checked to ensure there aren't any other open Pull Requests for the required change?
- [x] Does your submission pass pre-commit? (
$ pre-commit run --all-files
or$ nox -s lint
) - [ ] Does your submission pass tests? (
$ pytest
or$ nox -s tests
) - [ ] Does the documentation build with your changes? (
$ cd docs; make clean; make html
or$ nox -s docs
) - [x] Does your submission pass the doctests? (
$ xdoctest ./src/vector
or$ nox -s doctests
)
Before Merging
- [x] Summarize the commit messages into a brief review of the Pull request.
Codecov Report
All modified lines are covered by tests :white_check_mark:
Comparison is base (
254e5c9
) 83.21% compared to head (f6f3c75
) 83.21%.
Additional details and impacted files
@@ Coverage Diff @@
## main #394 +/- ##
=======================================
Coverage 83.21% 83.21%
=======================================
Files 96 96
Lines 11429 11430 +1
=======================================
+ Hits 9511 9512 +1
Misses 1918 1918
Files | Coverage Δ | |
---|---|---|
src/vector/backends/awkward.py | 83.88% <100.00%> (+0.02%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for taking this up, @Saswatsusmoy! Could you please add
warn_unreachable = true
under the[tool.mypy]
section inpyproject.toml
to check if this works?
No, it isn't working 16 errors have popped up
src\vector_methods.py:3949: error: Statement is unreachable [unreachable] src\vector_methods.py:4161: error: Statement is unreachable [unreachable] src\vector\backends\object.py:430: error: Statement is unreachable [unreachable] src\vector\backends\object.py:527: error: Statement is unreachable [unreachable] src\vector\backends\object.py:539: error: Statement is unreachable [unreachable] src\vector\backends\object.py:551: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:86: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:88: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:91: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:105: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:108: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:817: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:928: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:940: error: Statement is unreachable [unreachable] src\vector\backends\numpy.py:952: error: Statement is unreachable [unreachable] src\vector\backends\awkward.py:584: error: Statement is unreachable [unreachable] Found 16 errors in 4 files (checked 98 source files)
Can you please help me with this?