You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ut_hb210_s2 cannot be passed as reform= (VariableNameConflictError) #9844
VariableNameConflictError: You've already defined ut_hb210_s2_marriage_credit in None. You tried to define it again in None.
This was run on the head of #9628 (743b6dfd3d, which is main at ea79c39fb7 plus that PR).
Cause
CountryTaxBenefitSystem.__init__ applies the reform it is given twice:
it applies it in if reform:, before structural-reform detection;
it applies it again, together with the structural reforms, after the modified flags are reset.
main does the same. ut_hb210_s2's apply calls self.add_variable(ut_hb210_s2_marriage_credit) (policyengine_us/reforms/states/ut/ut_hb210_s2.py), so the second application finds the variable already defined. Simulation(reform=...) builds the system the same way, through spm.py.
One fix is to skip the add_variable when the variable already exists. The test in #9628 guards a parameter it adds in the same way. Found while reviewing #9628, which does not change this.
Activity