Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update example #565

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading