Skip to content
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

Merged
merged 7 commits into from
May 3, 2017
Merged

Remove fuzzy #731

merged 7 commits into from
May 3, 2017

Conversation

michelbl
Copy link

@michelbl michelbl requested review from fpagnoux and cbenz April 14, 2017 18:30
Copy link
Member

@fpagnoux fpagnoux left a 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. #
Copy link
Member

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 ?

Copy link
Author

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',
Copy link
Member

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 ?

Copy link
Author

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.

Copy link
Member

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.

<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" />
Copy link
Member

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.

Copy link
Member

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

Copy link
Member

@fpagnoux fpagnoux Apr 19, 2017

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.

Copy link
Author

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.

Copy link
Member

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.

Copy link
Member

@fpagnoux fpagnoux Apr 27, 2017

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.

Copy link
Author

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" />

@benjello et @cbenz, quel est votre avis ?

Copy link
Member

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 ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est fait

cbenz
cbenz previously requested changes Apr 19, 2017
CHANGELOG.md Outdated
@@ -1,5 +1,13 @@
# Changelog

# 17.0.0 - [#???](https://github.com/openfisca/openfisca-france/pull/???)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix ??? :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<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" />
Copy link
Member

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

@michelbl michelbl requested review from fpagnoux and cbenz April 25, 2017 17:42
<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>
</
Copy link
Member

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

Copy link
Member

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é ...

Copy link
Author

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 ?

@fpagnoux
Copy link
Member

fpagnoux commented Apr 27, 2017

@michelbl la propriété ignore a été dépréciée pour les fichiers de test. Il faut soit adapter le test, soit le supprimer en expliquant bien les raisons qui poussent à croire que ce test est faux.

@fpagnoux
Copy link
Member

Also, as discussed with @MattiSG, we should not remove the param.xml file in this PR. This is a too big issue to be secretly removed ;)

@michelbl michelbl force-pushed the remove-fuzzy branch 2 times, most recently from 8d15943 to d853b03 Compare May 3, 2017 16:28
Michel Blancard added 5 commits May 3, 2017 19:13
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.
@fpagnoux fpagnoux dismissed cbenz’s stale review May 3, 2017 17:39

Les absents ont toujours tort

@fpagnoux fpagnoux merged commit e53121c into master May 3, 2017
@fpagnoux fpagnoux deleted the remove-fuzzy branch May 3, 2017 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants