CALPHAD equilibria, which answer a question the hull cannot - #16
Merged
Conversation
test_mudata_assembly_is_optional_and_works asserted only that assembly works. Where mudata was absent it raised rather than skipping, so it failed on exactly the installation it was named after, and the 'optional' half was never checked at all. CI never saw it because the multi extra is always installed there; it turned up on a scratch environment built with a narrower set of extras. It now checks both branches: with mudata present the object assembles, and without it the call raises an ImportError that names the package.
mv.thermo.calphad reads an assessed thermodynamic database and reports which phases coexist at a temperature, and in what fraction. That is a different question from mv.thermo.hull, not a better answer to the same one: the hull is computed here at 0 K from energies this library produced and extends to compositions nobody has assessed, while CALPHAD reads parameters fitted to measured phase boundaries and covers liquids, solution phases and temperature. Checked against a measured number rather than against itself. The Pb-Sn eutectic is 456 K, and at the eutectic composition this gives two solid phases at 450 K and a single liquid at 455 K. Off-eutectic compositions melt over a range instead - LIQUID + BCT_A5 - which is what an alloy away from the eutectic does. Two things the notes say plainly because they decide whether a number means anything. The database is the whole calculation, matverse ships none, and two assessments of the same system will disagree - that spread is the error bar, not the precision of the numbers. And a material containing an element the database does not assess is skipped and counted, never projected onto the elements that remain: dropping the copper from PbSnCu and renormalising answers a question about a different alloy. pycalphad is pinned below 0.11 because 0.11 builds against scipy 1.18, which ships no manylinux_2_17 wheel; an older glibc cannot get there, and the failure is a scipy build error deep inside pycalphad's build environment where a runtime constraint does not reach. Also fixes test_mudata_assembly_is_optional_and_works, which asserted only that assembly works. Where mudata was absent it raised rather than skipping, so it failed on exactly the installation it was named after and the 'optional' half was never checked. CI never saw it because the multi extra is always installed there. 966 tests pass on py3.12, 850 on py3.10. Contract-verified rate stays 165/165, all 16 notebooks execute, docs build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016wh5NzNE9Wn49nuUm7zg2a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
mv.thermo.calphadreads an assessed thermodynamic database and reports which phases coexist at a temperature, and in what fraction.That is a different question from
mv.thermo.hull, not a better answer to the same one. The hull is computed here at 0 K from energies this library produced and extends to compositions nobody has assessed; CALPHAD reads parameters fitted to measured phase boundaries and covers liquids, solution phases and temperature. Neither supersedes the other.Checked against a measured number
The Pb-Sn eutectic is 456 K. At the eutectic composition:
FCC_A1 + BCT_A5LIQUIDFCC_A1FCC_A1FCC_A1 + BCT_A5LIQUID + BCT_A5Two solids below, one liquid above — the two temperatures straddle it. The off-eutectic compositions melt over a range instead, which is what an alloy away from the eutectic does.
Two things the notes say plainly
The database is the whole calculation. matverse ships none — assessed databases are years of work and mostly licensed — so you supply one and
uns["calphad"]records which. Two assessments of the same system will disagree, and that spread is the error bar, not the precision of the numbers.An unassessed element is skipped and counted, never projected. Dropping the copper from PbSnCu and renormalising answers a question about a different alloy.
Packaging
pycalphad is pinned below 0.11: 0.11 builds against scipy 1.18, which ships no
manylinux_2_17wheel. An older glibc cannot get there, and the failure surfaces as a scipy build error deep inside pycalphad's build environment, where a runtime constraint does not reach.Also
test_mudata_assembly_is_optional_and_worksasserted only that assembly works. Where mudata was absent it raised rather than skipping, so it failed on exactly the installation it was named after, and the "optional" half was never checked. CI never saw it because themultiextra is always installed there.Verification
966 pass on py3.12, 850 on py3.10. Contract-verified rate stays 165/165. All 16 notebooks execute — the table above is printed by the notebook, not transcribed. Docs build.
Not in this PR:
mv.prop.kappa_bte(phono3py) is written and passing its own checks, but five nominally identical runs gave κ of 26.1, 34.3, 48.3, 50.5 and 122.0 W/m/K for silicon — a factor of five. The potentials are deterministic to 2e-7 eV/Å, so the variation is downstream of the forces and is still being traced. A thermal conductivity that returns a different answer each run is worse than none.🤖 Generated with Claude Code
https://claude.ai/code/session_016wh5NzNE9Wn49nuUm7zg2a