Open nikhilwoodruff opened 2 years ago
Hi there!
I really enjoy OpenFisca, but I recently encountered an issue.
Inside a formula, with defined encapsulated entities, decode an Enum variable:
str_enum = family.household("enum_variable", period).decode_to_str()
The string decodes in an array to be returned, just like what happens when I run:
simulation.calculate("family_enum_variable_returning_households_enum", period).decode_to_str()
AttributeError: 'numpy.ndarray' object has no attribute 'decode_to_str'
Happy to add this as a test case to test_projectors and find a fix.
test_projectors
I identify more as a:
Thanks!
On further inspection, I think the root cause of this is that GroupPopulation.value_nth_person does not preserve Enum status, returning only integer arrays.
GroupPopulation.value_nth_person
Hi there!
I really enjoy OpenFisca, but I recently encountered an issue.
Here is what I did:
Inside a formula, with defined encapsulated entities, decode an Enum variable:
Here is what I expected to happen:
The string decodes in an array to be returned, just like what happens when I run:
Here is what actually happened:
AttributeError: 'numpy.ndarray' object has no attribute 'decode_to_str'
Here is data (or links to it) that can help you reproduce this issue:
Happy to add this as a test case to
test_projectors
and find a fix.Context
I identify more as a:
Thanks!