-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add typing to periods #1229
Comments
This was referenced Sep 25, 2024
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
Method `periods.instant` had way too much branching and cyclomatic complexity. It has been refactored so to make use of `functools.singledispatch` to improve readability and testing. BREAKING CHANGE: `periods.instant` no longer returns `None`. Now, it raises `periods.InstantError` instead.
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
Broaden the expected argument type to be of generic type `object`, and do an explicit casting to help users know that the expected argument for that function is a string.
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
bonjourmauko
added a commit
that referenced
this issue
Sep 26, 2024
Previously, eternal periods and entities were populated with `inf` values, which are floats. This was an exception, already, as the rest of the values are integers. If you store, for example, thousands of instants in a numpy array, just one eternal instant will force the whole array to pass from integer to float. Now, eternal instants are populated with `-1`, and can be produced with `Instant.eternity()` and `Period.eternity()`. Also, they can be checked with `is_eternal`.
github-project-automation
bot
moved this from Delivery
to Answer given / Dealt with
in OpenFisca International
Sep 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Part of #1062
The text was updated successfully, but these errors were encountered: