Commit 449b7c1
Fix NaN validation to reject NaN for Parameters while allowing for Variables (#127)
Parameters should raise ValueError when assigned NaN values, but Variables
need to allow NaN for NLP structural Jacobian/Hessian computation. The
previous code allowed NaN for all Leaf types, breaking upstream test
test_nan_in_parameter_raises.
The fix checks self.variables() to distinguish Variables (returns [self])
from Parameters (returns []).
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5382605 commit 449b7c1
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
605 | 605 | | |
| 606 | + | |
606 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
607 | 612 | | |
608 | 613 | | |
609 | 614 | | |
| |||
0 commit comments