-
Notifications
You must be signed in to change notification settings - Fork 59
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
Update IDAES requirement to 2.2.0.dev0.watertap.23.08.03 and other stability improvements #930
Conversation
This reverts commit f062086.
…s, passed log_k_eq_constraint equilibrium_constraint for both solubility product and common eqbm mole_frac_phase_comp
… temprature Enthalpy unit corrected
This reverts commit f062086.
…s, passed log_k_eq_constraint equilibrium_constraint for both solubility product and common eqbm mole_frac_phase_comp
… temprature Enthalpy unit corrected
…ed solubility_product
… down as an additional variable Use smooth_max from idaes utility and other minor improvements
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.
LGTM
OK- I checked whether this PR would break anything in the BSM2 flowsheet by putting up a draft PR (#1108), and all checks pass! I'll review this and suspect it'll be ready to merge soon. |
WARNING: model contains export suffix 'fs.state_block[0].scaling_factor' that | ||
contains 4 component keys that are not exported as part of the NL file. | ||
Skipping. | ||
WARNING: model contains export suffix 'fs.state_block[0].scaling_factor' that | ||
contains 4 component keys that are not exported as part of the NL file. | ||
Skipping. |
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.
This looks like something we wouldn't want showing up in the how-to
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.
- It's just in the test -- so the reader won't see it.
- I talked with @andrewlee94 about this a few weeks ago and there is not a workaround nor is one planned (IDAES and Pyomo are implementing a new model scaling framework)
@@ -304,4 +300,4 @@ jobs: | |||
pyomo build-extensions || python -c "from pyomo.contrib.pynumero.asl import AmplInterface; exit(0) if AmplInterface.available() else exit(1)" | |||
- name: Run pytest | |||
run: | | |||
pytest --pyargs watertap -k 'not nf_dspmde.nf_ui' | |||
pytest --pyargs watertap -k 'not (nf_dspmde.nf_ui or nf_dspmde.nf_with_bypass_ui)' |
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.
I suppose the alternative GUI flowsheet code was also causing checks to fail, hence it's addition here. DOes that mean the UI code for these NF flowsheets still has issues to address?
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.
IIRC this is due to a limitation of the watertap.ui.fsapi
layer for models that require the "good" (ma27
-enabled) Ipopt to solve. If the model can be initialized without failures, specifying requires_idaes_solver=True
kwarg is enough to skip the corresponding test without failures, but this doesn't work when the solve fails during initialization. Therefore, we have to exclude the entire test module using the -k not ...
pytest flag.
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.
Note -- this only applies to the macOS tests
delete commented debugging code
@@ -585,7 +619,8 @@ def test_initialize(self, model_initialize): | |||
|
|||
@pytest.fixture | |||
def model_solve(self, model, solver): | |||
results = solver.solve(model, tee=True) | |||
model.write("bah.nl", io_options={"symbolic_solver_labels": True}) |
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.
Why is this here?
@pytest.mark.component | ||
def test_ideal_naocl_chlorination_full_block(): | ||
model = run_chlorination_block_example(fix_free_chlorine=True) | ||
assert model.fs.ideal_naocl_mixer_unit.dosing_rate.value == pytest.approx( | ||
0.9504457542440085e-6, rel=1e-3 | ||
1.7296113311683092e-09, rel=1e-3 |
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.
3 order of magnitude change--not sure if this is correct due to inaccuracies in the original values used that were corrected or if this is an error itself. Without a deep dive into verifying replaced values, my guess is that this result is due to the former.
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.
dh_rxn_ref
was also corrected by three orders of magnitude above.
There's also other changes to how the solubility equilibrium constraint is implemented in IDAES IDAES/idaes-pse#1197
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.
OK, so due to the first reason I mentioned. Thanks for confirming.
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.
Just a couple comments, but overall, should be good to go.
WARNING: model contains export suffix 'fs.state_block[0].scaling_factor' that | ||
contains 4 component keys that are not exported as part of the NL file. | ||
Skipping. | ||
WARNING: model contains export suffix 'fs.state_block[0].scaling_factor' that | ||
contains 4 component keys that are not exported as part of the NL file. | ||
Skipping. |
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.
- It's just in the test -- so the reader won't see it.
- I talked with @andrewlee94 about this a few weeks ago and there is not a workaround nor is one planned (IDAES and Pyomo are implementing a new model scaling framework)
@@ -304,4 +300,4 @@ jobs: | |||
pyomo build-extensions || python -c "from pyomo.contrib.pynumero.asl import AmplInterface; exit(0) if AmplInterface.available() else exit(1)" | |||
- name: Run pytest | |||
run: | | |||
pytest --pyargs watertap -k 'not nf_dspmde.nf_ui' | |||
pytest --pyargs watertap -k 'not (nf_dspmde.nf_ui or nf_dspmde.nf_with_bypass_ui)' |
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.
Note -- this only applies to the macOS tests
@pytest.mark.component | ||
def test_ideal_naocl_chlorination_full_block(): | ||
model = run_chlorination_block_example(fix_free_chlorine=True) | ||
assert model.fs.ideal_naocl_mixer_unit.dosing_rate.value == pytest.approx( | ||
0.9504457542440085e-6, rel=1e-3 | ||
1.7296113311683092e-09, rel=1e-3 |
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.
dh_rxn_ref
was also corrected by three orders of magnitude above.
There's also other changes to how the solubility equilibrium constraint is implemented in IDAES IDAES/idaes-pse#1197
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.
LGTM
Fixes #929, Fixes #1072
Changes proposed in this PR:
clone
fromwatertap/unit_models/test/test_gac.py
for Pyomo 6.6.2 (@lxhowl)Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: