You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pycalphad 0.9.1 and the binplot function I get an index error :
I have attached a tdb that causes the error, I'm using a associates model and this tdb contains a solid solution
I also have another tdb that produces the same error and that tdb contains a Liquid+Liquid gap
Both of these tdb were working in pycalphad 0.9.0 TDB file.zip
I also get the same error when using the espei mcmc when setting approximate_equilibrium: False, however when I set it to True (which I mostly use) the error does not occur and the mcmc runs.
I can reproduce this error with the above database and the following code:
frompycalphadimportDatabase, binplot, variablesasvimportmatplotlib.pyplotaspltdbf=Database('A_S_corrected.tdb')
# Define the componentscomps= ['A', 'Q']
# Get all possible phases programmaticallyphases=dbf.phases.keys()
# Plot the phase diagram, if no axes are supplied, a new figure with axes will be created automaticallybinplot(dbf, comps, phases, {v.N: 1, v.P:101325, v.T: (300, 1000, 10), v.X('Q'):(0, 1, 0.02)})
plt.show()
The cause of this error is an index offset being computed based on the number of nonvacant components, instead of the number of nonvacant elements. In general these numbers are not the same, and for associate models they usually are not, which is why you encountered this issue. I have a fix ready, and I'm just going to take a little time to prepare a test before I push the PR.
Activity
richardotis commentedon Aug 10, 2021
I can reproduce this error with the above database and the following code:
richardotis commentedon Aug 10, 2021
The cause of this error is an index offset being computed based on the number of nonvacant components, instead of the number of nonvacant elements. In general these numbers are not the same, and for associate models they usually are not, which is why you encountered this issue. I have a fix ready, and I'm just going to take a little time to prepare a test before I push the PR.
wahab2604 commentedon Aug 10, 2021
Thank you very much for your help
FIX: calculate: Use nonvacant elements to compute phase index offset. F…
FIX: calculate: Phase index offset for associate models (#368)