From a60e10c3de81ed815ef66dc22851fbe2de9ee5e8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 1 Feb 2013 23:39:40 +0000 Subject: [PATCH] [Cython] Allow creation of Mixture objects without quantities for each phase --- interfaces/cython/cantera/mixture.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interfaces/cython/cantera/mixture.pyx b/interfaces/cython/cantera/mixture.pyx index 29383bd1e..460c0c26e 100644 --- a/interfaces/cython/cantera/mixture.pyx +++ b/interfaces/cython/cantera/mixture.pyx @@ -36,6 +36,10 @@ cdef class Mixture: self._phases = [] cdef _SolutionBase phase + if isinstance(phases[0], _SolutionBase): + # Assign default composition to the list of phases + phases = [(p, 1 if i == 0 else 0) for i,p in enumerate(phases)] + for phase,moles in phases: self.mix.addPhase(phase.thermo, moles) self._phases.append(phase)