Skip to content

Commit f11f554

Browse files
committed
check new failure
1 parent 065ac4b commit f11f554

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

burnman/optimize/nonlinear_solvers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,6 @@ def solve(self) -> Solution:
722722
dx = lu_solve(luJ, -sol.F)
723723
dx_norm = np.linalg.norm(dx, ord=2)
724724

725-
is_singular = condition_number > self.max_condition_number
726-
if is_singular and any(np.isnan(dx)):
727-
lmda_bounds = [0.0, 0.0]
728-
break
729-
730725
lmda_bounds = self.lambda_bounds(dx, sol.x)
731726
h = (
732727
lmda

tests/test_equilibration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def test_convergence_with_singular_system(self):
256256
equality_constraints = [("P", 1.0e5), ("T", 1000.0)]
257257
sol, _ = equilibrate(composition, a, equality_constraints)
258258
self.assertTrue(sol.success) # Expect successful convergence
259-
self.assertTrue(sol.code == 5) # Expect singular system at solution
259+
self.assertEqual(sol.code, 5) # Expect singular system at solution
260260

261261
def test_ill_posed_problem(self):
262262

@@ -269,7 +269,7 @@ def test_ill_posed_problem(self):
269269
a.phases[1].set_composition([0.5, 0.5])
270270
equality_constraints = [("P", 1.0e5), ("T", 300.0)]
271271
sol, _ = equilibrate(composition, a, equality_constraints)
272-
self.assertTrue(sol.code == 2) # Expect problem to leave the feasible region
272+
self.assertEqual(sol.code, 2) # Expect problem to leave the feasible region
273273

274274
def test_ill_conditioned_jacobian(self):
275275

@@ -282,7 +282,7 @@ def test_ill_conditioned_jacobian(self):
282282
a.phases[1].set_composition([0.4, 0.6])
283283
equality_constraints = [("P", 1.0e5), ("T", 300.0)]
284284
sol, _ = equilibrate(composition, a, equality_constraints)
285-
self.assertTrue(sol.code == 4) # Expect singular system
285+
self.assertEqual(sol.code, 4) # Expect singular system
286286

287287

288288
if __name__ == "__main__":

0 commit comments

Comments
 (0)