Skip to content

Commit

Permalink
Addressing reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee94 committed Dec 11, 2023
1 parent db228a3 commit 447055c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 0 additions & 6 deletions idaes/core/util/model_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3142,9 +3142,6 @@ def check_parallel_jacobian(model, tolerance: float = 1e-4, direction: str = "ro
Numerical Instability in Linear and Integer Programs, Informs 2014, pgs. 54-108
https://pubsonline.informs.org/doi/epdf/10.1287/educ.2014.0130
We would also like to acknowledge Gurobi Model Analyzer for their implementation
of these methods (https://github.com/Gurobi/gurobi-modelanalyzer).
Args:
model: model to be analysed
tolerance: tolerance to use to determine if constraints/variables are parallel
Expand Down Expand Up @@ -3234,9 +3231,6 @@ def check_ill_conditioning(
Numerical Instability in Linear and Integer Programs, Informs 2014, pgs. 54-108
https://pubsonline.informs.org/doi/epdf/10.1287/educ.2014.0130
We would also like to acknowledge Gurobi Model Analyzer for their implementation
of these methods (https://github.com/Gurobi/gurobi-modelanalyzer).
Args:
model: model to be analysed
target_feasibility_tol: target tolerance for solving ill conditioning problem
Expand Down
13 changes: 9 additions & 4 deletions idaes/core/util/tests/test_model_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3076,12 +3076,17 @@ def test_rows(self, model):

@pytest.mark.unit
def test_columns(self, model):
assert check_parallel_jacobian(model, direction="column") == [
(model.v1, model.v2),
(model.v1, model.v4),
(model.v2, model.v4),
pcol = check_parallel_jacobian(model, direction="column")

expected = [
("v1", "v2"),
("v1", "v4"),
("v2", "v4"),
]

for i in pcol:
assert tuple(sorted([i[0].name, i[1].name])) in expected


class TestCheckIllConditioning:
@pytest.mark.unit
Expand Down

0 comments on commit 447055c

Please sign in to comment.