Skip to content

Fix BFGS reset logic in relaxation.py#9

Open
LorenzoGottardi1210 wants to merge 1 commit into
west-code-development:masterfrom
LorenzoGottardi1210:LorenzoGottardi1210-patch-1
Open

Fix BFGS reset logic in relaxation.py#9
LorenzoGottardi1210 wants to merge 1 commit into
west-code-development:masterfrom
LorenzoGottardi1210:LorenzoGottardi1210-patch-1

Conversation

@LorenzoGottardi1210

Copy link
Copy Markdown

Fixed a bug where self.inv_hess was being overwritten with None during a BFGS reset.

The previous implementation called self.inv_hess = self._reset_bfgs(), but since the method lacked a return statement, it assigned None to the Hessian matrix. This caused a TypeError in the subsequent np.dot calculation.

Updated the call to self._reset_bfgs() as a standalone method, which correctly updates the internal state without nullifying the variable.

Fixed a bug where self.inv_hess was being overwritten with None during a BFGS reset.

The previous implementation called self.inv_hess = self._reset_bfgs(), but since the method lacked a return statement, it assigned None to the Hessian matrix. This caused a TypeError in the subsequent np.dot calculation.

Updated the call to self._reset_bfgs() as a standalone method, which correctly updates the internal state without nullifying the variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant