Is broadcast = False allowed in equilibrium now? #556
Replies: 3 comments
-
pycalphad/pycalphad/core/equilibrium.py Line 15 in 176909c |
Beta Was this translation helpful? Give feedback.
-
For doing something like from pycalphad import Database, Workspace, variables as v
dbf = Database('...') # your database here
comps = ['A', 'B', 'VA']
phases = ['FCC_A1', 'LIQUID']
wks = Workspace(dbf, comps, phases)
list_of_conditions = [{v.X('A'): 0.3, v.T: 300}, {v.X('A'): 0.5, v.T: 1000}]
results = np.zeros(len(list_of_conditions))
for idx, conds in enumerate(list_of_conditions):
wks.conditions.update(conds) # will reuse compiled functions and cached models aggressively
results[idx] = wks.get('GM') We're still tweaking Workspace, so this may still have some performance overhead from redundant computations, but it should work. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply and useful information! |
Beta Was this translation helpful? Give feedback.
-
I've noticed that the broadcast parameter is removed in equilibrium function: equilibrium(dbf, comps, phases, conditions, output=None, model=None, erbose=False, calc_opts=None, to_xarray=True, parameters=None, solver=None, phase_records=None, **kwargs). What is the current default calculation mode, will the equilibrium always generate a grid based on the input conditions or require all the input lists of conditions in the same length? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions