pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Add type hints to dist() for discrete distributions

Open johanbog opened this issue 2 years ago • 3 comments

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 cutpoints parameter 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

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/

johanbog avatar Sep 30 '23 21:09 johanbog

Thank You Banner :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.

welcome[bot] avatar Sep 30 '23 21:09 welcome[bot]

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

Impacted file tree graph

@@            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:

... and 80 files with indirect coverage changes

codecov[bot] avatar Oct 01 '23 12:10 codecov[bot]

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.

thomasaarholt avatar Jan 30 '24 10:01 thomasaarholt