Skip to content

Comments

Utility Functions for PrOMMiS#1734

Open
dallan-keylogic wants to merge 6 commits intoIDAES:mainfrom
dallan-keylogic:prommis-util
Open

Utility Functions for PrOMMiS#1734
dallan-keylogic wants to merge 6 commits intoIDAES:mainfrom
dallan-keylogic:prommis-util

Conversation

@dallan-keylogic
Copy link
Contributor

Summary/Motivation:

I ended up creating a handful of utility functions for work in PrOMMiS that fit better in IDAES. This PR brings them in, as well as adds testing.

  • scale_time_discretization_equations is a function for scaling DerivativeVars and discretization equations en masse. This function existed for the old scaling tools, but this version is updated to not use constraint_scaling_transform.
  • copy_values_from_point is a generalization of a function I was using to copy the steady-state values from t=0 forward to other time points.
  • assert_solution_equivalent is a way to compare the solution of a model to a cached version. We would typically compare values variable-by-variable. However, that means we only see the values that changed one at a time. In order to see what else has changed, we have to run the test again or look forward in the tests checking value by value manually. This function compares all values, generates a report about which variables have changed more than their tolerances, then raises an AssertionError at the end if there are variables who changed outside their tolerances.

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 dallan-keylogic marked this pull request as ready for review February 20, 2026 21:51
@ksbeattie ksbeattie added the Priority:High High Priority Issue or PR label Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 91.37931% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.76%. Comparing base (604fa11) to head (3d23c97).

Files with missing lines Patch % Lines
idaes/core/scaling/util.py 80.43% 7 Missing and 2 partials ⚠️
idaes/core/util/testing.py 98.38% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
+ Coverage   73.73%   73.76%   +0.03%     
==========================================
  Files         398      398              
  Lines       65095    65208     +113     
  Branches    10954    10985      +31     
==========================================
+ Hits        47995    48099     +104     
- Misses      14592    14598       +6     
- Partials     2508     2511       +3     

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

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.

3 participants