-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: Add typehints to pyhf.tensor #1940
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1940 +/- ##
==========================================
- Coverage 98.26% 98.24% -0.03%
==========================================
Files 69 68 -1
Lines 4443 4380 -63
Branches 748 728 -20
==========================================
- Hits 4366 4303 -63
Misses 45 45
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
b8a7eab
to
42edc96
Compare
a13de65
to
d7934ed
Compare
* Add .coveragerc file with configuration to ignore TYPE_CHECKING. - ref: https://coverage.readthedocs.io/en/6.4.3/excluding.html#advanced-exclusion
This adds back in #1937. |
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.
Thanks for all this great work @kratsg. This is going to help a lot to move towards typing. 🙂
As things are passing this overall does look good. 👍 I just have a few questions to help me better understand what is happening as well.
I've also made some suggestions of changes, but most of them are just trying to take advantage of the import order changing or imports being added to apply isort
here now. Feel free to ignore these of course, as they are only to try to reduce diff noise in the future.
Co-authored-by: Matthew Feickert <[email protected]>
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.
If we can get a Python version number to know when to update things, then this is all good IMO.
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.
Awesome. Thank you @kratsg! 🚀
Henry we're going to merge this, but if later you find something that you think we should revise please let us know! |
* Update lower bound of the supported tensorflow versions to v2.7.0 to ensure numpy v1.20.0+ is available. - numpy.typing is needed for PR #1940 and was added in numpy v1.20.0. - tensorflow v2.6.5 restricts numpy to 'numpy~=1.19.2' and tensorflow v2.7.0 relaxes numpy constraints to 'numpy>=1.14.5'. * Update lower bound of the supported jaxlib versions to v0.1.61. - jaxlib v0.1.60 required 'numpy>=1.12,<1.20' and jaxlib v0.1.61 relaxes this to 'numpy>=1.16'. * Update tests/constraints.txt to use tensorflow==2.7.0 and jaxlib==0.1.61.
* Add type hints to the tensor manager. * Add type hints to some of the events management code for the decorators used. * Expand the TensorBackend protocol and fix up the NumPy backend type hints to align properly. - Amends PR #1940.
Pull Request Description
See #1284.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: