openfisca / openfisca-core

OpenFisca core engine. See other repositories for countries-specific code & data.
https://openfisca.org
GNU Affero General Public License v3.0
170 stars 75 forks source link

`assert_near` behaves inconsistenly with `str` values #1316

Open bonjourmauko opened 2 days ago

bonjourmauko commented 2 days ago

Hi there!

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

Here is what I did:

Write a formula declared as str.

Here is what I expected to happen:

To take the value as a numpy.dtype[str_].

Here is what actually happened:

It does not. Instead, it tries to run numexpr.evaluate over it.

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

https://github.com/openfisca/openfisca-core/commit/ba1ff4580cd1bf766ae843bd6b8d8ce90d6fb02b