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

ENH: Add metastable composition sets to starting point #362

Merged
merged 6 commits into from
Aug 8, 2021

Conversation

richardotis
Copy link
Collaborator

This PR adds a new function, add_nearly_stable, which augments the starting point of the solver with additional CompositionSet objects, which are entered with zero amount. These objects are added by the following criteria:

  • The phase does not already exist on the starting hyperplane (this will not add missing composition sets of a miscibility gap)
  • For a given phase, the added configuration is the closest to the starting hyperplane, within 1000 J/mol-atom

The purpose of this change is to improve the accuracy of solutions when sampling densities are not high enough to find the true set of equilibrium composition sets. This can easily happen in the multi-component / multi-sublattice case.

@codecov
Copy link

codecov bot commented Jul 31, 2021

Codecov Report

Merging #362 (7043f23) into develop (e9c5d6d) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #362      +/-   ##
===========================================
+ Coverage    89.86%   89.91%   +0.04%     
===========================================
  Files           44       44              
  Lines         4341     4362      +21     
===========================================
+ Hits          3901     3922      +21     
  Misses         440      440              
Impacted Files Coverage Δ
pycalphad/core/calculate.py 92.63% <100.00%> (+0.15%) ⬆️
pycalphad/tests/datasets.py 100.00% <100.00%> (ø)
pycalphad/tests/test_equilibrium.py 97.65% <100.00%> (+0.08%) ⬆️
pycalphad/tests/test_database.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9c5d6d...7043f23. Read the comment docs.

Copy link
Collaborator

@bocklund bocklund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a test and what does that look like? Do we need a unit test that checks that composition sets are added or is an integration test for a tricky case enough?

pycalphad/core/eqsolver.pyx Show resolved Hide resolved
pycalphad/core/eqsolver.pyx Show resolved Hide resolved
pycalphad/core/eqsolver.pyx Show resolved Hide resolved
…`entered_phases` to clarify that `composition_sets` may already contain metastable entries
@richardotis
Copy link
Collaborator Author

Does this need a test and what does that look like? Do we need a unit test that checks that composition sets are added or is an integration test for a tricky case enough?

I think an integration test for a test case is the right idea, because the use of metastable composition sets in the starting point is an implementation detail. Do you have a good test case? I hesitate to use the multi-component system that inspired this because of the additional test time.

…metastable augmentation of the starting point
@richardotis richardotis added this to the 0.9.1 milestone Aug 4, 2021
Copy link
Collaborator

@bocklund bocklund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting together this PR!

@richardotis richardotis merged commit 8dffc5f into pycalphad:develop Aug 8, 2021
bocklund added a commit to PhasesResearchLab/ESPEI that referenced this pull request Aug 9, 2021
…tion sets (#206)

Incorporates the changes to the Dataset/LightDataset API introduced in pycalphad/pycalphad#362.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants