Skip to content

GP Covariance Function Type Hints #6740

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
merged 16 commits into from
Jul 19, 2023

Conversation

jahall
Copy link
Contributor

@jahall jahall commented May 29, 2023

Adding type-hints to cov.py. Also moving Periodic to appear below the other stationary kernels.

New features

  • Type hints in cov.py

📚 Documentation preview 📚: https://pymc--6740.org.readthedocs.build/en/6740/

@jahall jahall marked this pull request as ready for review May 29, 2023 10:11
@jahall jahall requested a review from bwengals June 5, 2023 11:45
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Merging #6740 (c5c48cc) into main (146afc5) will decrease coverage by 0.47%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6740      +/-   ##
==========================================
- Coverage   91.93%   91.46%   -0.47%     
==========================================
  Files          95       95              
  Lines       16225    16238      +13     
==========================================
- Hits        14916    14852      -64     
- Misses       1309     1386      +77     
Impacted Files Coverage Δ
pymc/gp/cov.py 97.91% <100.00%> (+0.06%) ⬆️

... and 4 files with indirect coverage changes

@bwengals
Copy link
Contributor

Hey @jahall sorry for the delay! I (finally) enabled the test suite for you. Looks like test_handleargs needs a small update to reflect your change, and there are a couple mypy issues. There's a script in the repo to run the same mypy checks locally that the test runner does, python scripts/run_mypy.py --verbose. By the way, thanks for your contributions here and for the new periodic kernel. Looking forward to using it!

@jahall
Copy link
Contributor Author

jahall commented Jun 14, 2023

@bwengals No problem! That should be mypy/tests fixed now. I'll wait till we merge this PR then will update the WrappedPeriodic PR to reflect these changes.

@jahall
Copy link
Contributor Author

jahall commented Jun 15, 2023

@bwengals ...bit confused on the test failures ...

@ricardoV94
Copy link
Member

They showed up in another PR, I think it's unrelated, probably something that changed with the latest PyTensor release

@ricardoV94
Copy link
Member

Should be fixed by #6782

@jahall
Copy link
Contributor Author

jahall commented Jun 21, 2023

@bwengals @ricardoV94 Still seeing spurious test failure :(

@jahall
Copy link
Contributor Author

jahall commented Jun 29, 2023

@bwengals @ricardoV94 Should be good to go now after merging latest main.

@jahall
Copy link
Contributor Author

jahall commented Jul 6, 2023

@bwengals @ricardoV94 Thoughts?

Copy link
Contributor

@bwengals bwengals left a comment

Choose a reason for hiding this comment

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

thank you @jahall !

Comment on lines +144 to 148
@staticmethod
def _alloc(X, *shape: int) -> TensorVariable:
return pt.alloc(X, *shape) # type: ignore


Copy link
Contributor

Choose a reason for hiding this comment

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

Is this factored out for mypys sake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, this was for mypys sake...I think because pt.alloc can technically return things other than TensorVariable...

Copy link
Member

Choose a reason for hiding this comment

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

It cannot, but mypy doesn't understand that. If you would like ta take a look at the PyTensor level to see if it can be fixed that would be great!

Copy link
Contributor Author

@jahall jahall Jul 19, 2023

Choose a reason for hiding this comment

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

Sure - let me take a look

@jahall
Copy link
Contributor Author

jahall commented Jul 19, 2023

@ricardoV94 Can we merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants