-
Notifications
You must be signed in to change notification settings - Fork 121
Change solution inform into a dataclass #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
marcomangano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See issue below:
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #437 +/- ##
==========================================
+ Coverage 86.17% 86.19% +0.02%
==========================================
Files 24 24
Lines 3406 3413 +7
==========================================
+ Hits 2935 2942 +7
Misses 471 471 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ewu63
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look OK. However, I have a slightly different implementation idea: what if we made SolutionInform an IntEnum which is created for each optimizer class, and the final outcome is an instance of this class which is the actual exit condition? I think that would lead to a slightly cleaner design. However, in the longer term I would actually prefer not storing this inform mapping ourselves since optimizers may change it up over time and we should not need to maintain it (esp when supporting multiple optimizer versions). So maybe it's not worth it.
|
I agree with @ewu63 minor comments but I think that other than that this PR could move forward. I see how the I see how the |
|
@ewu63 you beat me on time. I followed back the commits and saw you added the This LGTM, but just a couple of things:
|
|
I did rename |
|
Sounds good. This and the unconstrained test PR are enough for a patch release. I will look at the other PR later today, we should merge that first since you already bumped the version here. |
|
Sorry for the absence on this. @ewu63 thanks for updating the PR. Maybe I misunderstood your earlier comment, but was it your intent to change |
|
I guess there was some rebase issues, I renamed the variables but left everything else intact. I agree that we should discuss naming conventions in mdolab/.github#66. The PR is now ready. |
|
Uhh so technically this was no longer backwards compatible -- users can no longer access the previous fields, e.g. |
|
Ah, yeah you are right, this is breaking backwards compatibility. I dont know how many are accessing this information from the |
Purpose
Realized I had this lying around locally from an earlier development. This PR replaces the standard
dictwith adataclassthat gets passed and used to print the optimizer exit code and the associated text. Functionally, there is should be no difference.Additionally, slipped in one small update to the warning, printing the pyoptsparse versions that's in use and the one that the history was generated with. Can make this as separate PR if needed.
Expected time until merged
No rush
Type of change
Testing
Checklist
flake8andblackto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable