Open thomasaarholt opened 7 months ago
Thanks for the contribution @thomasaarholt! I'll let you know what I think once I can review. For now, let's run the CI :)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.17%. Comparing base (
714ccb7
) to head (3afbc00
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Great! No rush at all, just had some downtime in my Easter break and thought it would be a nice little contribution.
Hello!
I have used pymc extensively over the last two years, and have finally had a play with bambi. I really like it - it has some really nice defaults, and the formula syntax is great!
I noticed that some type hinting was missing on the most commonly used Model methods, so I decided to add that. I initially just wanted to add some overload methods to
Model.fit
, so that it would clearly be returning anInferenceData
object when called with the appropriateinference_method
s. Then I got a bit carried away, since it wasn't very difficult to add the remaining commonly used methods. I've previously added type hinting to some of the functions in pymc.I am using pyright to check the types. This is what is used in VSCode for type checking, docstrings and autocompletion. This PR does not change any behaviour or logic, only adds type hinting that make IDEs better at understanding the code.
Here is a screenshot of my editor from before the changes are made:
And here they are after:
Here is the run.py file in a gist.