Skip to content

Commit

Permalink
Merge pull request #591 from bobmyhill/fix_nnls
Browse files Browse the repository at this point in the history
fix nnls
  • Loading branch information
bobmyhill authored May 25, 2024
2 parents 0a0718d + 0ad0002 commit 2bea808
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions burnman/classes/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ def change_component_set(self, new_component_list):
component_matrix[i][self.element_list.index(element)] = n_atoms

sol = nnls(component_matrix.T, composition)
if sol[1] < 1.0e-12:
if sol[1] < 1.0e-10:
component_amounts = sol[0]
else:
raise Exception(
"Failed to change component set. "
"Could not find a non-negative "
"least squares solution. "
f"least squares solution (residual={sol[1]}). "
"Can the bulk composition be described "
"with this set of components?"
)
Expand Down

0 comments on commit 2bea808

Please sign in to comment.