Skip to content

Commit

Permalink
return component instead of its name
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Dec 12, 2023
1 parent b0d39d8 commit 5316a01
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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 @@ -3356,7 +3356,7 @@ def b_rule(b, i):
val = value(inf_prob.y[i])
if abs(val) < cutoff:
break
ill_cond.append((components[i].name, val))
ill_cond.append((components[i], val))

return ill_cond

Expand Down
36 changes: 18 additions & 18 deletions idaes/core/util/tests/test_model_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3236,34 +3236,34 @@ def test_beta(self, model, caplog):
@pytest.mark.solver
def test_rows(self, model):
assert check_ill_conditioning(model, direction="row") == [
("c4", pytest.approx(0.50000002, rel=1e-5)),
("c1", pytest.approx(0.49999998, rel=1e-5)),
(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") == [
("R09", pytest.approx(0.5, rel=1e-5)),
("R09b", pytest.approx(0.5, rel=1e-5)),
(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") == [
("X39", pytest.approx(1.1955465, rel=1e-5)),
("X23", pytest.approx(1.0668697, rel=1e-5)),
("X25", pytest.approx(-1.0668697, rel=1e-5)),
("X09", pytest.approx(-0.95897123, rel=1e-5)),
("X13", pytest.approx(-0.95897123, rel=1e-5)),
("X06", pytest.approx(0.91651956, rel=1e-5)),
("X10", pytest.approx(0.91651956, rel=1e-5)),
("X36", pytest.approx(0.76204977, rel=1e-5)),
("X31", pytest.approx(-0.39674454, rel=1e-5)),
("X35", pytest.approx(-0.39674454, rel=1e-5)),
("X16", pytest.approx(0.14679548, rel=1e-5)),
("X38", pytest.approx(-0.14679548, rel=1e-5)),
("X15", pytest.approx(-0.042451666, rel=1e-5)),
("X37", pytest.approx(-0.036752232, rel=1e-5)),
(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)),
(afiro.X09, pytest.approx(-0.95897123, rel=1e-5)),
(afiro.X13, pytest.approx(-0.95897123, rel=1e-5)),
(afiro.X06, pytest.approx(0.91651956, rel=1e-5)),
(afiro.X10, pytest.approx(0.91651956, rel=1e-5)),
(afiro.X36, pytest.approx(0.76204977, rel=1e-5)),
(afiro.X31, pytest.approx(-0.39674454, rel=1e-5)),
(afiro.X35, pytest.approx(-0.39674454, rel=1e-5)),
(afiro.X16, pytest.approx(0.14679548, rel=1e-5)),
(afiro.X38, pytest.approx(-0.14679548, rel=1e-5)),
(afiro.X15, pytest.approx(-0.042451666, rel=1e-5)),
(afiro.X37, pytest.approx(-0.036752232, rel=1e-5)),
]

0 comments on commit 5316a01

Please sign in to comment.