diff --git a/interfaces/cython/cantera/thermo.pyx b/interfaces/cython/cantera/thermo.pyx index 680d239caa8..53c4e171cc2 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -970,10 +970,12 @@ cdef class ThermoPhase(_SolutionBase): self.thermo.setMoleFractions_NoNorm(&data[0]) def mass_fraction_dict(self, double threshold=0.0): + cdef pair[string,double] item Y = self.thermo.getMassFractionsByName(threshold) return {pystr(item.first):item.second for item in Y} def mole_fraction_dict(self, double threshold=0.0): + cdef pair[string,double] item X = self.thermo.getMoleFractionsByName(threshold) return {pystr(item.first):item.second for item in X} diff --git a/interfaces/cython/cantera/utils.pyx b/interfaces/cython/cantera/utils.pyx index 3c3195ed62c..79b91e330cf 100644 --- a/interfaces/cython/cantera/utils.pyx +++ b/interfaces/cython/cantera/utils.pyx @@ -126,6 +126,7 @@ cdef anyvalue_to_python(string name, CxxAnyValue& v): cdef anymap_to_dict(CxxAnyMap& m): + cdef pair[string,CxxAnyValue] item m.applyUnits() if m.empty(): return {}