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

feat: Add type hints for tensor manager #1963

Merged
merged 7 commits into from
Sep 7, 2022

Conversation

kratsg
Copy link
Contributor

@kratsg kratsg commented Aug 26, 2022

Pull Request Description

See #1284.

This PR adds typing for src/pyhf/tensor/manager.py (and also adds some typing for the src/pyhf/events.py to make sure the decorators used are forwarding their signatures).

Additionally provides some minor fix on top of #1940 to get the NumPy backend more properly typed according to the expanded (stricter) TensorBackend Protocol.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* 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.

@kratsg kratsg added docs Documentation related feat/enhancement New feature or request type checking Related to types and type checking labels Aug 26, 2022
@kratsg kratsg self-assigned this Aug 26, 2022
@kratsg kratsg temporarily deployed to github-pages August 26, 2022 22:50 Inactive
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Base: 98.26% // Head: 98.26% // No change to project coverage 👍

Coverage data is based on head (b12c9dd) compared to base (b12c9dd).
Patch has no changes to coverable lines.

❗ Current head b12c9dd differs from pull request most recent head fafe35f. Consider uploading reports for the commit fafe35f to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1963   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files          68       68           
  Lines        4430     4430           
  Branches      728      728           
=======================================
  Hits         4353     4353           
  Misses         45       45           
  Partials       32       32           
Flag Coverage Δ
contrib 27.04% <0.00%> (ø)
doctest 60.88% <0.00%> (ø)
unittests-3.10 96.18% <0.00%> (ø)
unittests-3.7 96.16% <0.00%> (ø)
unittests-3.8 96.20% <0.00%> (ø)
unittests-3.9 96.23% <0.00%> (ø)

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.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matthewfeickert matthewfeickert temporarily deployed to github-pages August 27, 2022 02:45 Inactive
@kratsg kratsg requested review from matthewfeickert and removed request for matthewfeickert August 28, 2022 23:56
@kratsg
Copy link
Contributor Author

kratsg commented Aug 29, 2022

@matthewfeickert matthewfeickert changed the title feat: Type hints for tensor/manager.py feat: Add type hints for tensor manager Sep 7, 2022
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍 Thanks @kratsg!

@matthewfeickert matthewfeickert merged commit cbd68c8 into master Sep 7, 2022
@matthewfeickert matthewfeickert deleted the feat/typeTensorManager branch September 7, 2022 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related feat/enhancement New feature or request type checking Related to types and type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants