Closed yvvijay121 closed 1 year ago
This occurs even minimally (notebook):
sim = IndividualSim(year=2022)
sim.add_person()
sim.vary("employment_income")
sim.deriv("snap", "employment_income")
I think it's because snap
is at the SPM unit level, but sim
doesn't have an SPM unit. Adding one fixes it:
sim = IndividualSim(year=2022)
sim.add_person(name="person")
sim.add_spm_unit(name="spm_unit", members=["person"])
sim.vary("employment_income")
sim.deriv("snap", "employment_income")
Though adding only a household throws the same error as person-only:
sim = IndividualSim(year=2022)
sim.add_person(name="person")
sim.add_household(name="household", members=["person"])
sim.vary("employment_income")
sim.deriv("snap", "employment_income")
Seems like an openfisca-tools issue.
I think we should use the Simulation
interface for this now (docs)
Error: