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

Test that country packages don't have formulas with entity mismatches #129

Open
MaxGhenis opened this issue Nov 26, 2023 · 3 comments
Open

Comments

@MaxGhenis
Copy link
Contributor

We've had several undetected crashes arising from formulas that mix up entity types, resulting in this type of error:

ValueError: operands could not be broadcast together with shapes (100000,) (279932,)

For example, PolicyEngine/policyengine-us#3298

Let's test for this centrally.

@martinholmer could you share the command you executed in that issue to throw the error?

@martinholmer
Copy link

@MaxGhenis asked:

could you share the command you executed in that issue to throw the error?

sim.calculate("hi_income_tax")

where the sim object had been initialized with 100,000 tax units containing 279,932 people.

@MaxGhenis
Copy link
Contributor Author

Thanks - I would have thought the normal microsim tests would have caught that, since hi_income_tax is in the net income tree. But safer could be computing every variable in a microsim, not only net income.

@nikhilwoodruff
Copy link
Contributor

Yes- we have a test for the UK package that does this and checks for NaNs, should generalise

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

No branches or pull requests

3 participants