Skip to content

Commit

Permalink
fix: a few minor fixes to Workspace workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sorkins committed Mar 16, 2023
1 parent 5cc29d9 commit 3c19e0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pycalphad/core/eqsolver.pyx
Expand Up @@ -108,7 +108,7 @@ def add_nearly_stable(object composition_sets, object phase_records,
# Add unrepresented phases as metastable composition sets
# This should help catch phases around the limit of stability
for phase_name in sorted(phase_records.keys()):
if phase_name in entered_phases:
if phase_name in entered_phases or grid.attrs['phase_indices'].get(phase_name, True):

This comment has been minimized.

Copy link
@richardotis

richardotis Dec 29, 2023

This change has the effect of completely disabling add_nearly_stable (it should always evaluate to True, so the whole loop is skipped). Did you do this to mitigate an issue similar to pycalphad#503 ? If so, the underlying bug is now fixed in pycalphad#432, so please try it again. If not, can you share a test case for the problem you are encountering with this function?

This comment has been minimized.

Copy link
@sorkins

sorkins Jan 4, 2024

Author Owner

I'll see if I can reproduce the issue again to give you more details.

continue
phase_record = phase_records[phase_name]
phase_indices = grid.attrs['phase_indices'][phase_name]
Expand Down
2 changes: 1 addition & 1 deletion pycalphad/property_framework/metaproperties.py
Expand Up @@ -155,7 +155,7 @@ class IsolatedPhase:
_compset: CompositionSet

def __init__(self, phase: Union[CompositionSet, str],
wks: Optional["Workspace"]):
wks: Optional["Workspace"] = None):
if wks is None:
if not isinstance(phase, CompositionSet):
raise ValueError('Isolated phase calculation requires a starting point for the phase;'
Expand Down
2 changes: 1 addition & 1 deletion pycalphad/variables.py
Expand Up @@ -273,7 +273,7 @@ def __str__(self):
"String representation."
#pylint: disable=E1101
return 'Y(%s,%d,%s)' % \
(self.phase_name, self.sublattice_index, self.species.escaped_name)
(self.phase_name, int(self.sublattice_index), self.species.escaped_name)

This comment has been minimized.

Copy link
@richardotis

richardotis Dec 29, 2023

I have added this fix to pycalphad#432


class PhaseFraction(StateVariable):
"""
Expand Down

0 comments on commit 3c19e0b

Please sign in to comment.