openfisca / openfisca-france-indirect-taxation

French indirect taxation module for OpenFisca
http://www.openfisca.fr/
GNU Affero General Public License v3.0
5 stars 13 forks source link

Update reforms energies #157

Closed thomasdouenne closed 7 years ago

thomasdouenne commented 7 years ago

Old reforms for energies do not work anymore. We need to adapt them. It includes:

benjello commented 7 years ago

@thomasdouenne : do you understand how you should change this ?

thomasdouenne commented 7 years ago

No I had a look but I don't see how to proceed, whether I should change the whole structure of the script or not. These are basically just parametric reforms

benjello commented 7 years ago

You should mimic the structure https://github.com/openfisca/openfisca-france/blob/master/openfisca_france/reforms/allocations_familiales_imposables.py but keep the old modify_legislation since we are not using the latest master version

thomasdouenne commented 7 years ago

@benjello Do you know how to solve this? Is there another way to write?

File "c:\users\t.douenne\github\openfisca-france-indirect-taxation\openfisca_france_indirect_taxation\reforms\rattrapage_diesel_bis.py", line 575, in apply self.modify_parameters(modifier_function = modify_parameters)

File "c:\users\t.douenne\github\openfisca-core\openfisca_core\reforms.py", line 41, in getattr return getattr(self.reference, attribute)

AttributeError: 'FranceIndirectTaxationTaxBenefitSystem' object has no attribute 'modify_parameters'

benjello commented 7 years ago

Thé function should ne modify_legislation for tour version

On jeu. 21 sept. 2017 10:00 thomasdouenne notifications@github.com wrote:

@benjello https://github.com/benjello Do you know how to solve this? Is there another way to write?

File "c:\users\t.douenne\github\openfisca-france-indirect-taxation\openfisca_france_indirect_taxation\reforms\rattrapage_diesel_bis.py", line 575, in apply self.modify_parameters(modifier_function = modify_parameters)

File "c:\users\t.douenne\github\openfisca-core\openfisca_core\reforms.py", line 41, in getattr return getattr(self.reference, attribute)

AttributeError: 'FranceIndirectTaxationTaxBenefitSystem' object has no attribute 'modify_parameters'

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/openfisca/openfisca-france-indirect-taxation/issues/157#issuecomment-331082293, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHxdzrUcmHSQ7LtM30IxhyTODhU8_tOks5skheXgaJpZM4PTI3e .

-- Mahdi Ben Jelloul

thomasdouenne commented 7 years ago

Do you mean that I should just drop the last line of the code, that is:

self.modify_parameters(modifier_function = modify_parameters)

?

thomasdouenne commented 7 years ago

There must be something incorrect in my function "modify_parameters". When I delete the last line previously mentionned, I get:

ParameterNotFound: Legislation parameter "rattrapage_diesel" was not found at instant "2011-01-01" by variable "depenses_diesel_ajustees_rattrapage_diesel".

benjello commented 7 years ago

Use .modify_legislation_json() instead of modify_parameters

thomasdouenne commented 7 years ago

This is the error I get but I cannot determine what goes wrong

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 141974: ordinal not in range(128)

benjello commented 7 years ago

It is a unicode problem You need to have the following line at the top of your python files

# -*- coding: utf-8 -*-

And maybe a little "u" in front of your strings

my_string_with_accents = u"L'été a été pluvieux"
thomasdouenne commented 7 years ago

I have both, but still I face this error with the tree modify_legislation_json.

michelbl commented 7 years ago

@thomasdouenne since Openfisca-Core v17, the way reforms are defined is changed, see https://github.com/openfisca/openfisca-core/blob/master/CHANGELOG.md#1700---552

benjello commented 7 years ago

@michelbl : @thomasdouenne is not on v17 yet. We go step by step ;-)

thomasdouenne commented 7 years ago

Solved