openfisca / legislation-explorer

Explore legislation formulas and parameters.
https://legislation.demo.openfisca.org
GNU Affero General Public License v3.0
26 stars 12 forks source link

Enhance the parameter evolution section #118

Closed Anna-Livia closed 7 years ago

Anna-Livia commented 7 years ago

In the parameter evolution, could we clarify the documentation ? Proposition :

""" Many legislation parameters are regularly re-evaluated. This is why there is a start date attached to each parameters definition. In that case, formulas usually don't need to be modified: adding the new parameter value in the parameter file is enough.

Example: a user can reflect a change in the taxes parameter without altering the code of the flat_tax_on_salary formula that uses that parameter. """ To add/change a parameter :

  1. Open the file where the parameter is described
<NODE code="taxes">
    <NODE code='salary'>
      <CODE code="rate" description="Rate for the flat tax on salaries">
        <VALUE deb="2016-01-01" valeur="0.25" />
        <VALUE deb="2015-01-01" valeur="0.20" />
      </CODE>
    </NODE>
</NODE>
  1. Change the parameter with its new start date
    <NODE code="taxes">
    <NODE code='salary'>
      <CODE code="rate" description="Rate for the flat tax on salaries">
        <VALUE deb="2017-01-01" valeur="0.30" />
        <VALUE deb="2016-01-01" valeur="0.25" />
        <VALUE deb="2015-01-01" valeur="0.20" />
      </CODE>
    </NODE>
    </NODE>
  2. Conclusion

After this change : legislation(period).path.to.taxes_parameter will return the corresponding number legislation(2015-01).path.to.taxes_parameter will return 0.2 legislation(2017-01).path.to.taxes_parameter will return 0.3

MattiSG commented 7 years ago

@Anna-Livia interesting! šŸ™‚

However, one thing confuses me: what is the connection with the legislation-explorer repository that this issue is open in? I think the best format for this suggestion would be a PR against https://github.com/openfisca/openfisca-doc :wink:

Anna-Livia commented 7 years ago

Ooooops, sorry, wrong repo indeed šŸ™ƒ