-
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
Intégration des nouvelles règles de l'intéressement - Allocation de Solidarité Spécifique #986
Conversation
dd14e6b
to
e1b8dee
Compare
96ee9ec
to
44c78a5
Compare
nb_mois_cumul = 0 | ||
nb_mois_consecutif_sans_activite = 0 | ||
|
||
for period_a_tester in periods_a_inclure: |
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.
- Définir
periods_a_inclure
avec unrange(-12, 0 + 1 )
- Extraire le contenu de la boucle dans une sous-fonction ou une variable, pour éviter la boucle impérative qui est relativement difficile à lire. À la fin,
nb_mois_cumul = sum(mois_cumul(period) for period in periods_a_inclure)
ou
nb_mois_cumul = sum(individu('mois_cumul_xxx', period) for period in periods_a_inclure)
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.
Merci @fpagnoux @guillett
Malheureusement, avec ce type de découpage, je ne parviens pas à voir comment je peux conserver nb_mois_consecutif_sans_activite
entre deux appels.
Ce décompte est mis à jour dans la boucle comme ceci :
nb_mois_consecutif_sans_activite = where(absence_ressources_activite * chomeur, nb_mois_consecutif_sans_activite + 1, 0)
Or, ce décompte est capital car, comme noté en commentaire dans la formule :
# reinitialisation du nombre de mois de cumul après 3 mois consécutif sans activité
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.
@frtomas peux-tu utiliser un range
pour les périodes. La boucle est le mieux qu'on puisse faire pour le moment. On la merde dès que possible.
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.
@guillet j'ai fait la modif pour utiliser un range au lieu d'une liste de periode
012e87a
to
f7ef3bf
Compare
|
||
def formula_2017_09_01(individu, period): | ||
# liste des decalage de périodes à contrôler plus la période en cours | ||
liste_decalage = range(-12, 0 + 1) |
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.
douze_mois_precedents = [period.offset(offset) for offset in range(-12, 0 + 1)]
me parait plus clair et évite de multiples period.offset(decalage)
.
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.
C'est rectifié
f7ef3bf
to
855889f
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.
LGTM, je me suis permis de faire des modifications cosmétiques pour éviter des allers-retours à faible valeur ajoutée.
prestations/minima_sociaux/ass
ass_eligibilite_cumul_individu
qui permet de déterminer le droit à ce cumulCes changements :