Closed mnwhite closed 3 weeks ago
because IndShockLabeledType needs to import from IndShockConsumerType and PerfForesightLabeled, and I thought this was a good way to avoid multiple inheritance, which I still don't understand very well.
If there is a better way to do it, then we should do that!
There's a better way. I am utterly baffled at how this class manages to initialize and run. It needs income shock parameters to be passed to it... but they're not in its default dictionary!
they are in the parent's default dictionary!
They are not! This class inherits from IndShockConsumerType, but uses the perfect foresight dictionary as its default:
I'll check in a moment, but I suspect the explanation is that all of the tests are using a custom dictionary, not the default one.
What is the default dictionary of IndShockConsumerType?
Ok, I see now. Hopefully I can work it out.
This is now fixed in #1410 by manually re-adding the (unexpectedly needed) constructors. It's wonky because update
is being run multiple times during initialization. In the future, I think we should work toward update
or construct
not being called automatically during initialization, and have the user do it manually.
The "labeled perfect foresight" model apparently inherits from
IndShockConsumerType
and thus expects a lot of information (about income shocks, etc) that has no meaning in the PF model. Why? I'm having a hard time updating the code because I need to get meaningless information into this class, or have it ignore that stuff.