-
Notifications
You must be signed in to change notification settings - Fork 76
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
Keep float as float32 when outputting them #708
Conversation
@@ -116,6 +116,8 @@ def calculate(): | |||
|
|||
if variable.value_type == Enum: | |||
entity_result = result.decode()[entity_index].name | |||
elif variable.value_type == float: | |||
entity_result = float(str(result[entity_index])) # To turn the float32 into a regular float without adding confusing extra decimals. There must be a better way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we didn't find a better way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not for now, all the solutions I found involved stringinfying in some way.
CHANGELOG.md
Outdated
@@ -1,5 +1,10 @@ | |||
# Changelog | |||
|
|||
### 23.3.2 [#708](https://github.com/openfisca/openfisca-core/pull/708) | |||
|
|||
- Addresses the typecasting from `float32` to `float64` made when outputing numbers in the API and in `openfisca-run-test`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first and most obvious thing reading the Changelog should be the impact and users (your second point), before the technicality of how we fixed the issues (your first point).
I'd also add a small example of what changed, (maybe a short extract of a JSON?) to help illustrate what has changed 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GTM (I slightly edited the Changelog)
(Sorry, I should probably have let you the opportunity to review my editions, I was a little too enthusiastic to merge) |
Fixes #699
Technical changes
openfisca-run-test
fromfloat32
tofloat64
.