Skip to content

Commit

Permalink
Updating name of check_ill_conditioning
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee94 committed Jan 25, 2024
1 parent 1e92d90 commit f08c298
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion idaes/core/util/model_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,7 @@ def check_parallel_jacobian(model, tolerance: float = 1e-4, direction: str = "ro
return parallel


def check_ill_conditioning(
def compute_ill_conditioning_certificate(
model,
target_feasibility_tol: float = 1e-06,
ratio_cutoff: float = 1e-04,
Expand Down
12 changes: 6 additions & 6 deletions idaes/core/util/tests/test_model_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
_write_report_section,
_collect_model_statistics,
check_parallel_jacobian,
check_ill_conditioning,
compute_ill_conditioning_certificate,
)
from idaes.core.util.testing import _enable_scip_solver_for_testing

Expand Down Expand Up @@ -3099,7 +3099,7 @@ def test_invalid_direction(self):
match="Unrecognised value for direction \(foo\). "
"Must be 'row' or 'column'.",
):
check_ill_conditioning(m, direction="foo")
compute_ill_conditioning_certificate(m, direction="foo")

@pytest.fixture(scope="class")
def model(self):
Expand Down Expand Up @@ -3224,7 +3224,7 @@ def afiro(self):
@pytest.mark.unit
def test_beta(self, model, caplog):

check_ill_conditioning(model)
compute_ill_conditioning_certificate(model)

expected = (
"Ill conditioning checks are a beta capability. Please be aware that "
Expand All @@ -3236,23 +3236,23 @@ def test_beta(self, model, caplog):
@pytest.mark.component
@pytest.mark.solver
def test_rows(self, model):
assert check_ill_conditioning(model, direction="row") == [
assert compute_ill_conditioning_certificate(model, direction="row") == [
(model.c4, pytest.approx(0.50000002, rel=1e-5)),
(model.c4, pytest.approx(0.49999998, rel=1e-5)),
]

@pytest.mark.component
@pytest.mark.solver
def test_rows(self, afiro):
assert check_ill_conditioning(afiro, direction="row") == [
assert compute_ill_conditioning_certificate(afiro, direction="row") == [
(afiro.R09, pytest.approx(0.5, rel=1e-5)),
(afiro.R09b, pytest.approx(0.5, rel=1e-5)),
]

@pytest.mark.component
@pytest.mark.solver
def test_columns(self, afiro):
assert check_ill_conditioning(afiro, direction="column") == [
assert compute_ill_conditioning_certificate(afiro, direction="column") == [
(afiro.X39, pytest.approx(1.1955465, rel=1e-5)),
(afiro.X23, pytest.approx(1.0668697, rel=1e-5)),
(afiro.X25, pytest.approx(-1.0668697, rel=1e-5)),
Expand Down

0 comments on commit f08c298

Please sign in to comment.