diff --git a/.gitignore b/.gitignore index 2b93b6b9562..ff9e6a159b8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ build .idea* .tags* *.egg-info +*.pickle *.pyc *.pyo .DS_Store diff --git a/openfisca_france/assets/lonlat_communes.pickle b/openfisca_france/assets/lonlat_communes.pickle deleted file mode 100644 index b55067389eb..00000000000 Binary files a/openfisca_france/assets/lonlat_communes.pickle and /dev/null differ diff --git a/openfisca_france/model/prestations/bourses_superieur.py b/openfisca_france/model/prestations/bourses_superieur.py index 479ba67a778..bdf4815dd6d 100644 --- a/openfisca_france/model/prestations/bourses_superieur.py +++ b/openfisca_france/model/prestations/bourses_superieur.py @@ -135,30 +135,6 @@ class bourse_criteres_sociaux_distance_domicile_familial(Variable): label = "Distance entre le lieu d'étude et le domicile familial pour le calcul la bourse sur critères sociaux de l'enseignement supérieur" definition_period = MONTH - def formula(individu, period): - depcom_coords = get_communes_coords(individu.menage('depcom', period)) - domicile_familial_coords = get_communes_coords(individu('bourse_criteres_sociaux_commune_domicile_familial', period)) - - try: - from haversine import haversine_vector, Unit - distances = haversine_vector(depcom_coords, domicile_familial_coords, Unit.KILOMETERS) - return [distance if distance != float('nan') else -1 for distance in distances] - except ModuleNotFoundError: - return -1 - else: - raise - - -class bourse_criteres_sociaux_commune_domicile_familial(Variable): - entity = Individu - value_type = str - max_length = 5 - label = "Commune du domicile familial pour la bourse sur critères sociaux de l'enseignement supérieur" - definition_period = MONTH - - def formula(individu, period): - return individu.menage('depcom', period) - class bourse_criteres_sociaux_nombre_enfants_a_charge(Variable): entity = Famille diff --git a/openfisca_france/parameters/bourses_enseignement_superieur/criteres_sociaux/points_de_charge.yaml b/openfisca_france/parameters/bourses_enseignement_superieur/criteres_sociaux/points_de_charge.yaml index b9ea1d2d439..42b8675ab04 100644 --- a/openfisca_france/parameters/bourses_enseignement_superieur/criteres_sociaux/points_de_charge.yaml +++ b/openfisca_france/parameters/bourses_enseignement_superieur/criteres_sociaux/points_de_charge.yaml @@ -1,4 +1,5 @@ distance_domicile_familial: + reference: https://www.education.gouv.fr/bo/20/Hebdo25/ESRS2013435C.htm metadata: type: single_amount brackets: diff --git a/setup.py b/setup.py index f16a1022332..de333d25b7f 100644 --- a/setup.py +++ b/setup.py @@ -38,14 +38,10 @@ "taxipp": [ "pandas >= 0.13", ], - "bourse_criteres_sociaux": [ - "haversine >= 2.3.0" - ], "dev": [ "autopep8 ==1.5.4", "flake8 >=3.8.0,<3.9.0", "flake8-print", - "haversine >= 2.3.0", "pytest >= 5.0.0, < 7.0.0", "scipy >= 0.17", # Only used to test de_net_a_brut reform "requests >= 2.8", diff --git a/tests/formulas/bourses_superieur/bourse_criteres_sociaux.yaml b/tests/formulas/bourses_superieur/bourse_criteres_sociaux.yaml index e209ca365a9..aed12967d1b 100644 --- a/tests/formulas/bourses_superieur/bourse_criteres_sociaux.yaml +++ b/tests/formulas/bourses_superieur/bourse_criteres_sociaux.yaml @@ -18,13 +18,6 @@ output: bourse_criteres_sociaux_points_de_charge_distance_domicile_familial: [0, 1, 2] -- period: 2021-03 - input: - depcom: [69123, 69123, 33122] - bourse_criteres_sociaux_commune_domicile_familial: [75056, 69123, 38185] - output: # Valeurs de test post-déterminées - bourse_criteres_sociaux_distance_domicile_familial: [388, 0, 507] - - period: 2021-03 input: bourse_criteres_sociaux_nombre_enfants_a_charge: [4]