Skip to content

Modular Properties Inherent Reaction Scaling#1696

Merged
dallan-keylogic merged 12 commits intoIDAES:scaling_toolboxfrom
dallan-keylogic:modular_properties_inherent_reaction_scaler
Nov 6, 2025
Merged

Modular Properties Inherent Reaction Scaling#1696
dallan-keylogic merged 12 commits intoIDAES:scaling_toolboxfrom
dallan-keylogic:modular_properties_inherent_reaction_scaler

Conversation

@dallan-keylogic
Copy link
Contributor

Summary/Motivation:

Scaling for electrolytes and inherent reactions for the modular property framework.

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
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.43%. Comparing base (9094267) to head (3fa1e99).
⚠️ Report is 2 commits behind head on scaling_toolbox.

Files with missing lines Patch % Lines
...erties/modular_properties/base/generic_property.py 91.04% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           scaling_toolbox    #1696      +/-   ##
===================================================
+ Coverage            77.40%   77.43%   +0.03%     
===================================================
  Files                  395      395              
  Lines                64629    64691      +62     
  Branches             10859    10879      +20     
===================================================
+ Hits                 50026    50095      +69     
+ Misses               12093    12088       -5     
+ Partials              2510     2508       -2     

☔ 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.

@dallan-keylogic dallan-keylogic marked this pull request as ready for review October 31, 2025 19:39
@bpaul4 bpaul4 self-requested a review October 31, 2025 20:00
"""
# Autoscaling for constraints from a true species basis
# was not implemented in the legacy scaling tools.
# Use default scaling until we can rework the true to apparent
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO here.



# TODO: Set a default state definition
# TODO: Need way to dynamically determine units of measurement....
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the UOM be determined from the constraint itself, or using flow basis and/or stoichiometry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what this TODO is about. At any rate, fixing it is outside the scope of this PR.

"""
Method returning density of water
"""
return 55e3
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have UOM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it, but I don't think it matters.

"""
Dummy method for testing
"""
return 42
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question, since this is used for enthalpy below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer not to. Frequently in test files like this, this method gets used for multiple properties with incompatible units, even if it is just used for enthalpy here.

Comment on lines +121 to +123
# "state_definition": None,
# "state_bounds": None,
# "state_components": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these commented-out lines here on purpose, or should we remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're here on purpose, to make it clear these are fields that need to be set by the individual test to make that config work.

Copy link
Contributor

Choose a reason for hiding this comment

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

I might just change "elsewhere" to "by the user". Right now, I think the wording is ambiguous as to whether it's being automatically specified somewhere else or if the user actually needs to specify themselves.

Comment on lines +206 to +208
# "state_definition": None,
# "state_bounds": None,
# "state_components": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as earlier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as earlier on the "specified elsewhere"

Config dictionaries used in testing of electrolyte states with and without
inherent reactions.

Authors: Andrew Lee, Douglas Allan
Copy link
Contributor

Choose a reason for hiding this comment

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

Just you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this file is 95% code copy-and-pasted from test files that Andrew wrote, I wanted to keep him as an author.

Comment on lines +121 to +123
# "state_definition": None,
# "state_bounds": None,
# "state_components": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

I might just change "elsewhere" to "by the user". Right now, I think the wording is ambiguous as to whether it's being automatically specified somewhere else or if the user actually needs to specify themselves.

Comment on lines +206 to +208
# "state_definition": None,
# "state_bounds": None,
# "state_components": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as earlier on the "specified elsewhere"

Comment on lines 1304 to 1305
def dens_mol_h2o(*args, **kwargs):
return 55e3
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this even being called anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was an artifact from before I extracted the config dictionaries to a separate file.

Copy link
Contributor

@MarcusHolly MarcusHolly left a comment

Choose a reason for hiding this comment

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

LGTM, although some of the other test files still have the dens_mol_H2O that needs to be deleted

@dallan-keylogic dallan-keylogic merged commit cde98c8 into IDAES:scaling_toolbox Nov 6, 2025
73 of 74 checks passed
@dallan-keylogic dallan-keylogic deleted the modular_properties_inherent_reaction_scaler branch November 6, 2025 15:15
dallan-keylogic added a commit that referenced this pull request Nov 6, 2025
* combintorial explosion

* finish scaler

* extract electrolyte testing config

* fire test

* Pylint

* unused import

* no longer unreachable code

* review comments

* reviewer comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants