Change from %r to %s for NumPy 2.0 compatibility#3353
Conversation
|
Thanks, @orthorhombic ! Could you do me a favor and add a small test that ensures the right behavior is happening? Tests for the NL writer can be found in: https://github.com/Pyomo/pyomo/tree/main/pyomo/repn/tests/ampl <- most likely the If you need help, let us know. |
|
@orthorhombic: Thank you for catching & resolving this! This is an important catch / fix ... I took the liberty of resolving a merge conflict and adding a test so that we can get this reviewed and merged for the next release (tomorrow!!). |
jsiirola
left a comment
There was a problem hiding this comment.
Approved, pending successful tests.
|
Sorry I'm just catching up on messages here. Thanks for the quick turnaround, and that this could make it into the next release! If anything comes up, I can take a look a bit later. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3353 +/- ##
=======================================
Coverage 88.59% 88.60%
=======================================
Files 874 874
Lines 99124 99124
=======================================
+ Hits 87822 87831 +9
+ Misses 11302 11293 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Fixes #3352
Summary/Motivation:
This changes %r to %s in the nl_writer for NumPy 2.0 compatibility. I believe this was missed in #3292
Changes proposed in this PR:
const = 'n%r\n'gets changed toconst = 'n%s\n'Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: