Codex flagged (in PR #64) that when callers supply the supported dIydI argument while leaving the default mode_removal=True, build_linearization takes the cached-Jacobian branch and never creates self.dvdId or self.initial_currents_plasma_descriptor. The constructor then unconditionally indexes those attributes here, so initialization fails with AttributeError; initialize compatible descriptor state before applying the retained-mode mask, even when the current Jacobian is supplied.
Given we never really used this feature of re-using linearisation matrices, we should create a few examples and stress test this to find the bugs. Then explicitly state how the user needs to provide the matrices in order to do solves rapidly.
Codex flagged (in PR #64) that when callers supply the supported dIydI argument while leaving the default mode_removal=True, build_linearization takes the cached-Jacobian branch and never creates self.dvdId or self.initial_currents_plasma_descriptor. The constructor then unconditionally indexes those attributes here, so initialization fails with AttributeError; initialize compatible descriptor state before applying the retained-mode mask, even when the current Jacobian is supplied.
Given we never really used this feature of re-using linearisation matrices, we should create a few examples and stress test this to find the bugs. Then explicitly state how the user needs to provide the matrices in order to do solves rapidly.