-
Notifications
You must be signed in to change notification settings - Fork 101
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
Remove fuzzy #731
Remove fuzzy #731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of redundant lines.
Given the size of the diff, it's hard to check the changes one by one. The tests will be our guarantee. To pass them, you should check this out.
<VALUE deb="2007-01-01" fin="2010-12-31" valeur="0.5" /> # Suppression du bouclier fiscal à compter des revenus réalisés en 2011. # | ||
<VALUE deb="2006-01-01" fin="2006-12-31" valeur="0.6" /> | ||
<END deb="2011-01-01" /> | ||
<VALUE deb="2007-01-01" valeur="0.5" /> # Suppression du bouclier fiscal à compter des revenus réalisés en 2011. # |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be one line above, no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transformation was automated. I am willing to check manually for every comment and decide to which line it naturally belongs. However, I would like to be sure that the automated regexes won't need to be modified and replayed.
setup.py
Outdated
@@ -7,7 +7,7 @@ | |||
|
|||
setup( | |||
name = 'OpenFisca-France', | |||
version = '16.1.1', | |||
version = '17.0.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is a major version. Is there any change brought by this PR from an OpenFisca-France user point of view ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original openfisca-france xml code will break. Apart from that, no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then this should just be a minor.
openfisca_france/parameters/tns.xml
Outdated
<VALUE deb="2016-01-01" fuzzy="true" valeur="0.5" /> | ||
<VALUE deb="2008-01-01" fin="2015-12-31" valeur="0.5" /> | ||
<VALUE deb="2016-01-01" valeur="0.5" /> | ||
<VALUE deb="2008-01-01" valeur="0.5" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of this: two lines with the same values. It should be only one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should be a PLACEHOLDER
as discussed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I don't think we (the core team) should take the responsability to choose where a PLACEHOLDER
is relevant and where it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a lot of work to check in the transformation script if consecutive values are the same or not. However the redundancy was already in the original file. IMHO this check is exceeding the core team's purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line dupplication was brought by the fuzzy. As we are getting rid of it, I think we should clean it and remove the redundant values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A regex like :
(?: )*<VALUE deb="\d{4}-\d{2}-\d{2}" valeur="((?:\d|.)+)" \/>
((?: )*<VALUE deb="\d{4}-\d{2}-\d{2}" valeur="\1" \/>)
->
\2
should remove all the duplicates.
I can run it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour information, ce cas est présent 706 fois.
Je ne suis pas serein sur le fait d'automatiser la transformation par une regex. Dans le cas suivant ça introduirait un bug :
<VALUE deb="2016-01-01" valeur="0.5" />
<VALUE deb="2014-01-01" valeur="0.5" />
<VALUE deb="2015-01-01" valeur="1.0" />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tester si les dates sont bien ordonnées. Si c'est le seul cas dangereux ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est fait
CHANGELOG.md
Outdated
@@ -1,5 +1,13 @@ | |||
# Changelog | |||
|
|||
# 17.0.0 - [#???](https://github.com/openfisca/openfisca-france/pull/???) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix ???
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
openfisca_france/parameters/tns.xml
Outdated
<VALUE deb="2016-01-01" fuzzy="true" valeur="0.5" /> | ||
<VALUE deb="2008-01-01" fin="2015-12-31" valeur="0.5" /> | ||
<VALUE deb="2016-01-01" valeur="0.5" /> | ||
<VALUE deb="2008-01-01" valeur="0.5" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should be a PLACEHOLDER
as discussed
<VALUE deb="1967-01-01" valeur="0.5" /> | ||
<VALUE deb="1966-01-01" valeur="0.55" /> | ||
<VALUE deb="1949-01-01" valeur="0.5" /> | ||
<VALUE deb="1948-01-01" valeur="0.4" /> | ||
</TAUX> | ||
</ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjello est ce que tu peux stp nous éclairer sur ce point qui fait crasher les tests:
Quand on regarde le XML, il semble que la TEICAA n'existe plus depuis le 1er janvier 2013. Pourtant la formule qui l'utilise n'est pas datée. Est-ce que:
- La TEICAA est encore en vigueur et il faut supprimer cette date de fin
- La TEICAA n'est plus en vigueur et il faut dater la formule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne suis pas spécialiste mais les cases 5QM et 5RM existent toujours et ne semblent pas avoir changé de définition depuis 2013 donc je suppose que rien n'a changé ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Les tests ne plantaient pas avant, car les barèmes sans tranche (toutes les tranches sont finies) étaient toujours considérés comme des barèmes. Ils retournaient systématiquement 0. Maintenant, on considère qu'un barème n'existe plus dès lors qu'il n'a plus de tranche. S'il est appelé, il renvoie une exception ParameterNotFound.
Est-ce qu'il faut revenir au comportement précédent ou enlever le noeud END ?
@michelbl la propriété |
Also, as discussed with @MattiSG, we should not remove the |
8d15943
to
d853b03
Compare
Supprime l'attribut fuzzy. Déplace l'attribut 'fin' des noeuds VALUE vers un nouveau noeud END. Cette transformation a été effectuée à l'aide du script Openfisca-Core remove_fuzzy.py.
Connected to openfisca/openfisca-core#437