pycalphad / scheil

A Scheil-Gulliver simulation tool using pycalphad.
https://scheil.readthedocs.io/
MIT License
18 stars 6 forks source link

try to fix bugs the current_fraction_solid is ref before assign #30

Closed HUISUN24 closed 1 year ago

bocklund commented 1 year ago

Probably want to rebase this against the master branch and revert changes to setup.py now

bocklund commented 1 year ago

@HUISUN24 can you explain what is the objective here?

I think the majority of the test failures in #27 and #28 are real (unless the tests are wrong). phase_amounts in the context of this code, as documented in the SolidificationResult, should be the instantaneous phase fractions, i.e. the newly solidified amount from this solidification step. Even at the eutectic as solidification ends, only the remaining liquid solidifies at the eutectic composition. Maybe you want the SolidificationResult.cum_phase_amounts() method, which does the summation of the instantaneous phase fractions to give the cumulative phase amount?

HUISUN24 commented 1 year ago

When I tried to run the scheil code for some composition, it will stop and give the error 'current_fraction_solid' reference before assign, so I try to give it a initial value, so current_fraction_solid = 0 before while fraction_solid[-1] < 1.

HUISUN24 commented 1 year ago

For the pycalphad version problem, I will to download the scheil and run the pytest, " FAILED scheil/ordering.py::scheil.ordering.rename_disordered_phases" Which will be resolve by downgrade the pycalphad to 0.9.*

HUISUN24 commented 1 year ago

I will try the fix you uploaded.