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

Ajoute le logement social #1008

Merged
merged 6 commits into from
Jul 3, 2018
Merged

Ajoute le logement social #1008

merged 6 commits into from
Jul 3, 2018

Conversation

alexsegura
Copy link
Contributor

@alexsegura alexsegura commented Jun 6, 2018

  • Évolution du système socio-fiscal.
  • Périodes concernées : à partir du 22/12/2016.
  • Zones impactées : prestations/logement_social.
  • Détails :

Nécessaire pour betagouv/aides-jeunes#431


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

  • Ajoutent une fonctionnalité (par exemple ajout d'une variable).

@alexsegura alexsegura requested a review from guillett June 6, 2018 12:48
@alexsegura
Copy link
Contributor Author

Un peu d'indulgence svp 👶 🐥

J'ai commencé par ajouter les variables :

  • zone_logement_social
  • logement_social_categorie_menage

Étant donné qu'on a juste besoin de connaître l'éligibilité, je ne vais peut-être pas ajouter le calcul de tous les plafonds.

Copy link
Member

@guillett guillett left a comment

Choose a reason for hiding this comment

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

@alexsegura, j'ai commencé une revue. Je te laisse faire une passe et on en rediscute après.

# Gentilly, Issy-les-Moulineaux, Ivry-sur-Seine, Joinville-le-Pont, le Kremlin-Bicêtre, Les Lilas, Le Pré-Saint-Gervais,
# Levallois-Perret, Malakoff, Montreuil, Montrouge, Neuilly-sur-Seine, Nogent-sur-Marne, Pantin, Puteaux, Saint-Cloud,
# Saint-Denis, Saint-Mandé, Saint-Maurice, Saint-Ouen, Suresnes, Vanves, Vincennes
paris_communes_limitrophes = [
Copy link
Member

Choose a reason for hiding this comment

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

Ca serait top que les code INSEE soient mis en ligne avec la commune correspondante. Genre :

    '75100', # Paris
    '93001', # Aubervilliers

# Levallois-Perret, Malakoff, Montreuil, Montrouge, Neuilly-sur-Seine, Nogent-sur-Marne, Pantin, Puteaux, Saint-Cloud,
# Saint-Denis, Saint-Mandé, Saint-Maurice, Saint-Ouen, Suresnes, Vanves, Vincennes
paris_communes_limitrophes = [
'75100',
Copy link
Member

Choose a reason for hiding this comment

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

Le code INSEE de Paris est 75056 (https://geo.api.gouv.fr/communes?nom=Paris).

CategorieMenageLogementSocial.categorie_5,
CategorieMenageLogementSocial.categorie_6,
],
default = CategorieMenageLogementSocial.categorie_1
Copy link
Member

Choose a reason for hiding this comment

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

Comment sont gérées les familles avec 15 personnes à charge ? 🙂

values:
2016-12-22:
reference: https://www.legifrance.gouv.fr/affichTexte.do;jsessionid=186AC8F0B7590C42DAA390BA6C89612B.tpdila11v_1?cidTexte=JORFTEXT000033681769&dateTexte=&oldAction=rechJO&categorieLien=id&idJO=JORFCONT000033680662
value: 11067
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 des sauts de ligne dans les fichiers de paramètres.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ne devrait-on pas mettre un .editorconfig pour le projet ?

@alexsegura
Copy link
Contributor Author

@guillett tu peux jeter un coup d'oeil à nouveau ? C'est mieux là.


# Extraction du département
# Exemple : 75056 → 75
departement = (depcom.astype(int) / 1000).astype(int)
Copy link
Member

Choose a reason for hiding this comment

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

@benjello do you have better implementation ?

Copy link
Member

Choose a reason for hiding this comment

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

On peut diviser par 1000 et utiliser round aussi.
Mais au-delà de la formule qui finalement importe peu, on peut utiliser une petite fonction helper explicite genre departement_from_depcom mais en français.
C'est plus clair mais cela rajoute de la complexité avec un helper ce qui peut aussi compliquer les liens sur le web.
Je n'ai pas d'avis tranché

# est au plus égale à cinquante-cinq ans constitue un jeune ménage
# au sens du présent arrêté.
age = famille.members('age', period)
sum_age = famille.sum(age)
Copy link
Member

Choose a reason for hiding this comment

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

Une famille dont les deux parents ont 20 ans avec 5 enfants de 10 ans, est-elle un jeune ménage ?


return select(
[
# Six personnes, ou une personne seule avec quatre personnes à charge.
Copy link
Member

Choose a reason for hiding this comment

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

Ce select pourrait être simplifié et je trouve bizarre de commencer par la catégorie 6 plutôt que 1.

alexsegura and others added 4 commits July 2, 2018 18:07
- Ajout de la variable zone_logement_social
- Ajout de la variable logement_social_categorie_menage
- Ajout de la variable logement_social_plafond_ressources
- Ajout de la variable logement_social_eligible
guillett added 2 commits July 2, 2018 19:32
* Multiple barèmes exist a subfolder ease additions in the future
Copy link
Member

@guillett guillett left a comment

Choose a reason for hiding this comment

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

C'est bon pour moi.

@guillett guillett merged commit 40bd5fb into master Jul 3, 2018
@guillett guillett deleted the logement-social branch July 3, 2018 13:40
@bonjourmauko bonjourmauko changed the title Logement social Ajoute le logement social Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants