PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
12 stars 28 forks source link

`set_reform_impact_data_routine` fails in some cases #1964

Open anth-volk opened 2 weeks ago

anth-volk commented 2 weeks ago

Unsure where the bug lies, but when running the worker locally, the worker functions properly for a standard sim run, but for cliff impacts, nothing seems to happen, and the sim run never even prints out that it initializes

anth-volk commented 2 weeks ago

This may be related, but unsure when error triggered locally:

  File "/Users/administrator/Documents/PolicyEngine/policyengine-api/policyengine_api/endpoints/economy/reform_impact.py", line 194, in set_reform_impact_data_routine
    if baseline_economy["status"] != "ok" or reform_economy["status"] != "ok":
       ~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'status'
anth-volk commented 2 weeks ago

Actually, I'm wrong on this. After further testing, it looks like the cliff impact functions correctly (although the calculation for the -us package's cliff_impact variable is horribly slow and I'm wondering if there's a faster way to do it API-side, but unsure). What actually happens is that set_reform_impact_data_routine fails on the reform run for some reason.

MaxGhenis commented 2 weeks ago

If it simplifies, we should just be flagging cliffs as MTR > 100%

anth-volk commented 2 weeks ago

Unfortunately, the issue lies not with how we calculate cliff impacts, but something else downstream. Thank you, though, that could make it quicker to calculate these. The cliff impacts themselves currently take forever.