-
Notifications
You must be signed in to change notification settings - Fork 102
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 stack
type hints
#205
Merged
Merged
Fix stack
type hints
#205
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=======================================
Coverage 80.06% 80.06%
=======================================
Files 170 170
Lines 45185 45185
Branches 9608 9608
=======================================
+ Hits 36176 36178 +2
+ Misses 6794 6793 -1
+ Partials 2215 2214 -1
|
michaelosthege
approved these changes
Feb 5, 2023
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, @covertg this is looking good.
When upgrading PyMC to the next PyTensor release we can then revert part of pymc-devs/pymc@e062237
michaelosthege
changed the title
Type updates for stack (addresses #193)
Fix Feb 5, 2023
pt.stack
type hints
michaelosthege
added a commit
to ricardoV94/pymc
that referenced
this pull request
Feb 18, 2023
Was fixed in pymc-devs/pytensor#205
ricardoV94
pushed a commit
to ricardoV94/pymc
that referenced
this pull request
Feb 21, 2023
Was fixed in pymc-devs/pytensor#205
ricardoV94
pushed a commit
to ricardoV94/pymc
that referenced
this pull request
Feb 21, 2023
Was fixed in pymc-devs/pytensor#205
ricardoV94
pushed a commit
to ricardoV94/pymc
that referenced
this pull request
Feb 27, 2023
Was fixed in pymc-devs/pytensor#205
ricardoV94
pushed a commit
to pymc-devs/pymc
that referenced
this pull request
Feb 28, 2023
Was fixed in pymc-devs/pytensor#205
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Seeking to address #193, making type hints for
pt.stack
more accurate.Implementation details
I chose to type hint as TensorLike, defined here as Variable | Sequence[Variable] | npt.ArrayLike. I hope this will address all cases that mypy was complaining about. I also updated the docs and errors accordingly.
Lastly, because there was a case that coerces a list of zero-dim Variables into MakeVector, I also allowed a parallel case of zero-dim numpy arrays to use MakeVector rather than Join and updated a test to cover this case.
Checklist
isort 5.11.5
due to a bug with pre-commit initialization (error with poetry)Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance
Please let me know if you have any feedback!