-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Improve some type hints to bump mypy pin #6294
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
Merged
michaelosthege
merged 17 commits into
pymc-devs:main
from
maresb:improve-mypy-latest-version
Nov 14, 2022
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b106c79
Add a few missing type imports
maresb 8fbc8af
Trade assert with assignment to keep mypy happy
maresb a096474
Add a few type annotations
maresb 15e9a43
Add missing return type for __call__
maresb ab61f5c
Switch comment type declaration to raw
maresb fde6919
Get operators.py to pass
maresb 77130eb
Fix pymc.backends.report
maresb e396635
Fix a bunch of typing issues
maresb 165b4ca
Unpin mypy
maresb 363b4c8
Import __future__.annotations to fix "| None"
maresb 814acc5
Update pymc/step_methods/hmc/integration.py
maresb 99346dd
Add __future__.annotations to hmc.py
maresb bd939e0
Remove unused Any import
maresb 8b127a6
Don't cast float to np.array
maresb 9becee3
Replace 0 with 0.0 for float zeros
maresb 2582846
Update pymc/step_methods/hmc/nuts.py
maresb dc3abb2
Repin mypy with v0.990
maresb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,5 +38,5 @@ dependencies: | |
| - watermark | ||
| - polyagamma | ||
| - sphinx-remove-toctrees | ||
| - mypy=0.982 | ||
| - mypy=0.990 | ||
| - types-cachetools | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,5 +27,5 @@ dependencies: | |
| - pre-commit>=2.8.0 | ||
| - pytest-cov>=2.5 | ||
| - pytest>=3.0 | ||
| - mypy=0.982 | ||
| - mypy=0.990 | ||
| - types-cachetools | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,5 +35,5 @@ dependencies: | |
| - sphinx>=1.5 | ||
| - watermark | ||
| - sphinx-remove-toctrees | ||
| - mypy=0.982 | ||
| - mypy=0.990 | ||
| - types-cachetools | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,5 +28,5 @@ dependencies: | |
| - pre-commit>=2.8.0 | ||
| - pytest-cov>=2.5 | ||
| - pytest>=3.0 | ||
| - mypy=0.982 | ||
| - mypy=0.990 | ||
| - types-cachetools | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Shouldn't
outget a real type here? BecauseNoneis not a type..Uh oh!
There was an error while loading. Please reload this page.
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.
You're technically correct. Although the singleton
Nonehas typeNoneType, I believe that type checkers automatically do an implicit conversion here. (Who really wants to remember to type the extra letters and be so pedantic? There's no potential for ambiguity since it's a singleton type.)If you check the mypy docs, they always use
None, so it's not a problem.