Skip to content
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

Al primo accession #801

Merged
merged 11 commits into from
Aug 11, 2017
Merged

Al primo accession #801

merged 11 commits into from
Aug 11, 2017

Conversation

dgombert
Copy link

@dgombert dgombert commented Aug 11, 2017

Implémentation du calcul des aides au logement primo accédant.

  • Évolution du système socio-fiscal.
  • Périodes concernées : toutes.
  • Zones impactées : /prestations/aides_logement.py.
  • Détails :
    • Calcul des aides au logement pour les primo-accédants.
    • Marge d'erreur (~5% sur les tests) voir avec un expert métier pour rectifier le calcul.

Ces changements (effacez les lignes ne correspondant pas à votre cas) :

  • Ajoutent une fonctionnalité (par exemple ajout d'une variable).
  • Corrigent ou améliorent un calcul déjà existant.

GOMBERT Damien added 5 commits August 10, 2017 16:56
- Ajout du calcul de ressources plafonné
- Mise à jour des tests avec fiabilité à 5% (voir avec un expert métier pour améliorer la fiabilité)
Copy link
Member

@benjello benjello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il serait utile de rajouter les variables intermédiaires ici créées dans cette blacklist qui a pour but de limiter le nombre de variables conservées en cache.

Copy link
Member

@fpagnoux fpagnoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 🎉!

Il manque juste:

  • les références législatives
  • si possible quelques tests (seulement 3 pour le moment)
  • quelques corrections mineures

class aides_logement_primo_accedant(Variable):
column = FloatCol
entity = Famille
label = u"Allocation logement primo accedant"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque un accent : primo-accédant :)

majoration_loyer = prestations.al_param.majoration_du_loyer_minimum_lo
N = famille('aides_logement_primo_accedant_nb_part', period)

return ((bareme.calc(baseRessource / N) * N) + majoration_loyer) / 12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certaines parenthèses ne sont pas nécessaires:

(bareme.calc(baseRessource / N) * N + majoration_loyer) / 12

devrait revenir au même

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De même: si possible, indiquer une source législative.

z1.personne_isolee_sans_enfant * not_(couple) * (al_nb_pac == 0) +
z1.menage_seul * couple * (al_nb_pac == 0) +
z1.menage_ou_isole_avec_1_enfant * (al_nb_pac == 1) +
z1.menage_ou_isole_avec_2_enfants* (al_nb_pac == 2) +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque un espace avant le *

z1.menage_ou_isole_avec_2_enfants * (al_nb_pac == 2) +

loyer = famille.demandeur.menage('loyer', period)
coef_plancher_ressources = legislation(period).prestations.aides_logement.ressources.dar_3
return max_(baseRessource, loyer * coef_plancher_ressources)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque une ligne vide en fin de fichier.

<VALUE deb="2007-07-01" valeur="0.328"/>
</TAUX>
</TRANCHE>
</BAREME>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

loyer: 500
depcom: 82121
output_variables:
aides_logement_primo_accedant: 95
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque un saut de ligne à la fin du fichier.

2017-02: 1
2017-03: 1
output_variables:
aide_logement: 154
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il manque un saut de ligne à la fin du fichier.

K = famille('aides_logement_primo_accedant_k', period)
Lo = famille('aides_logement_primo_accedant_loyer_minimal', period)

return K * ( L + C - Lo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existe-il un article de loi qui définit cette formule ?
Si oui, on peut le mettre dans l'attribut référence de la variable.

label = u"Allocation logement primo accedant"
reference = "http://legifrance.gouv.fr/affichCodeArticle.doidArticle=LEGIARTI000032852785&cidTexte=LEGITEXT000006073189&dateTexte=20170803"

R = famille('aides_logement_primo_accedant_ressources', period)
N = famille('aides_logement_primo_accedant_nb_part', period)

return coef_k - ( R / (multi_n * N))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De même: si possible, indiquer une source législative.

baseRessource = famille('aide_logement_base_ressources', period)
loyer = famille.demandeur.menage('loyer', period)
coef_plancher_ressources = legislation(period).prestations.aides_logement.ressources.dar_3
return max_(baseRessource, loyer * coef_plancher_ressources)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De même: si possible, indiquer une source législative.

@fpagnoux
Copy link
Member

Il serait utile de rajouter les variables intermédiaires ici créées dans cette blacklist qui a pour but de limiter le nombre de variables conservées en cache.

Je m'en occupe :)

Copy link
Member

@fpagnoux fpagnoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presque

column = FloatCol
entity = Famille
label = u"Allocation logement pour les primo-accédants plafond mensualité"
reference = u"https://www.legifrance.gouv.fr/affichCodeArticle.do;jsessionid=41AE9B6BDDC571E9CB28A605FDA0F639.tpdila22v_1?idArticle=LEGIARTI000006737216&cidTexte=LEGITEXT000006073189&dateTexte=20170811&categorieLien=id&oldAction=&nbResultRech="
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je crois que pour les accédants c'est plutôt celui-là

@fpagnoux fpagnoux force-pushed the al_primo_accession branch from 37ac5e5 to 7f1f001 Compare August 11, 2017 14:49
@fpagnoux
Copy link
Member

Prêt à merger 🚀 !

@fpagnoux fpagnoux merged commit 8598eb5 into openfisca:master Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants