Allow free compositional vectors in optimal thermobarometry problems #695
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for compositional degrees of freedom in thermobarometric inversion, allowing mineral phases to vary their site occupancies during optimization for a better fit. It also refactors how site occupancies are represented and printed, adds new options to the
site_formulamethod for Solution instances, and updates example scripts and tests to demonstrate and verify these new capabilities.Major changes:
estimate_conditionsfunction, enabling optimization over both P-T and compositional parameters. Phases can now have afree_compositional_vectorsattribute, which is used to adjust their compositions during fitting. The optimization routine and parameter counting are updated accordingly.site_occupanciesproperty insolution.pyto return a flat numpy array instead of a list of dicts. Thesite_formulamethod now accepts precision, absent species printing, and custom site occupancies, making it more flexible for reporting and analysis.example_optimal_thermobarometry.pyto demonstrate how to use free compositional vectors for minerals like biotite and ilmenite, and improved output formatting for site occupancies and compositions, including more readable site names.site_formulamethod, covering custom precision, absent species, and custom site occupancies. Also added a test for the new compositional vector optimization in thermobarometry.