-
Notifications
You must be signed in to change notification settings - Fork 97
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
Simplify boilerplate #697
Simplify boilerplate #697
Conversation
833dd96
to
4c1be16
Compare
CHANGELOG.md
Outdated
### 14.1.1 - [#697](https://github.com/openfisca/openfisca-france/pull/697) | ||
|
||
* Amélioration technique | ||
* Utilise le module `core.formulas_toolbox` plutôt que de réimporter un par un tous les objets python nécessaire pour écrire une formule |
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.
Rename to model_api
openfisca_france/model/base.py
Outdated
from openfisca_core.formula_helpers import apply_thresholds, switch | ||
from openfisca_core.periods import MONTH, YEAR, ETERNITY | ||
|
||
from openfisca_core.formula_toolbox import * |
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.
We can replace the import *
by __all__.extend(openfisca_core.module_api.__all__)
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.
But at the same time it's much less clear 🤔
openfisca_france/model/base.py
Outdated
from openfisca_core.formula_helpers import apply_thresholds, switch | ||
from openfisca_core.periods import MONTH, YEAR, ETERNITY | ||
|
||
from openfisca_core.module_api import * |
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.
Did you rename model_api
to module_api
willingly?
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 :(
Good catch !
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.
Désolé !
CHANGELOG.md
Outdated
### 14.1.1 - [#697](https://github.com/openfisca/openfisca-france/pull/697) | ||
|
||
* Amélioration technique | ||
* Utilise le module `core.model_api` plutôt que de réimporter un par un tous les objets python nécessaire pour écrire une formule |
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.
Typos :
- python -> Python
- nécessaire -> nécessaires
5 fixups pour 2 commits, donc un de changelog. Ne plus ouvrir de PR le soir avant de partir ;) |
ce86e09
to
1a40477
Compare
Apply openfisca/openfisca-core#467 to
france
.