-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 0.2.0 #10
Merged
Merged
Release 0.2.0 #10
Conversation
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 change declares the type of `p` to accept either the list of mapping return type.
Means we don't lose the information about whether the param `odds` is a mapping or other collection, and therefore we don't need to early capture `keys`. Also, `_class` was unused, so removed, however we probably can support returning the same type of mapping as the user inputs.
This allows us to use the nicer union syntax, `A | B`.
Sequences have specific order, important as the output list is ordered the same as the input sequence.
…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.
Allows the key type of returned dict to match the input key type. Previously, and input of `{"home": 2.0, "away": 2.0}` would return type `dict[Any, float]`. This change allows that to return `dict[str, float]`.
Instead of returning a dict that loses the type of the implied probabilities, we can return an object that is generic on the implied probability return type. This means that as far as mypy is concerned, the following two are equivalent: ```py calculate_implied_probabilities([2.0, 2.0]) calculate_implied_probabilities([2.0, 2.0], full_output=True).implied_probabilities ```
Configures mypy to run on tests as well as library code. Refactors tests to deal with type errors caused by reused variable names inside the mono-test.
Bumps [black](https://github.com/psf/black) from 23.10.1 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@23.10.1...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.