Skip to content

Conversation

@bocklund
Copy link
Collaborator

@bocklund bocklund commented Aug 5, 2024

This PR adds a testing ConvergenceFailureSolver to the test suite that overrides solve to return an unconverged result. We use this solver to add test cases for situations where there are convergence failures without having to track and continually update the test suite with real convergence failures as the solver improves to fix them.

In general, the expected behavior for convergence failures is that all properties derived from equilibrium return NaN, which is backwards compatible with pre-Workspace xarray Datasets.

In particular, we test and fix bugs where the following wks.get calls would raise errors by trying to access composition sets that don't exist, taking into account the changes in #540 for find_first_compset:

  • wks.get("MU(component)")
  • wks.get("Y(phase_name, sublattice_index, species)")
  • wks.get(IsolatedPhase("phasename", wks=wks)("property"))
  • wks.get(DormantPhase("phasename", wks=wks)("property"))

@bocklund bocklund force-pushed the fix-workspace-convergence-failure-exceptions branch from 19ccbb8 to 02bcca4 Compare August 5, 2024 21:08
@bocklund
Copy link
Collaborator Author

bocklund commented Aug 5, 2024

This will need a rebase on develop once #554 is merged

@codecov
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.89%. Comparing base (55d5d2b) to head (dbee6ea).

Files Patch % Lines
pycalphad/property_framework/metaproperties.py 92.85% 1 Missing ⚠️
pycalphad/variables.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #558      +/-   ##
===========================================
+ Coverage    91.83%   91.89%   +0.06%     
===========================================
  Files           77       77              
  Lines        12086    12121      +35     
===========================================
+ Hits         11099    11139      +40     
+ Misses         987      982       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bocklund bocklund force-pushed the fix-workspace-convergence-failure-exceptions branch from 328a70f to 02bcca4 Compare August 5, 2024 22:52
bocklund added 11 commits August 5, 2024 18:52
Addresses the following cases with a test:
- Fixes wildcard expansion on components (for properties without a sublattice index) to expand on non-vacant pure elements. With proper component support, we would go back to using `self.components`, but currently `self.components` contain all phase constituents, including, for example, vacancies
- Adds `expand_wildcard` on components for chemical potentials
- Fixes wildcard expansion for properties where expansions are on phase constituents, such as site fractions
- Adds support for wildcard expansion on sublattice indices (required adding `sublattice index = '*'` as valid).
- Change behavior of compute_property for site fractions to return NaN if the phase is not stable (previously we were returning zero)
@bocklund bocklund force-pushed the fix-workspace-convergence-failure-exceptions branch from 219a8d4 to d73b902 Compare August 6, 2024 01:52
@bocklund
Copy link
Collaborator Author

bocklund commented Aug 6, 2024

@richardotis One thing I'm not sure about is whether there are other properties or uses of Workspace worth testing for convergence failures. I think I got most the interesting variables and GM should be representative of model computed properties

@bocklund bocklund marked this pull request as ready for review August 6, 2024 22:44
@bocklund bocklund requested a review from richardotis August 6, 2024 22:45
@bocklund bocklund requested a review from richardotis August 7, 2024 03:18
@bocklund bocklund merged commit 208cddb into pycalphad:develop Aug 7, 2024
@bocklund bocklund deleted the fix-workspace-convergence-failure-exceptions branch August 7, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants