Skip to content

Conversation

@dallan-keylogic
Copy link
Contributor

Fixes

-- Corrects VLE initialization behavior when only Henry components are present
-- Raises an exception when given a VLE with no components in both phases

Summary/Motivation:

Addresses #1577

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.

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.87%. Comparing base (6291747) to head (be811e2).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...erties/modular_properties/base/generic_property.py 0.00% 2 Missing ⚠️
...rties/modular_properties/state_definitions/FTPx.py 71.42% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1578      +/-   ##
==========================================
+ Coverage   76.86%   76.87%   +0.01%     
==========================================
  Files         394      394              
  Lines       63246    63248       +2     
  Branches    10360    10361       +1     
==========================================
+ Hits        48611    48622      +11     
+ Misses      12187    12186       -1     
+ Partials     2448     2440       -8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Feb 27, 2025
Copy link
Contributor

@bpaul4 bpaul4 left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@ksbeattie ksbeattie linked an issue Mar 20, 2025 that may be closed by this pull request
@ksbeattie ksbeattie requested a review from adam-a-a March 27, 2025 18:19
pp_VLE = pp

if init_VLE:
if num_VLE == 1: # Only support initialization when a single VLE is present
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an else clause if num_VLE somehow exceeds 1, where either an exception is raised or a warning is logged?

Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

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

I only have one question on whether we should handle the scenario where num_VLE > 1 by raising an exception or at least logging a warning. It may be the case that num_VLE can never be >1 because it is caught elsewhere, but I didn't do a deep enough to dive to check that.

@dallan-keylogic
Copy link
Contributor Author

I only have one question on whether we should handle the scenario where num_VLE > 1 by raising an exception or at least logging a warning. It may be the case that num_VLE can never be >1 because it is caught elsewhere, but I didn't do a deep enough to dive to check that.

It's possible, in theory, for there to be multiple VLE if we have a vapor/liquid/liquid system. That's why the exception isn't raised. Such a system isn't explicitly supported at the moment, but a user who knows what they're doing could probably set one up.

@adam-a-a
Copy link
Contributor

adam-a-a commented Apr 1, 2025

I only have one question on whether we should handle the scenario where num_VLE > 1 by raising an exception or at least logging a warning. It may be the case that num_VLE can never be >1 because it is caught elsewhere, but I didn't do a deep enough to dive to check that.

It's possible, in theory, for there to be multiple VLE if we have a vapor/liquid/liquid system. That's why the exception isn't raised. Such a system isn't explicitly supported at the moment, but a user who knows what they're doing could probably set one up.

In that case, we should at least log a warning (or possibly raise a NotImplementedError that an advanced user could bypass with a try-except clause).

@dallan-keylogic
Copy link
Contributor Author

At this point, I'm inclined to merge this with or without Codecov's approval. I first created a warning to implement @adam-a-a 's suggestion, but I found I couldn't test it because initialization throws an exception if constraints have large residuals at the end. Before that, however, I had to correct an issue in which results was undefined in the initialization routine for the tortured model I had to use to test this issue.

@idaes-build idaes-build removed the CI:run-integration triggers_workflow: Integration label Apr 10, 2025
@dallan-keylogic dallan-keylogic added the CI:run-integration triggers_workflow: Integration label Apr 11, 2025
@idaes-build idaes-build removed the CI:run-integration triggers_workflow: Integration label Apr 11, 2025
@dallan-keylogic dallan-keylogic merged commit ea5190b into IDAES:main Apr 11, 2025
43 of 44 checks passed
@dallan-keylogic dallan-keylogic deleted the vle_init_fix branch April 11, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority:Normal Normal Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue within state initialisation of modular FTPx state definition

6 participants