Skip to content
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-pse requirement in preparation to 2.1 release #1034

Merged
merged 48 commits into from
Jun 30, 2023

Conversation

lbianchi-lbl
Copy link
Contributor

@lbianchi-lbl lbianchi-lbl commented May 18, 2023

TODO

Leave this PR open until the following PRs have been merged, and check that those changes are compatible with IDAES 2.1/Pyomo 6.6

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@lbianchi-lbl lbianchi-lbl self-assigned this May 18, 2023
@ksbeattie ksbeattie added the Priority:High High Priority Issue or PR label May 25, 2023
@andrewlee94
Copy link
Collaborator

The reason the tests are failing is because these specific tests are using the new Initilaizer objects in IDAES, but the property packages in use have not implemented the necessary fix_initialization_states methods.

This method needs to be implemented in the property packages, and needs to set the state blocks into a square form - generally fix the state variables and if necessary deactivate constraints that cannot be used when the states are fixed (e.g., sum of mole fractions). This is basically the same as the first step(s) of the older initialize methods. Note that this method does not need to return anything (unlike older implementations) as the Initializer is recording the initial state itself.

@lbianchi-lbl lbianchi-lbl linked an issue Jun 1, 2023 that may be closed by this pull request
4 tasks
@ksbeattie ksbeattie added the IDAES label Jun 8, 2023
@agarciadiego
Copy link
Contributor

@lbianchi-lbl I'm running this tests in IDAES 2.1 so some may fail if we are still using 2.0 in this branch. (haven't finished all the corrections)

setup.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Attention: Patch coverage is 85.36585% with 6 lines in your changes missing coverage. Please review.

Project coverage is 95.53%. Comparing base (e1fde51) to head (700b024).
Report is 276 commits behind head on main.

Files with missing lines Patch % Lines
watertap/property_models/NDMA_prop_pack.py 80.00% 1 Missing ⚠️
watertap/property_models/NaCl_T_dep_prop_pack.py 80.00% 1 Missing ⚠️
watertap/property_models/NaCl_prop_pack.py 80.00% 1 Missing ⚠️
watertap/property_models/cryst_prop_pack.py 80.00% 1 Missing ⚠️
watertap/property_models/seawater_prop_pack.py 80.00% 1 Missing ⚠️
watertap/property_models/water_prop_pack.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1034   +/-   ##
=======================================
  Coverage   95.53%   95.53%           
=======================================
  Files         318      318           
  Lines       30966    31002   +36     
=======================================
+ Hits        29584    29619   +35     
- Misses       1382     1383    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@agarciadiego
Copy link
Contributor

@lbianchi-lbl all the test pass in Windows and Linux. I don't know where the E ModuleNotFoundError: No module named 'nbconvert' is coming from

@lbianchi-lbl
Copy link
Contributor Author

@lbianchi-lbl all the test pass in Windows and Linux. I don't know where the E ModuleNotFoundError: No module named 'nbconvert' is coming from

@agarciadiego that's a dependency that used to be included with IDAES, but has been removed as part of IDAES/idaes-pse#1133. Adding it back as a testing dependency should resolve those failures.

@@ -80,7 +80,7 @@
# primary requirements for unit and property models
# maintainers: switch to SPECIAL_DEPENDENCIES_FOR_RELEASE when cutting a release of watertap
*SPECIAL_DEPENDENCIES_FOR_PRERELEASE,
"pyomo>=6.2,<6.6", # (also needed for units in electrolyte database (edb))
"pyomo>=6.6.1", # (also needed for units in electrolyte database (edb))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"pyomo>=6.6.1", # (also needed for units in electrolyte database (edb))
"pyomo<=6.6.1", # (also needed for units in electrolyte database (edb))

Any reason why this shouldn't be as suggested? Would tests fail using a version of pyomo below 6.6.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Pyomo 6.6.0 has known issues that affect us, namely Pyomo/pyomo#2844 and IDAES/idaes-pse#1191. Both have been resolved in Pyomo 6.6.1.

)
assert value(model.fs.Treated.conc_mass_comp[0, "X_PHA"]) == pytest.approx(
2.1218e-9, abs=1e-4
8.981e-5, abs=1e-4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X_PHA changed by 4 orders of magnitude but am unsure why.

@agarciadiego
Copy link
Contributor

@lbianchi-lbl @bknueven Do you have any objections to me skipping the mac tests for the tests that are failing?

@lbianchi-lbl
Copy link
Contributor Author

@lbianchi-lbl @bknueven Do you have any objections to me skipping the mac tests for the tests that are failing?

No objections from me. Skip away!

@lbianchi-lbl lbianchi-lbl marked this pull request as ready for review June 22, 2023 20:47
Copy link
Contributor

@bknueven bknueven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously there's a few things to investigate here, but I would be in favor of going ahead with this as-is.

@lbianchi-lbl
Copy link
Contributor Author

lbianchi-lbl commented Jun 30, 2023

It seems that merging in #1062 resulted in some test failures on Windows.

  • pytest:
    image
  • Jupyter notebook:
    image

Any thoughts on what could be done to try to address these? @adam-a-a @avdudchenko (based on the commits on #1062).

@lbianchi-lbl lbianchi-lbl merged commit 665254c into watertap-org:main Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDAES Priority:High High Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve compatibility issues with IDAES 2.1.0/Pyomo 6.6.1
6 participants