-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: kw onlyh args and overloads for `calculate_implied_probabil…
…ities` Makes all arguments other than `odds` kw only, this drastically reduces the number of required overloads to type the signature properly. ```py # still works calculate_implied_probabilities([2.0, 2.0]) calculate_implied_probabilities(odds=[2.0, 2.0]) calculate_implied_probabilities([2.0, 2.0], full_output=True) ## also any other combination of passing arguments as keyword args remains the same # patterns of passing any arg other than `odds` as positional breaks calculate_implied_probabilibies([2.0, 2.0], 1000) calculate_impolied_probabilities([2.0, 2.0], 1000, 1e-12, True) ``` This encourages clarity at the callsite and also helps from a library perspective as it is easier to add new kw only args to an api without breaking downstream. Adds overloads and tests for combination of input types and value of `full_output` flag.
- Loading branch information
1 parent
2d588fe
commit 06a4ce9
Showing
2 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters