Skip to content

CSTR Scaler#1680

Merged
dallan-keylogic merged 9 commits intoIDAES:scaling_toolboxfrom
bpaul4:cstr_scaler_clean
Oct 28, 2025
Merged

CSTR Scaler#1680
dallan-keylogic merged 9 commits intoIDAES:scaling_toolboxfrom
bpaul4:cstr_scaler_clean

Conversation

@bpaul4
Copy link
Contributor

@bpaul4 bpaul4 commented Oct 14, 2025

Summary/Motivation:

Scaler object for the CSTR unit model.

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.

@bpaul4 bpaul4 self-assigned this Oct 14, 2025
@bpaul4 bpaul4 requested a review from agarciadiego as a code owner October 14, 2025 19:04
@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.33%. Comparing base (657dae1) to head (8e3e293).
⚠️ Report is 12 commits behind head on scaling_toolbox.

Files with missing lines Patch % Lines
idaes/models/unit_models/cstr.py 83.87% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           scaling_toolbox    #1680   +/-   ##
================================================
  Coverage            77.33%   77.33%           
================================================
  Files                  395      395           
  Lines                64315    64344   +29     
  Branches             10781    10794   +13     
================================================
+ Hits                 49736    49760   +24     
  Misses               12081    12081           
- Partials              2498     2503    +5     

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

Copy link
Contributor

@dallan-keylogic dallan-keylogic left a comment

Choose a reason for hiding this comment

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

Looks good. You just need to remove some commented code and merge scaling_toolbox.

Comment on lines 86 to 109
# self.call_submodel_scaler_method(
# submodel=model.control_volume.properties_in,
# method="variable_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
# self.propagate_state_scaling(
# target_state=model.control_volume.properties_out,
# source_state=model.control_volume.properties_in,
# overwrite=overwrite,
# )

# self.call_submodel_scaler_method(
# submodel=model.control_volume.properties_out,
# method="variable_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
# self.call_submodel_scaler_method(
# submodel=model.control_volume.reactions,
# method="variable_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be removed

Comment on lines 179 to 196
# self.call_submodel_scaler_method(
# submodel=model.control_volume.properties_in,
# method="constraint_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
# self.call_submodel_scaler_method(
# submodel=model.control_volume.properties_out,
# method="constraint_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
# self.call_submodel_scaler_method(
# submodel=model.control_volume.reactions,
# method="constraint_scaling_routine",
# submodel_scalers=submodel_scalers,
# overwrite=overwrite,
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be removed.

@dallan-keylogic
Copy link
Contributor

Codecov is complaining because the scaler is tested in an integration test, not a component test. Can you just change it to a component test? (It shouldn't take too long to run).

@dallan-keylogic dallan-keylogic merged commit 6a2d831 into IDAES:scaling_toolbox Oct 28, 2025
24 checks passed
dallan-keylogic pushed a commit that referenced this pull request Nov 6, 2025
* 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
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.

2 participants