Skip to content

Commit

Permalink
[Crash} Corrige le chargement du chemin du fichier dans le package (#192
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Allan-CodeWorks authored Nov 27, 2023
1 parent 6241194 commit cca352c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Changelog

## [6.7.2] - 2023-11-23

_Pour les changements détaillés et les discussions associées, référencez la pull request [#192](https://github.com/openfisca/openfisca-france-local/pull/192)

### Fixed

- Corrige le problème de chargement du fichier contenant les *epcis* de la réforme `epci_test_factory` introduit dans la release `6.7.1`

## [6.7.1] - 2023-11-21

_Pour les changements détaillés et les discussions associées, référencez la pull request [#190](https://github.com/openfisca/openfisca-france-local/pull/190)
Expand Down
8 changes: 5 additions & 3 deletions openfisca_france_local/epci_test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from openfisca_france.model.base import Variable, Menage, MONTH
from openfisca_core import reforms

from importlib.resources import as_file, files
import pandas as pd


Expand All @@ -26,9 +27,10 @@ def formula(menage, period):

class epci_reform(reforms.Reform):
def apply(self):
raw = pd.read_excel('openfisca_france_local/epcicom2020.xlsx')
raw.insee = raw.insee.astype('|S5')
df = raw[['siren', 'insee', 'raison_sociale']].groupby('siren')
with as_file(files('openfisca_france_local').joinpath('epcicom2020.xlsx')) as path:
raw = pd.read_excel(path)
raw.insee = raw.insee.astype('|S5')
df = raw[['siren', 'insee', 'raison_sociale']].groupby('siren')

for siren in df.groups:
self.add_variable(epci_test_factory(df, siren))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='OpenFisca-France-Local',
version='6.7.1',
version='6.7.2',
author='OpenFisca Team',
author_email='[email protected]',
classifiers=[
Expand Down

0 comments on commit cca352c

Please sign in to comment.