{"action":"created","comment":{"url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/comments/47115784","id":47115784,"diff_hunk":"@@ -0,0 +1,175 @@\n+# -*- coding: utf-8 -*-\n+from __future__ import division\n+\n+from numpy import (maximum as max_, logical_not as not_, absolute as abs_, minimum as min_, select)\n+\n+from ....base import *  # noqa analysis:ignore\n+#Critères relatifs à PL (PA et PH)\n+class paris_logement(Variable):\n+\tcolumn=FloatCol\n+\tlabel=u\"Paris Logement\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tressources_familiale=simulation.calculate('paris_base_ressources',period)\n+\t\tpersonnes_couple=simulation.calculate('concub',period)\n+\t\tparis_nb_enfants= simulation.compute('paris_nb_enfants',period)\n+\t\tnb_enfants=self.sum_by_entity(paris_nb_enfants)\n+\t\tplafond=select([(nb_enfants>=1),(nb_enfants<1)],[1600,1140])\n+\t\tcondition_ressource= ressources_familiale<=plafond\n+\t\tresult=select([(nb_enfants>0),(personnes_couple),(personnes_couple!=1)],[116,95,84])\n+\t\treturn period, result*condition_ressource\n+\n+\n+class personnes_agees(Variable):\n+\tcolumn=BoolCol\n+\tlabel=u\"Personne âgée\"\n+\tentity_class=Individus\n+\n+\tdef function(self,simulation,period):\n+\t\tage = simulation.calculate('age',period)\n+\t\tcondition_age = (age>=65)\n+\t\treturn period, condition_age\n+\n+class personnes_handicap_paris(Variable):\n+\tcolumn=BoolCol\n+\tlabel=u\"Personne qui possède l'AAH\"\n+\tentity_class=Individus\n+\n+\tdef function(self,simulation,period):\n+\t\taah=simulation.calculate('aah',period)\n+\t\tcondition_aah = aah>0\n+\t\treturn period,condition_aah\n+\n+class paris_logement_elig(Variable):\n+\tcolumn=BoolCol\n+\tlabel=u\"Personne qui est eligible pour l'aide PL\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tparisien = simulation.calculate('parisien',period)\n+\t\tpersonnes_agees=simulation.compute('personnes_agees',period)\n+\t\tpersonnes_agees_famille = self.any_by_roles(personnes_agees)\n+\t\tpersonne_handicap_individu=simulation.compute('personnes_handicap_paris',period)\n+\t\tpersonne_handicap = self.any_by_roles(personne_handicap_individu)\n+\t\tpersonnes_couple=simulation.calculate('concub',period)\n+\t\tstatut_occupation = simulation.calculate('statut_occupation_famille',period)\n+\t\tstatut_occupation_elig =(\n+\t\t\t(statut_occupation==3) +\n+\t\t\t(statut_occupation==4) +\n+\t\t\t(statut_occupation==5) +\n+\t\t\t(statut_occupation==7)\n+\t\t\t)\n+\t\tcharges_logement=simulation.calculate('condition_taux_effort',period)\n+\t\tresult=parisien*statut_occupation_elig*(personnes_agees_famille+personne_handicap)*charges_logement\n+\t\treturn period, result\n+\n+class paris_nb_enfants(Variable):\n+\tcolumn=FloatCol\n+\tlabel=u\"Nombre d'enfant dans la famille\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tnb_enfants=simulation.compute('paris_enfant',period)\n+\t\tparis_nb_enfants=self.sum_by_entity(nb_enfants)\n+\t\treturn period, paris_nb_enfants\n+\n+class condition_taux_effort(Variable):\n+\tcolumn=BoolCol\n+\tlabel=u\"Charges de Logement\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tloyer=simulation.calculate('loyer',period)\n+\t\tressources_mensuelles=simulation.calculate('paris_base_ressources',period)\n+\t\tcondition_loyer=loyer>=(ressources_mensuelles*0.3)\n+\t\treturn period,condition_loyer\n+\n+\n+# Critères relatifs à PSOL (PA et PH)\n+\n+class paris_logement_psol(Variable):\n+\tcolumn=FloatCol\n+\tlabel=u\"Personne qui est eligible pour l'aide PSOL\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tparisien = simulation.calculate('parisien',period)\n+\t\tpersonnes_agees=simulation.compute('personnes_agees',period)\n+\t\tpersonnes_agees_famille = self.any_by_roles(personnes_agees)\n+\t\tpersonne_handicap_individu=simulation.compute('personnes_handicap_paris',period)\n+\t\tpersonne_handicap = self.any_by_roles(personne_handicap_individu)\n+\t\tcondition_montant_aide_psol=simulation.calculate('condition_montant_aide_psol',period)\n+\t\tresult=parisien*(personnes_agees_famille+personne_handicap)\n+\t\treturn period, result*condition_montant_aide_psol\n+\n+class condition_montant_aide_psol(Variable):\n+\tcolumn=FloatCol\n+\tlabel=u\"Montant de l'aide PSOL\"\n+\tentity_class=Familles\n+\n+\tdef function(self,simulation,period):\n+\t\tpersonnes_couple=simulation.calculate('concub',period)\n+\t\tressources_mensuelles_famille=simulation.calculate('paris_base_ressources',period)\n+\t\tplafond_psol=select([personnes_couple,(personnes_couple!=1)],[1430,900])\n+\t\tcondition_ressource= ressources_mensuelles_famille<=plafond_psol\n+\t\t#condition_aide_psql= 900-ressources_mensuelles_famille","path":"openfisca_france/model/prestations/prestations_locales/paris/paris_logement.py","position":116,"original_position":116,"commit_id":"93a0d5e5540744951c07c330c84a0f8cd01740dc","original_commit_id":"93a0d5e5540744951c07c330c84a0f8cd01740dc","user":{"login":"MattiSG","id":222463,"avatar_url":"https://avatars.githubusercontent.com/u/222463?v=3","gravatar_id":"","url":"https://api.github.com/users/MattiSG","html_url":"https://github.com/MattiSG","followers_url":"https://api.github.com/users/MattiSG/followers","following_url":"https://api.github.com/users/MattiSG/following{/other_user}","gists_url":"https://api.github.com/users/MattiSG/gists{/gist_id}","starred_url":"https://api.github.com/users/MattiSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattiSG/subscriptions","organizations_url":"https://api.github.com/users/MattiSG/orgs","repos_url":"https://api.github.com/users/MattiSG/repos","events_url":"https://api.github.com/users/MattiSG/events{/privacy}","received_events_url":"https://api.github.com/users/MattiSG/received_events","type":"User","site_admin":false},"body":"Éviter de publier du code commenté.","created_at":"2015-12-09T16:40:28Z","updated_at":"2015-12-09T16:40:28Z","html_url":"https://github.com/sgmap/openfisca-france/pull/40#discussion_r47115784","pull_request_url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/comments/47115784"},"html":{"href":"https://github.com/sgmap/openfisca-france/pull/40#discussion_r47115784"},"pull_request":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40","id":53137603,"html_url":"https://github.com/sgmap/openfisca-france/pull/40","diff_url":"https://github.com/sgmap/openfisca-france/pull/40.diff","patch_url":"https://github.com/sgmap/openfisca-france/pull/40.patch","issue_url":"https://api.github.com/repos/sgmap/openfisca-france/issues/40","number":40,"state":"open","locked":false,"title":"Paris","user":{"login":"kinta95","id":16152516,"avatar_url":"https://avatars.githubusercontent.com/u/16152516?v=3","gravatar_id":"","url":"https://api.github.com/users/kinta95","html_url":"https://github.com/kinta95","followers_url":"https://api.github.com/users/kinta95/followers","following_url":"https://api.github.com/users/kinta95/following{/other_user}","gists_url":"https://api.github.com/users/kinta95/gists{/gist_id}","starred_url":"https://api.github.com/users/kinta95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinta95/subscriptions","organizations_url":"https://api.github.com/users/kinta95/orgs","repos_url":"https://api.github.com/users/kinta95/repos","events_url":"https://api.github.com/users/kinta95/events{/privacy}","received_events_url":"https://api.github.com/users/kinta95/received_events","type":"User","site_admin":false},"body":"ajout des aides PSOL ,PL, Forfait, l’ASPEH et PLFM","created_at":"2015-12-09T15:56:02Z","updated_at":"2015-12-09T16:40:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22b8d7172de34fd2834067cdc720847ccd8aa6c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40/commits","review_comments_url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40/comments","review_comment_url":"https://api.github.com/repos/sgmap/openfisca-france/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgmap/openfisca-france/issues/40/comments","statuses_url":"https://api.github.com/repos/sgmap/openfisca-france/statuses/93a0d5e5540744951c07c330c84a0f8cd01740dc","head":{"label":"kinta95:paris","ref":"paris","sha":"93a0d5e5540744951c07c330c84a0f8cd01740dc","user":{"login":"kinta95","id":16152516,"avatar_url":"https://avatars.githubusercontent.com/u/16152516?v=3","gravatar_id":"","url":"https://api.github.com/users/kinta95","html_url":"https://github.com/kinta95","followers_url":"https://api.github.com/users/kinta95/followers","following_url":"https://api.github.com/users/kinta95/following{/other_user}","gists_url":"https://api.github.com/users/kinta95/gists{/gist_id}","starred_url":"https://api.github.com/users/kinta95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinta95/subscriptions","organizations_url":"https://api.github.com/users/kinta95/orgs","repos_url":"https://api.github.com/users/kinta95/repos","events_url":"https://api.github.com/users/kinta95/events{/privacy}","received_events_url":"https://api.github.com/users/kinta95/received_events","type":"User","site_admin":false},"repo":{"id":47414193,"name":"openfisca-france","full_name":"kinta95/openfisca-france","owner":{"login":"kinta95","id":16152516,"avatar_url":"https://avatars.githubusercontent.com/u/16152516?v=3","gravatar_id":"","url":"https://api.github.com/users/kinta95","html_url":"https://github.com/kinta95","followers_url":"https://api.github.com/users/kinta95/followers","following_url":"https://api.github.com/users/kinta95/following{/other_user}","gists_url":"https://api.github.com/users/kinta95/gists{/gist_id}","starred_url":"https://api.github.com/users/kinta95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinta95/subscriptions","organizations_url":"https://api.github.com/users/kinta95/orgs","repos_url":"https://api.github.com/users/kinta95/repos","events_url":"https://api.github.com/users/kinta95/events{/privacy}","received_events_url":"https://api.github.com/users/kinta95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kinta95/openfisca-france","description":"  French specific module for OpenFisca","fork":true,"url":"https://api.github.com/repos/kinta95/openfisca-france","forks_url":"https://api.github.com/repos/kinta95/openfisca-france/forks","keys_url":"https://api.github.com/repos/kinta95/openfisca-france/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinta95/openfisca-france/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinta95/openfisca-france/teams","hooks_url":"https://api.github.com/repos/kinta95/openfisca-france/hooks","issue_events_url":"https://api.github.com/repos/kinta95/openfisca-france/issues/events{/number}","events_url":"https://api.github.com/repos/kinta95/openfisca-france/events","assignees_url":"https://api.github.com/repos/kinta95/openfisca-france/assignees{/user}","branches_url":"https://api.github.com/repos/kinta95/openfisca-france/branches{/branch}","tags_url":"https://api.github.com/repos/kinta95/openfisca-france/tags","blobs_url":"https://api.github.com/repos/kinta95/openfisca-france/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinta95/openfisca-france/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinta95/openfisca-france/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinta95/openfisca-france/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinta95/openfisca-france/statuses/{sha}","languages_url":"https://api.github.com/repos/kinta95/openfisca-france/languages","stargazers_url":"https://api.github.com/repos/kinta95/openfisca-france/stargazers","contributors_url":"https://api.github.com/repos/kinta95/openfisca-france/contributors","subscribers_url":"https://api.github.com/repos/kinta95/openfisca-france/subscribers","subscription_url":"https://api.github.com/repos/kinta95/openfisca-france/subscription","commits_url":"https://api.github.com/repos/kinta95/openfisca-france/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinta95/openfisca-france/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinta95/openfisca-france/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinta95/openfisca-france/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinta95/openfisca-france/contents/{+path}","compare_url":"https://api.github.com/repos/kinta95/openfisca-france/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinta95/openfisca-france/merges","archive_url":"https://api.github.com/repos/kinta95/openfisca-france/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinta95/openfisca-france/downloads","issues_url":"https://api.github.com/repos/kinta95/openfisca-france/issues{/number}","pulls_url":"https://api.github.com/repos/kinta95/openfisca-france/pulls{/number}","milestones_url":"https://api.github.com/repos/kinta95/openfisca-france/milestones{/number}","notifications_url":"https://api.github.com/repos/kinta95/openfisca-france/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinta95/openfisca-france/labels{/name}","releases_url":"https://api.github.com/repos/kinta95/openfisca-france/releases{/id}","created_at":"2015-12-04T16:05:13Z","updated_at":"2015-12-04T16:05:22Z","pushed_at":"2015-12-09T15:53:56Z","git_url":"git://github.com/kinta95/openfisca-france.git","ssh_url":"git@github.com:kinta95/openfisca-france.git","clone_url":"https://github.com/kinta95/openfisca-france.git","svn_url":"https://github.com/kinta95/openfisca-france","homepage":"","size":16136,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"prod"}},"base":{"label":"sgmap:paris","ref":"paris","sha":"f049f25c231faedee0e53ab098c7456b6bbeaaf5","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":22137709,"name":"openfisca-france","full_name":"sgmap/openfisca-france","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/openfisca-france","description":"  French specific module for OpenFisca","fork":true,"url":"https://api.github.com/repos/sgmap/openfisca-france","forks_url":"https://api.github.com/repos/sgmap/openfisca-france/forks","keys_url":"https://api.github.com/repos/sgmap/openfisca-france/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/openfisca-france/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/openfisca-france/teams","hooks_url":"https://api.github.com/repos/sgmap/openfisca-france/hooks","issue_events_url":"https://api.github.com/repos/sgmap/openfisca-france/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/openfisca-france/events","assignees_url":"https://api.github.com/repos/sgmap/openfisca-france/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/openfisca-france/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/openfisca-france/tags","blobs_url":"https://api.github.com/repos/sgmap/openfisca-france/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/openfisca-france/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/openfisca-france/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/openfisca-france/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/openfisca-france/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/openfisca-france/languages","stargazers_url":"https://api.github.com/repos/sgmap/openfisca-france/stargazers","contributors_url":"https://api.github.com/repos/sgmap/openfisca-france/contributors","subscribers_url":"https://api.github.com/repos/sgmap/openfisca-france/subscribers","subscription_url":"https://api.github.com/repos/sgmap/openfisca-france/subscription","commits_url":"https://api.github.com/repos/sgmap/openfisca-france/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/openfisca-france/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/openfisca-france/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/openfisca-france/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/openfisca-france/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/openfisca-france/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/openfisca-france/merges","archive_url":"https://api.github.com/repos/sgmap/openfisca-france/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/openfisca-france/downloads","issues_url":"https://api.github.com/repos/sgmap/openfisca-france/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/openfisca-france/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/openfisca-france/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/openfisca-france/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/openfisca-france/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/openfisca-france/releases{/id}","created_at":"2014-07-23T08:10:22Z","updated_at":"2015-06-22T09:30:37Z","pushed_at":"2015-12-09T15:58:30Z","git_url":"git://github.com/sgmap/openfisca-france.git","ssh_url":"git@github.com:sgmap/openfisca-france.git","clone_url":"https://github.com/sgmap/openfisca-france.git","svn_url":"https://github.com/sgmap/openfisca-france","homepage":"","size":16118,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":1,"default_branch":"prod"}},"_links":{"self":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40"},"html":{"href":"https://github.com/sgmap/openfisca-france/pull/40"},"issue":{"href":"https://api.github.com/repos/sgmap/openfisca-france/issues/40"},"comments":{"href":"https://api.github.com/repos/sgmap/openfisca-france/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgmap/openfisca-france/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/sgmap/openfisca-france/statuses/93a0d5e5540744951c07c330c84a0f8cd01740dc"}}}}