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

Spécifier toujours une période dans les appels de variables #699

Merged
merged 6 commits into from
Mar 9, 2017

Conversation

michelbl
Copy link

@michelbl michelbl commented Mar 8, 2017

Connected to openfisca/openfisca-core#468

  • Amélioration technique
  • Périodes concernées : toutes
  • Zones impactées : revenus/activite/salarie/salaire_net_a_payer, réformes et tests
  • Détails :
    • Spécifie toujours une période dans les appels de variables, dans les formules et dans les tests.

Ces changements :

  • Adaptent france à la version 7.0.0 de core.
  • Corrigent des calculs déjà existants.

@michelbl michelbl requested review from cbenz and fpagnoux March 8, 2017 13:58
@michelbl michelbl self-assigned this Mar 8, 2017
@michelbl
Copy link
Author

michelbl commented Mar 8, 2017

Related to openfisca/openfisca-core#469

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.

Merci pour la rapidité !

Le code est ok pour moi, juste quelques remarques sur le changelog.

requirements.txt Outdated
@@ -1,5 +1,5 @@
# Add Biryani extra requirement here because it is needed by OpenFisca-Core and installation from Git URL below
# does not take extras_require of Core setup.py into account.
Biryani[datetimeconv] >= 0.10.4
--editable git+https://github.com/openfisca/openfisca-core.git#egg=OpenFisca-Core
--editable git+https://github.com/openfisca/openfisca-core.git@mandatory-period#egg=OpenFisca-Core
Copy link
Member

Choose a reason for hiding this comment

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

@cbenz il me semblait qu'on avait un script qui gérait ça automatiquement, il a été supprimé ? Ou il ne fonctionne juste plus ?

Copy link
Member

Choose a reason for hiding this comment

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

Il est toujours là, mais on avait décidé (à l'oral) de supprimer cela sachant que ça introduisait un comportement automatique et qu'on pouvait changer la branche dans requirements.txt.

Coïncidence : je viens de poster une PR sur Web-API qui supprime le script en question sur le dépôt Web-API.

@@ -891,7 +891,7 @@ def function(self, simulation, period):
'''
salaire_net = simulation.calculate_add('salaire_net', period)
depense_cantine_titre_restaurant_employe = simulation.calculate(
'depense_cantine_titre_restaurant_employe')
'depense_cantine_titre_restaurant_employe', period)
Copy link
Member

Choose a reason for hiding this comment

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

C'était probablement une erreur je pense. @laem tu confirmes ?

Copy link
Contributor

@laem laem Mar 9, 2017

Choose a reason for hiding this comment

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

@fpagnoux je n'utilise pas cette variable, c'est hors-champ dans le simulateur pour l'instant (c'est le monde des conventions collectives et accords entreprise), mais j'imagine que oui c'était un oubli.

CHANGELOG.md Outdated
## 14.2.0 - [#685](https://github.com/openfisca/openfisca-france/pull/699)

* Amélioration technique
* Périodes concernées : toutes
Copy link
Member

Choose a reason for hiding this comment

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

Cette ligne et la suivante ne sont nécessaires que dans le cas d'une évolution de la legislation. On peut les enlever ici.

Copy link
Author

Choose a reason for hiding this comment

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

done

CHANGELOG.md Outdated
* Détails :
- Spécifie toujours une période dans les appels de variables, dans les formules et dans les tests.

Ces changements :
Copy link
Member

Choose a reason for hiding this comment

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

Ce second bloc devrait être intégrés dans le bloc standardisé.

Copy link
Author

Choose a reason for hiding this comment

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

done

CHANGELOG.md Outdated
Ces changements :
- Adaptent `france` à la version `7.0.0` de `core`.
- Corrigent des calculs déjà existants.

Copy link
Member

Choose a reason for hiding this comment

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

En fait cette PR fait deux choses :

  • Elle adapte le package france au nouveau core, ce qui est une Amélioration technique
  • Elle corrige une erreur dans le calcul de salaire_net_a_payer, ce qui est une Évolution du système socio-fiscal.

Je pense que ce serait plus lisible d'avoir deux blocs séparés.

@michelbl
Copy link
Author

michelbl commented Mar 9, 2017

@fpagnoux j'ai essayé de prendre en compte tes remarques sur le Changelog. Si tu estimes que c'est encore améliorable, n'hésite pas à éditer toi-même la branche (ou me dire quoi changer)

@michelbl michelbl requested a review from fpagnoux March 9, 2017 09:08
@fpagnoux
Copy link
Member

fpagnoux commented Mar 9, 2017

Done.

Pour les Évolution du système socio-fiscal, l'idée est de se mettre du point de vue du réutilisateur, et de vraiment expliciter les impacts sur le calcul, sans se préoccuper des aspects techniques (tels que "Spécifie toujours une période dans les appels de variables, dans les formules et dans les tests.")

setup.py Outdated
@@ -45,7 +45,7 @@
'Babel >= 0.9.4',
'Biryani[datetimeconv] >= 0.10.4',
'numpy >= 1.11',
'OpenFisca-Core >= 6.0.0, < 7.0',
'OpenFisca-Core >= 6.0.0, < 8.0',
Copy link
Member

Choose a reason for hiding this comment

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

@michelbl On avait oublié ça

Copy link
Author

Choose a reason for hiding this comment

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

👍

Michel Blancard and others added 6 commits March 9, 2017 17:23
The `period` argument is no longer optional.
A call was made without a period. The period of the simulation
was silently used instead. This introduced a computation error
in cases where the period of the simulation was different.
Some variables requested computations without providing a period.
The period of the simulation was used instead, potentially introducing
computation errors.
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