Skip to content

Comments

Scaling overhaul#1662

Merged
dallan-keylogic merged 26 commits intomainfrom
scaling_toolbox
Nov 6, 2025
Merged

Scaling overhaul#1662
dallan-keylogic merged 26 commits intomainfrom
scaling_toolbox

Conversation

@dallan-keylogic
Copy link
Contributor

Summary/Motivation:

This PR is to compare the work we're doing on the feature branch scaling_toolbox with main and to run the CI tests we have to allow us to view CodeCov reports.

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.

dallan-keylogic and others added 4 commits August 15, 2025 14:20
* rescue files from overloaded git branch

* fix due to api tweaks

* run black

* forgot to add a file

* fix test errors

* pin coolprop version

* update version, disable superancillaries

* run black

* respond to Marcus's feedback

* getting close

* address Will's comments

* tests for set_scaling_factor

* support for unions in python 3.9

* testing the scaling profiler is way too fragile

* modify test to be less fragile

* remove pdb
* rescue files from overloaded git branch

* fix due to api tweaks

* run black

* forgot to add a file

* fix test errors

* pin coolprop version

* update version, disable superancillaries

* run black

* respond to Marcus's feedback

* getting close

* address Will's comments

* tests for set_scaling_factor

* support for unions in python 3.9

* testing the scaling profiler is way too fragile

* modify test to be less fragile

* remove pdb

* rescue files from branch

* towards scaling cv

* preliminary testing

* scaling by defn constraint

* scale constraint by definition constraint

* Disable obsolete tests for now

* run black

* actually add tests

* inh

* tests for methods rescued from old scaling tools

* pylint

* test to make sure that value is reverted

* Apply suggestions from code review

spelling fixes

Co-authored-by: Brandon Paul <[email protected]>

* additional clarity

* more files rescued from branch

---------

Co-authored-by: Brandon Paul <[email protected]>
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 88.45316% with 212 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.45%. Comparing base (e4e51fe) to head (cde98c8).
⚠️ Report is 35 commits behind head on main.

Files with missing lines Patch % Lines
...erties/modular_properties/base/generic_property.py 82.83% 27 Missing and 19 partials ⚠️
idaes/core/base/control_volume_base.py 90.82% 12 Missing and 7 partials ⚠️
idaes/core/scaling/util.py 90.68% 8 Missing and 11 partials ⚠️
...rties/modular_properties/phase_equil/bubble_dew.py 74.62% 10 Missing and 7 partials ⚠️
...dular_properties/reactions/equilibrium_constant.py 51.85% 10 Missing and 3 partials ⚠️
idaes/core/scaling/custom_scaler_base.py 93.54% 6 Missing and 4 partials ⚠️
...erties/modular_properties/base/generic_reaction.py 74.35% 2 Missing and 8 partials ⚠️
idaes/models/unit_models/mscontactor.py 95.93% 2 Missing and 8 partials ⚠️
idaes/models/unit_models/mixer.py 79.54% 5 Missing and 4 partials ⚠️
idaes/core/scaling/scaling_base.py 69.56% 5 Missing and 2 partials ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1662      +/-   ##
==========================================
+ Coverage   77.11%   77.45%   +0.33%     
==========================================
  Files         395      395              
  Lines       62909    64760    +1851     
  Branches    10274    10897     +623     
==========================================
+ Hits        48514    50157    +1643     
- Misses      11985    12092     +107     
- Partials     2410     2511     +101     

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

* error for unnamed expressions

* pylint

* default is warning=False

* make sure expression walker doesn't emit warnings

* rescue files from different branch

* tests for scaler base get_scaling_factor
@dallan-keylogic dallan-keylogic marked this pull request as ready for review September 16, 2025 17:34
@dallan-keylogic dallan-keylogic marked this pull request as draft September 16, 2025 17:35
@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Sep 18, 2025
dallan-keylogic and others added 3 commits September 23, 2025 16:40
* error for unnamed expressions

