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

Unexpected behavior with "definition_period = ETERNITY" variables (i.e date_naissance) #1295

Open
JoDuGa opened this issue Nov 18, 2024 · 0 comments
Labels
kind:feat A feature request, a feature deprecation

Comments

@JoDuGa
Copy link

JoDuGa commented Nov 18, 2024

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

Here is what I did:

I sent a request to Openfisca asking for the "age" of multiple individuals by sending their "date_naissance" on an "eternity" period.

Here is what I expected to happen:

I expected the individuals' age to be calculated from their date_naissance.

Here is what actually happened:

For all the individuals except the last one, their age was instead calculated as if "date_naissance" had its default value instead of the one in the request.

After some investigation, it appears that the problem with "eternity" was one of case : "eternity" doesn't work, but "ETERNITY" does. It would be ideal if the engine ignored the case of "eternity" in this case.

This same error also happens if one of the individuals send their "date_naissance" on a month/year period whereas the others send it on ETERNITY, in which case the individual in question will have everything calculated as if its date_naissance had the default value.

Here is data (or links to it) that can help you reproduce this issue:

- name: All 3 individuals use the "eternity" (lower case, specifically) period for their date_naissance period: 2024-11 relative_error_margin: 0.01 input: individus: parent1: date_naissance: eternity: 2000-10-15 parent2: date_naissance: eternity: 1990-10-15 parent3: date_naissance: eternity: 1980-10-15 output: individus: parent1: date_naissance: 2024-11: 1970-01-01 age: 2024-11: 54 parent2: date_naissance: 2024-11: 1970-01-01 age: 2024-11: 54 parent3: date_naissance: 2024-11: 1980-10-15 age: 2024-11: 44

- name: All 3 individuals use the "ETERNITY" period for their date_naissance period: 2024-11 relative_error_margin: 0.01 input: individus: parent1: date_naissance: ETERNITY: 2000-10-15 parent2: date_naissance: ETERNITY: 1990-10-15 parent3: date_naissance: ETERNITY: 1980-10-15 output: individus: parent1: date_naissance: 2024-11: 2000-10-15 age: 2024-11: 24 parent2: date_naissance: 2024-11: 1990-10-15 age: 2024-11: 34 parent3: date_naissance: 2024-11: 1980-10-15 age: 2024-11: 44

- name: One of the 3 individuals use a month as the period for their date_naissance period: 2024-11 relative_error_margin: 0.01 input: individus: parent1: date_naissance: ETERNITY: 2000-10-15 parent2: date_naissance: 2024-11: 1990-10-15 parent3: date_naissance: ETERNITY: 1980-10-15 output: individus: parent1: date_naissance: 2024-11: 2000-10-15 age: 2024-11: 24 parent2: date_naissance: 2024-11: 1970-01-01 age: 2024-11: 54 parent3: date_naissance: 2024-11: 1980-10-15 age: 2024-11: 44

Context

I identify more as a:

  • Developer.
@bonjourmauko bonjourmauko added the kind:feat A feature request, a feature deprecation label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feat A feature request, a feature deprecation
Projects
Development

No branches or pull requests

2 participants