Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Dec 17, 2023
1 parent a020126 commit 63b9562
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/example_equilibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,17 @@
}
sols, prm = equilibrate(composition, assemblage, equality_constraints)
# We know that we've made a simpler orthopyroxene solution.
# In this case, the endmembers are either the same, and the names
# have just been appended with "in child solution", or
# In this case, the endmembers are either the same, or
# the processing has created an anti-ordered endmember.
# We get the index of the ordered/anti-ordered endmember here.
try:
idx = prm.parameter_names.index(
"p(ordered ferroenstatite " "in child solution)"
"p(ordered ferroenstatite in orthopyroxene (CFMASCrO) (transformed))"
)
p_fms = np.array([sol.x[idx] for sol in sols if sol.success])
except ValueError:
idx = prm.parameter_names.index(
"p(User-created endmember " "in child solution)"
"p(Derived member (occupancies: [Mg][Fe][Si]1/2) in orthopyroxene (CFMASCrO) (transformed))"
)
p_fms = np.array([-sol.x[idx] for sol in sols if sol.success])

Expand Down

0 comments on commit 63b9562

Please sign in to comment.