* pylint

* default is warning=False

* make sure expression walker doesn't emit warnings

* fix get_default_scaling_factor

* no build on demand

* not every component has lock attribute creation context

* rescue files from different branch

* avoid duplicate code and add tests

* remove unused variable

* fix spelling

* pylint

* changes suggested from review

---------

Co-authored-by: Bethany Nicholson <[email protected]>
* rescue files from overloaded git branch

* fix due to api tweaks

* run black

* forgot to add a file

* fix test errors

* pin coolprop version

* update version, disable superancillaries

* run black

* respond to Marcus's feedback

* getting close

* address Will's comments

* tests for set_scaling_factor

* support for unions in python 3.9

* testing the scaling profiler is way too fragile

* modify test to be less fragile

* remove pdb

* rescue files from branch

* towards scaling cv

* preliminary testing

* scaling by defn constraint

* scale constraint by definition constraint

* Disable obsolete tests for now

* run black

* actually add tests

* inh

* tests for methods rescued from old scaling tools

* pylint

* test to make sure that value is reverted

* Apply suggestions from code review

spelling fixes

Co-authored-by: Brandon Paul <[email protected]>

* additional clarity

* more files rescued from branch

* rescue files from other branch

* first tests

* tests

* additional scaling

* more tests

* fixes

* run black

* black on forgotten file

* fix failing tests

* fix issues when initializing FpcTP

* begin scaling for cubic complementarity vle

* error for unnamed expressions

* pylint

* enthalpy of formation test

* default is warning=False

* make sure expression walker doesn't emit warnings

* Cubic complementarity VLE test

* avoid auto-construction and run black

* new scaling for test_BTIdeal_FcTP

* BT ideal test

* regularly scheduled scaling has been interrupted by a bug in scaling core

* fix get_default_scaling_factor

* tests for one more example ported

* delegate scaling for solubility product forms

* test FcPh

* test FcTP

* test_FpcTP

* test FTPx

* FPhx

* no build on demand

* not every component has lock attribute creation context

* no more enth_mol_phase

* run black

* move to scaler object get scaling factor for future extension

* get rid of remaing gsf and pylint changes

* Actually scale cubic complementarity VLE and pylint

* rescue files from different branch

* tests for scaler base get_scaling_factor

* remove dependency on fix_gdsf

* pylint

* maybe pylint will like this better

* Is this acceptable to both pylint and black?

* stash

* fix failing test

* black

* pylint

* minor tweaks

* increase test coverage

* avoid generation of properties

* more test coverage for IdealBubbleDew

* Renaming and comments

* fix wrong constraint scaling method

* reply to review comments

* revert legacy test

* failing test

* improve error message

* update authors

* forgot to save file

* fix exception match

* Let's see if three solves is enough

* less strict complementarity

* xfail

---------

Co-authored-by: Brandon Paul <[email protected]>
@ksbeattie ksbeattie added Priority:High High Priority Issue or PR and removed Priority:Normal Normal Priority Issue or PR labels Oct 9, 2025
Ryan-Hughes-8 and others added 12 commits October 14, 2025 14:12
* adding rstoic and pressure changer scalers and tests

* updating pressure changer tests

* changing turbine test case

* more pressure changer tests

* rstoic test cleanup and comment cleanup

* remove work_mechanical from pressure changer scaler

* added 'propagate_state_scaling' for isentropic properties

* added scaling factor tests for rstoic

* Apply suggestion from @dallan-keylogic

Make sure `overwrite` option is correctly passed

---------

Co-authored-by: dallan-keylogic <[email protected]>
* additional test for propagating scaling factors within a block

* Control Volume 1D scaler

* phase material balance cv0d

* test for submodel scaler for blockdata

* Tests for flow direction attribute

* black and typo

* remove unused variables

* protected property error message depends on python version

* test no override

