-
Notifications
You must be signed in to change notification settings - Fork 101
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
Make sure an AAH eligible individual is NOT ASS eligible #784
Conversation
I duplicated some code in that PR. Would it be better to have something like: def formula_2017_01_01(individu, period):
aah_eligible = individu('aah_eligible', period)
return _and(formula(individu, period), _not(aah_eligible)) A test has been created in MesAides test DB, I will move it into the OpenFisca test files. |
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.
Changements cosmétiques.
Merci !
# 1 si demandeur d'emploi | ||
activite = individu('activite', period) | ||
|
||
# Indique que l'user a travaillé 5 ans au cours des 10 dernieres années. |
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.
Qui est l'user ? ;-)
# Indique que l'user a travaillé 5 ans au cours des 10 dernieres années. | ||
ass_precondition_remplie = individu('ass_precondition_remplie', period) | ||
|
||
are_perceived_this_month = individu('chomage_net', period) |
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.
Utiliser des noms de variables français quand il s'agit de coder la législation
@benjello que penses-tu de l'approche suggérée dans mon commentaire ? Je n'aime pas trop l'idée d'avoir autant de code dupliqué. Merci. |
La solution proposée est pire que le problème soulevé selon moi. Si tu veux éviter de dupliquer du code, il vaut mieux écrire une helper function qui évite cette duplication tout en laissant le code lisible. |
|
||
return and_(and_(and_(not_(aah_eligible), activite == 1), ass_precondition_remplie), are_perceived_this_month == 0) | ||
return and_(not_(aah_eligible), and_(and_(activite == 1), ass_precondition_remplie), chomage_percu_ce_mois == 0) |
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.
Il me semble qu'il y a un problème de parenthèses.
Et je définirais la variable
demandeur_emploi_non_indemnise = and_(individu('activite', period) == 1, individu('chomage_net', period) == 0)
pour réutilisation afin d'être plus clair tout en limitant l'empreinte mémoire
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.
@benjello, merci beaucoup pour tes commentaires.
Désolé pour le bruit, je ne m'attendais pas à ta revue n'ayant pas à nouveau request review.
J'ai tendance à push beaucoup sur GH pour éviter de n'avoir qu'une version en local.
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.
@guillett: à ton service !
@benjello |
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.
Minor change and ok
def formula_2017_01_01(individu, period): | ||
aah_eligible = individu('aah_eligible', period) | ||
|
||
# 1 si demandeur d'emploi |
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.
Commentaire inutile
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.
Tu trouves vraiment que c'est inutile ?
Honnêtement individu('activite', period) == 1
se trouve clarifier avec ce commentaire selon moi.
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.
Alors être complètement explicite activite = 1 pour un demandeur d'emploi
CHANGELOG.md
Outdated
|
||
* Évolution du système socio-fiscal. | ||
* Périodes concernées : à partir du 01/01/2017 | ||
* Zones impactées : ` openfisca_france/model/prestations/minima_sociaux/ass.py`. |
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.
/prestations/minima_sociaux/ass
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 normalized format doesn't include the .py
extension, nor the openfisca_france/model
prefix
|
||
return and_(and_(activite == 1, ass_precondition_remplie), are_perceived_this_month == 0) | ||
def formula_2017_01_01(individu, period): | ||
aah_eligible = individu('aah_eligible', period) |
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.
Pourquoi aah_eligible
plutôt que aah
tout court ?
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.
Si je suis en situation de handicap avec un taux d'incapacité de 50%, mais que les médecins de la MDPH estiment que je suis malgré tout apte à travailler, aah_eligible
est vraie pour moi, mais je n'aurais pas de aah
.
Pour coller au plus près à ce qui est dans la loi (non-cumulabilité de l'AAH et de l'ASS), il faudrait à mon avis mettre aah
ici.
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.
Bien vu @fpagnoux. Prendre aah > 0.
@guillett : GTM (après résolution des conflits liés au Bump) |
openfisca_france/model/prestations/minima_sociaux/ass.py
.