Conversation
… smoothing in clean_df and fix_composition_scaling
- _get_free_energy_fit gains method='redlich-kister' option - New _eval_free_energy_fit dispatches between polynomial and RK - get_phase_free_energy gains method parameter (default 'polynomial') - Fully backward compatible: default behavior unchanged
The Redlich-Kister xi*(1-xi) prefactor forces F_excess=0 at both endpoints. This is correct when both endpoints are pure components (x=0 or x=1), but wrong for partial-range phases like agfcc (0.7-1.0) where x=0.7 is NOT a pure component. Fix: detect which endpoints are actual pure components (within tol=1e-3 of 0 or 1) and use appropriate basis functions: - Both pure: standard xi*(1-xi)*(1-2xi)^k (classic RK) - Only right pure: (1-xi)*xi^k (excess free at left boundary) - Only left pure: xi*(1-xi)^k (excess free at right boundary) - Neither pure: xi^k (unconstrained polynomial for excess)
- Two-phase regions rendered as filled polygons with coloured borders - fill=True by default; fill=False reverts to legacy horizontal lines - Configurable alpha, border_lw, figsize, external ax support - Auto-labels axes and calls tight_layout - Fully backward-compatible signature
Trim composition edges of partial-range phases before convex hull construction. Removes artefactual F_mix dips at boundaries where the global linear reference does not match the phase's natural endpoint, preventing false tangent contacts near the eutectic.
… ax) - Switch from material-design colours to Tableau 10 qualitative palette - Legend now only shows two-phase regions that actually appear in the data - Deduplicate reversed phase pairs (e.g. lqd-agfcc == agfcc-lqd) - Return (fig, ax) tuple instead of fig alone
…_boundary option - Use the user-specified composition_interval (instead of min/max of available data) for the compfine evaluation grid. This prevents discontinuities when endpoint data appears/disappears at certain temperatures (e.g. lqd x=0 only available above 900K). - Add smooth_boundary parameter to plot_phase_diagram: applies a Savitzky-Golay filter to polygon boundary curves to remove remaining data-edge kinks. Default 0 (disabled).
Wraps data gathering, cleaning, free-energy fitting, common-tangent construction, and plotting into a single class. Methods: - calculate(): compute tangents across temperature range - plot(): full phase diagram with filled polygons - plot_free_energy(T): F(x) curves at one temperature - plot_free_energy_mixing(T): F_mix(x) + tangent lines - plot_data_vs_fit(phase, T): raw data vs fitted curve - plot_convergence(): overview of succeeded/failed calculations
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.
This pull request introduces significant improvements and bug fixes to the handling of structure file writing for different calculation modes, enhances the postprocessing smoothing and correction logic, and makes job script output handling more robust. The main themes are improved support for "fe mode" in structure writing, more robust and physically meaningful postprocessing, and better test coverage for these features.