pymc
pymc copied to clipboard
Add type hints to dist() for discrete distributions
What is this PR about? Add type hints to the dist() class methods in the discrete distributions. Issue https://github.com/pymc-devs/pymc/issues/5358
Discussion points:
- I am not sure if the type hints are correct for the
cutpointsparameter in OrderedProbit and OrderedLogistic - I believe that the type hints should also include list[Union[int, float]] (or list[int], in the cases where ints are expected), but that would require changing the implementation of typing for the continuous distributions as well, so I can do that in a separate PR if it should be done.
Checklist
- [x] Explain important implementation details 👆
- [x] Make sure that the pre-commit linting/style checks pass.
- [x] Link relevant issues (preferably in nice commit messages)
- [x] Are the changes covered by tests and docstrings?
- [x] Fill out the short summary sections 👇
Major / Breaking Changes
N/A
New features
N/A
Bugfixes
N/A
Documentation
N/A
Maintenance
N/A
:books: Documentation preview :books:: https://pymc--6937.org.readthedocs.build/en/6937/
:sparkling_heart: Thanks for opening this pull request! :sparkling_heart: The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.02%. Comparing base (
46f1675) to head (2c01984).
:exclamation: Current head 2c01984 differs from pull request most recent head 6f6b416. Consider uploading reports for the commit 6f6b416 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #6937 +/- ##
==========================================
- Coverage 89.60% 89.02% -0.59%
==========================================
Files 100 100
Lines 16888 16855 -33
==========================================
- Hits 15133 15005 -128
- Misses 1755 1850 +95
| Files | Coverage Δ | |
|---|---|---|
| pymc/distributions/discrete.py | 99.12% <100.00%> (+30.28%) |
:arrow_up: |
I originally made some comments on this PR, which I then turned into a feature request that I am willing to work on, over at #7122.