Skip to content

Commit

Permalink
Merge pull request #565 from bobmyhill/fix_example
Browse files Browse the repository at this point in the history
update example
  • Loading branch information
bobmyhill authored Dec 17, 2023
2 parents a020126 + 63b9562 commit 9b22baa
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 9b22baa

Please sign in to comment.