Add type stubs across project #37
Open
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.
Overview
Notes
I used Any in a lot of situation since the docstrings and the internal implementations weren't in conflict with this.
However with some guidance I could change this very easily. I
assumethat most of the time floats and int are expected in the stats functions for example, henceforth this could easily be changed, and would also allow a way easier conversion into a faster implementation (numba, cython, or may I say Rust)?Making the classes generics to hint the return type (int->int, float->float, int|float -> float in Sum) would be for example the natural next step.
Also I haven't run pytest, since I haven't changed any actual runtime code, only added annotations, this shouldn't have changed anything.
My test was just to run a quick script at the root to ensure that no import conflict error were created
Happy to hear feedback and contribute more, because I will use this lib in my own project https://github.com/OutSquareCapital/pychain and made some similar works here https://github.com/OutSquareCapital/rustats which could help as a base example of how to reimplement the code here in Rust