* test propagate scaling factors

* additional test coverage
* additional test for propagating scaling factors within a block

* Control Volume 1D scaler

* phase material balance cv0d

* test for submodel scaler for blockdata

* Tests for flow direction attribute

* black and typo

* remove unused variables

* protected property error message depends on python version

* test no override

* test propagate scaling factors

* additional test coverage

* Mixer scaler

* test with inherent reactions

* test inlet_blocks

* Pylint

* Apply suggestion from @bpaul4

Co-authored-by: Brandon Paul <[email protected]>

* default_scaler attribute should live on indexed block

* Apply suggestion from @dallan-keylogic

* Apply suggestion from @dallan-keylogic

---------

Co-authored-by: Brandon Paul <[email protected]>
* rescue mscontactor scaler from branch

* test geometry scaling

* dynamics scaling

* Energy balance testing

* test inherent reaction scaling

* final stage of tests

* run black

* pylint
* tweak scale_variable_by_definition_constraint to take scaling hints into account

* pin pyomo

* unused import

* failing test

* additional coverage

* expressions no hints

* respond to reviewer comments

* more reviewer comments
* rescue from old branch

* change methodology to get reference state

* beginning testing

* more tests

* round out separator scaling testing

* extract leach solution properties

* ideal separation and inherent reaction tests

* flash tests

* run black

* cull unused imports

* test failures and unused code

* Fully breaks dependence on ControlVolumeScalerBase

* remove defunct scaler

* black

* respond to Marcus's comments

* docstring
* cstr scaler class and tests

* scale reaction variable to reduce jacobian

* remove additional scaler class

* run black

* remove unused imports for pylint

* switch scaler to CV to improve jacobian, clean up old tests

* remove commented code

* change scaler test to component test
* Scalers objects for the FeedFlash

* Update feed_flash.py
* stash

* scaler object for Helmholtz properties

* increase codecov

* review

* unused imports
* scalers for the hx1d and pfr

* add xfail back
dallan-keylogic and others added 6 commits October 30, 2025 08:35
* rescue from old branch

* change methodology to get reference state

* beginning testing

* more tests

* round out separator scaling testing

* extract leach solution properties

* ideal separation and inherent reaction tests

* flash tests

* run black

* cull unused imports

* test failures and unused code

* Fully breaks dependence on ControlVolumeScalerBase

* remove defunct scaler

* black

* Scaler for feed, product, and state junction

* respond to Marcus's comments
* stash

* scaler object for Helmholtz properties

* increase codecov

* stash

* sl separator scaler

* Valve scaler

* spelling mistake

* unused import

* get rid of commented code

* minor change to reset diffs

* pylint changes
* feat: add 0d heat exchanger scaler

* HX0D scaling

* heater scaler

* attribution

* pylint

* avoid reliance on integration tests

* review

* minor change to reset diffs

* revert minor change

---------

Co-authored-by: strahlw <[email protected]>
* first steps to make diagnostics toolbox work with scaling factors

* include scaling in model diagnostics

* switch get_scaling_factor to using the suffix finder

* change in functionality

* Suffix is no longer generated from get_scaling_factor

* Update idaes/core/scaling/util.py

Co-authored-by: MarcusHolly <[email protected]>

---------

Co-authored-by: MarcusHolly <[email protected]>
* combintorial explosion

* finish scaler

* extract electrolyte testing config

* fire test

* Pylint

* unused import

* no longer unreachable code

* review comments

* reviewer comments
@dallan-keylogic dallan-keylogic added the CI:run-integration triggers_workflow: Integration label Nov 6, 2025
@idaes-build idaes-build removed the CI:run-integration triggers_workflow: Integration label Nov 6, 2025
@dallan-keylogic dallan-keylogic marked this pull request as ready for review November 6, 2025 16:42
@dallan-keylogic dallan-keylogic merged commit ee67e29 into main Nov 6, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority:High High Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants