-
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
Internationalize scenarios #444
Conversation
a96a003
to
ed5fd6a
Compare
85ceb89
to
2d14927
Compare
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.
Je ne suis pas sûr de tout maîtriser, mais avançons !
2d14927
to
131dd42
Compare
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.
Small issue with naming
openfisca_core/json_to_test.py
Outdated
@@ -0,0 +1,150 @@ | |||
# -*- coding: utf-8 -*- |
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.
If I understand correctly, you chose to extract biryani converters to a dedicated module, which is a good choice! This lightens the code of the Core.
But I'm not 100% satisfied with the name json_to_test.py
. test
makes me think about a unit test, here it is a test case.
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.
👍
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.
You're right, this was confusing.
I indeed chose to separate some logic specific to turning a JSON object into a test case in a separated flag to clear the scenario
code.
This is renamed, tell me if it's ok for you.
012cf3f
to
b84ef8a
Compare
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 tested this PR on my machine and it's OK.
There is still some dept as @fpagnoux said, but it's way better!
@cbenz : did you try it on openfisca-senegal ? openfisca-tunisia ? |
by moving and adapting code from france
b84ef8a
to
e28e59e
Compare
I tried in with |
It works with |
Connected to openfisca/openfisca-web-api#76
A lot of the logic to build an openfisca
scenario
from ajson
is duplicated in all countries.This is mainly used to serve the tax and benefits system with
web-api
, but it has other applications.Inside this duplicated code, we can find... a lot of duplication, as the entities are usually hardcoded, and similar logic is repeated for
Familles
,FoyerFiscal
...This PR generalise a big chunk of the code, and moves it from
france
tocore
.To be honest, yes, this is still ugly and full of debt. The
scenarios
need a huge refactoring, which would probably be done the best by throwing everything away.However, we have no visibility about when this refactoring will come, and having a turnkey working api will be useful for
tunisia
.