Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding initial support for v2 solvers #1384

Closed
wants to merge 38 commits into from

Conversation

andrewlee94
Copy link
Member

@andrewlee94 andrewlee94 commented Mar 22, 2024

First part of new scaling

Summary/Motivation:

This PR adds the first infrastructure to allow us to test the new IPOPT infterface using get_solver. For now, scaling is turned off as we expect this to cause issues, and we will first switch to using ipopt_v2 with only the presolve.

Changes proposed in this PR:

  • Add ipopt_v2 default options to the IDAES config
  • Add logic to the IDAES SolverWrapper to handle v2 solvers

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.

@andrewlee94 andrewlee94 self-assigned this Mar 22, 2024
@andrewlee94 andrewlee94 added scaling_v2 enhancement New feature or request Priority:Normal Normal Priority Issue or PR core Issues dealing with core modeling components labels Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

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

❗ No coverage uploaded for pull request base (scaling_v2@88553c1). Click here to learn what that means.

Files Patch % Lines
idaes/core/solvers/config.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             scaling_v2    #1384   +/-   ##
=============================================
  Coverage              ?   77.58%           
=============================================
  Files                 ?      391           
  Lines                 ?    64398           
  Branches              ?    14266           
=============================================
  Hits                  ?    49963           
  Misses                ?    11851           
  Partials              ?     2584           

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

mrmundt and others added 5 commits April 2, 2024 11:21
…1389)

* Empty commit to verify failures on main

* Resolve likely false positives

* Resolve likely true positives

* Resolve probable true positive

* Remove "frst" from typos exclusions

* Remove "ans" from typos exclusions b/c crate-ci/typos#981
* outputs

* fix hyperlink

* put this back

* put this back2

* replace with simple hyperlink
* Updating black and rerunning it on all files

* Remove duplicated Black requirement

* Update Black rev in pre-commit config

---------

Co-authored-by: Ludovico Bianchi <[email protected]>
Andrew Lee and others added 26 commits April 10, 2024 11:43
* Catching unneccessary terms in lagrange multiplier expression

* Better implementation

* Adding tests for filtering inert elements
* Adding support for indexed variables in parameter sweep

* Adding test for indexed vars
* Adding attributes to hold units used by MSContactor

* Removing unneccessary argument and fixing tests
* add unit models

* edits

* changes

* Code cleaning

* Fix initialization

* Begin adding tests

* changes

* test units

* fix pressure drop unit issue

* Moving towards heater testing

* move changes from other branch

* format remaining file

* separate 1d hx changes

* Fix pylint errors

* more pylint issues

* remove elevation change

* run black

* get rid of commented code

* Fix typo

* At Andrew's insistence, make methods public

* address more of Andrew's comments

* Update initialization to new form

* documentation

* Documentation in progress

* remove debugging

* Documentation

* pitch

* polishing step

* run black

* new black version

* culling common

* Docstrings and merges

* spelling

* pylint

* more Andrew suggestions

* run Black

* pylint

* no more values
…DAES#1385)

* update imports of native_types and pyomo_constant_types (which is deprecated)

* Adding next batch of diagnostics tests

* Next batch of daignsotics tests

* Work around for ASL issue

* Adding more diagnostics checks

* Last unit model diagnostics tests

* Fixing typo

* Improving fix for ASL issue

* Better implementation of fix

* Fixing pylint and Python 3.8 failures

* Removing old implementation of workaround

* Fixing noisy test

* Moving registration of external functions

* Reverting to version that works on Windows

* Trying another way to get binary files

* add parallel variable/constraint checks to report_numerical_issues; change default parallel tolerance to 1e-8

* update tests

* tighten parallel_component_tolerance to 1e-8

* adjust model to make parallel variable test less sensitive

* update test to reflect new default tolerance of 1e-8

* consistent format for displaying parallel tolerance

---------

Co-authored-by: Andrew Lee <[email protected]>
* Fix grid integration class names

* Fixing pytest marks and more TestClass names

* Fixing some regexes

* Fixing returns in tests

* Cleaning up surrogte plotting tests

* Fixing plotting modifications

* Fixing some re.escapes

* Fixing misused pytest fixtures

* Fixing more re.escapes

* Hopefully the last re.escapes

* Missed re.escape

* Fixing typo
* Renaming Block classes

* Fixing instances of _General

* Fixing other _Data classes

* Some clean up

* bumping Pyomo tag

* Updating docs

* Excluding pylint no-member warnings

* Fixing pylint issue

* Fixing another pylint issue
* Bumping Pyomo tag

* Update pyomo tag to 6.7.2 release

---------

Co-authored-by: Ludovico Bianchi <[email protected]>
Comment on lines -17 to -26
import idaes.logger as idaeslog
from idaes.apps.caprese.util import initialize_by_element_in_range
from idaes.apps.caprese.common.config import (
ControlPenaltyType,
)
from idaes.apps.caprese.common.config import VariableCategory as VC
from idaes.apps.caprese.categorize import (
categorize_dae_variables,
CATEGORY_TYPE_MAP,
)
Copy link
Member

Choose a reason for hiding this comment

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

I assume these are all unused imports being removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - I generally clean these up as I find them.

@andrewlee94
Copy link
Member Author

Closing this as it is out of date and will be replaced by a new PR that also selectively activates the new presolver.

@andrewlee94 andrewlee94 deleted the scaling_v2 branch June 13, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues dealing with core modeling components enhancement New feature or request Priority:Normal Normal Priority Issue or PR scaling_v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants