-
Notifications
You must be signed in to change notification settings - Fork 238
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
Activating IPOPT_V2 with presolver #1436
Changes from 4 commits
528a4f7
0faabba
47d9d73
47beac6
c39f256
04f1463
3ce08dd
4aa1405
7353472
e88bd83
d5135f4
9ccc8b4
9423501
6754964
f6079ca
ad475fd
dda16b3
bc8e411
4273e24
542914a
6578d01
84e9d69
6a66e13
2df54c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,13 +59,17 @@ def get_solver( | |
solver_obj = idaes.core.solvers.SolverWrapper(solver, register=False)() | ||
|
||
if isinstance(solver_obj, LegacySolverWrapper): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is unfortunate that we need to have this test here: the whole point of the Legacy interface is that you shouldn't have to change your code. Is there a reason why you can't just do: if options is not None:
for k, v in options.items():
solver_obj.options[k] = v
if writer_config is not None:
for k, v in writer_config.items():
solver_obj.config.writer_config[k] = v for both new and old solvers? If there writer_config is not None for an old solver, it should just generate an error when you try to set the value on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can definitely try (and this is why I was waiting for your review). |
||
# New solver interface. | ||
# LegacySolverWrapper is a wrapper for the new solver interface that makes it | ||
# backward compatible. | ||
if options is not None: | ||
for k, v in options.items(): | ||
solver_obj.options[k] = v | ||
if writer_config is not None: | ||
for k, v in writer_config.items(): | ||
solver_obj.config.writer_config[k] = v | ||
else: | ||
# Old solver interface | ||
if options is not None: | ||
solver_obj.options.update(options) | ||
if writer_config is not None: | ||
|
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.
What's the difference between the
doc
anddescription
fields, anyway?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.
Long (
doc
) and short (description
) doc strings - which one shows up depends on exactly what you use to display the config block/value.