```python
import numpy as np
from pycalphad import Model, Database, calculate, equilibrium
import pycalphad.variables as v

#dbf = Database('2016-08-10-AlGdMgand18RLPSO-for 3d plot.tdb')
dbf = Database('alfe_sei.TDB')
models = {key: Model(dbf, ['AL', 'FE', 'VA'], key) for key in dbf.phases.keys()}
```

```python
#Set compiler directives (cf. http://docs.cython.org/src/reference/compilation.html)
%load_ext cython
from Cython.Compiler.Options import _directive_defaults

_directive_defaults['linetrace'] = True
_directive_defaults['binding'] = True
```

    The cython extension is already loaded. To reload it, use:
      %reload_ext cython

```cython
%%cython -a -f --compile-args=-DCYTHON_TRACE=1
import pycalphad.variables as v
from pycalphad.core.utils import unpack_kwarg
from pycalphad.core.utils import unpack_condition, unpack_phases
from pycalphad import calculate, Model
from pycalphad.constraints import mole_fraction
from pycalphad.core.lower_convex_hull import lower_convex_hull
from pycalphad.core.sympydiff_utils import build_functions as compiled_build_functions
from pycalphad.core.constants import MIN_SITE_FRACTION
from pycalphad.core.eqsolver import _solve_eq_at_conditions
from sympy import Add, Symbol
import dask
from dask import delayed
import dask.multiprocessing, dask.async
from xarray import Dataset
import numpy as np
cimport numpy as np
from collections import namedtuple, OrderedDict
from datetime import datetime
from pycalphad.core.eqsolver import *
from pycalphad.core.eqsolver import _build_multiphase_gradient, \
    _build_multiphase_system, _compute_constraints, _compute_phase_dof, remove_degenerate_phases
cimport cython

def _solve_eq_at_conditions(dbf, comps, properties, phase_records, callable_dict, conds_keys, verbose):
    """
    Compute equilibrium for the given conditions.
    This private function is meant to be called from a worker subprocess.
    For that case, usually only a small slice of the master 'properties' is provided.
    Since that slice will be copied, we also return the modified 'properties'.

    Parameters
    ----------
    dbf : Database
        Thermodynamic database containing the relevant parameters.
    comps : list
        Names of components to consider in the calculation.
    properties : Dataset
        Will be modified! Thermodynamic properties and conditions.
    phase_records : dict of PhaseRecord
        Details on phase callables.
    callable_dict : dict of callable
        Objective functions for each phase.
    conds_keys : list of str
        List of conditions axes in dimension order.
    verbose : bool
        Print details.

    Returns
    -------
    properties : Dataset
        Modified with equilibrium values.
    """
    cdef:
        double indep_sum
        int num_phases, num_vars, cur_iter, old_phase_length, new_phase_length, var_idx, sfidx, pfidx, m, n
        np.ndarray[ndim=1, dtype=np.float64_t] gradient_term, p_y, l_constraints, step
        np.ndarray[ndim=1, dtype=np.float64_t] site_fracs, candidate_site_fracs, l_multipliers, new_l_multipliers, candidate_phase_fracs, phase_fracs
        np.ndarray[ndim=2, dtype=np.float64_t] l_hessian, ymat, zmat, qmat, rmat, constraint_jac
    # Factored out via profiling
    prop_MU_values = properties['MU'].values
    prop_NP_values = properties['NP'].values
    prop_Phase_values = properties['Phase'].values
    prop_X_values = properties['X'].values
    prop_Y_values = properties['Y'].values
    prop_GM_values = properties['GM'].values

    it = np.nditer(prop_GM_values, flags=['multi_index'])

    #if verbose:
    #    print('INITIAL CONFIGURATION')
    #    print(properties.MU)
    #    print(properties.Phase)
    #    print(properties.NP)
    #    print(properties.X)
    #    print(properties.Y)
    #    print('---------------------')
    while not it.finished:
        # A lot of this code relies on cur_conds being ordered!
        cur_conds = OrderedDict(zip(conds_keys,
                                    [np.asarray(properties['GM'].coords[b][a], dtype=np.float)
                                     for a, b in zip(it.multi_index, conds_keys)]))
        if len(cur_conds) == 0:
            cur_conds = properties['GM'].coords
        # sum of independently specified components
        indep_sum = np.sum([float(val) for i, val in cur_conds.items() if i.startswith('X_')])
        if indep_sum > 1:
            # Sum of independent component mole fractions greater than one
            # Skip this condition set
            # We silently allow this to make 2-D composition mapping easier
            prop_MU_values[it.multi_index] = np.nan
            prop_NP_values[it.multi_index + np.index_exp[:len(phases)]] = np.nan
            prop_Phase_values[it.multi_index + np.index_exp[:len(phases)]] = ''
            prop_X_values[it.multi_index + np.index_exp[:len(phases)]] = np.nan
            prop_Y_values[it.multi_index] = np.nan
            prop_GM_values[it.multi_index] = np.nan
            it.iternext()
            continue
        dependent_comp = set(comps) - set([i[2:] for i in cur_conds.keys() if i.startswith('X_')]) - {'VA'}
        if len(dependent_comp) == 1:
            dependent_comp = list(dependent_comp)[0]
        else:
            raise ValueError('Number of dependent components different from one')
        # chem_pots = OrderedDict(zip(properties.coords['component'].values, properties['MU'].values[it.multi_index]))
        # Used to cache generated mole fraction functions
        mole_fractions = {}
        for cur_iter in range(MAX_SOLVE_ITERATIONS):
            # print('CUR_ITER:', cur_iter)
            phases = list(prop_Phase_values[it.multi_index])
            if '' in phases:
                old_phase_length = phases.index('')
            else:
                old_phase_length = -1
            remove_degenerate_phases(prop_Phase_values[it.multi_index], prop_X_values[it.multi_index],
                                     prop_Y_values[it.multi_index], prop_NP_values[it.multi_index])
            phases = list(prop_Phase_values[it.multi_index])
            if '' in phases:
                new_phase_length = phases.index('')
            else:
                new_phase_length = -1
            # Are there removed phases?
            if '' in phases:
                num_phases = phases.index('')
            else:
                num_phases = len(phases)
            if num_phases == 0:
                raise ValueError('Zero phases are left in the system')
            zero_dof = np.all(
                (prop_Y_values[it.multi_index] == 1.) | np.isnan(prop_Y_values[it.multi_index]))
            if (num_phases == 1) and zero_dof:
                # Single phase with zero internal degrees of freedom, can't do any refinement
                # TODO: In the future we may be able to refine other degrees of freedom like temperature
                # Chemical potentials have no meaning for this case
                prop_MU_values[it.multi_index] = np.nan
                break
            phases = prop_Phase_values[it.multi_index + np.index_exp[:num_phases]]
            # num_sitefrac_bals = sum([len(dbf.phases[i].sublattices) for i in phases])
            # num_mass_bals = len([i for i in cur_conds.keys() if i.startswith('X_')]) + 1
            phase_fracs = prop_NP_values[it.multi_index + np.index_exp[:len(phases)]]
            phase_dof = [len(set(phase_records[name].variables) - {v.T, v.P}) for name in phases]
            # Flatten site fractions array and remove nan padding
            site_fracs = prop_Y_values[it.multi_index].ravel()
            # That *should* give us the internal dof
            # This may break if non-padding nan's slipped in from elsewhere...
            site_fracs = site_fracs[~np.isnan(site_fracs)]
            site_fracs[site_fracs < MIN_SITE_FRACTION] = MIN_SITE_FRACTION
            if len(site_fracs) == 0:
                print(properties)
                raise ValueError('Site fractions are invalid')
            phase_fracs[phase_fracs < MIN_SITE_FRACTION] = MIN_SITE_FRACTION
            var_idx = 0
            for name in phases:
                for idx in range(len(dbf.phases[name].sublattices)):
                    active_in_subl = set(dbf.phases[name].constituents[idx]).intersection(comps)
                    for ais in range(len(active_in_subl)):
                        site_fracs[var_idx + ais] = site_fracs[var_idx + ais] / sum(site_fracs[var_idx:var_idx + len(active_in_subl)])
                    var_idx += len(active_in_subl)
            l_constraints, constraint_jac, constraint_hess  = \
                _compute_constraints(dbf, comps, phases, cur_conds, site_fracs, phase_fracs, phase_records, mole_fractions=mole_fractions)
            # Reset Lagrange multipliers if active set of phases change
            if cur_iter == 0 or (old_phase_length != new_phase_length) or np.any(np.isnan(l_multipliers)):
                l_multipliers = np.zeros(l_constraints.shape[0])
            qmat, rmat = np.linalg.qr(constraint_jac.T, mode='complete')
            m = rmat.shape[1]
            n = qmat.shape[0]
            # Construct orthonormal basis for the constraints
            ymat = qmat[:, :m]
            zmat = qmat[:, m:]
            # Equation 18.14a in Nocedal and Wright
            p_y = np.linalg.solve(-np.dot(constraint_jac, ymat), l_constraints)
            num_vars = len(site_fracs) + len(phases)
            l_hessian, gradient_term = _build_multiphase_system(dbf, comps, phases, cur_conds, site_fracs, phase_fracs,
                                                                l_constraints, constraint_jac, constraint_hess,
                                                                l_multipliers, callable_dict, phase_records)
            if np.any(np.isnan(l_hessian)):
                print('Invalid l_hessian')
                l_hessian[:,:] = np.eye(l_hessian.shape[0])
            if np.any(np.isnan(gradient_term)):
                raise ValueError('Invalid gradient_term')
            # Equation 18.18 in Nocedal and Wright
            if m != n:
                if np.any(np.isnan(zmat)):
                    raise ValueError('Invalid zmat')
                try:
                    p_z = np.linalg.solve(np.dot(np.dot(zmat.T, l_hessian), zmat),
                                          -np.dot(np.dot(np.dot(zmat.T, l_hessian), ymat), p_y) - np.dot(zmat.T, gradient_term))
                except np.linalg.LinAlgError:
                    p_z = np.zeros(zmat.shape[1], dtype=np.float)
                step = np.dot(ymat, p_y) + np.dot(zmat, p_z)
            else:
                step = np.dot(ymat, p_y)
            old_energy = copy.deepcopy(prop_GM_values[it.multi_index])
            old_chem_pots = copy.deepcopy(prop_MU_values[it.multi_index])
            candidate_site_fracs = np.empty_like(site_fracs)
            candidate_phase_fracs = np.empty_like(phase_fracs)
            for sfidx in range(candidate_site_fracs.shape[0]):
                candidate_site_fracs[sfidx] = min(max(site_fracs[sfidx] + step[sfidx], MIN_SITE_FRACTION), 1)

            for pfidx in range(candidate_phase_fracs.shape[0]):
                candidate_phase_fracs[pfidx] = min(max(phase_fracs[pfidx] + step[candidate_site_fracs.shape[0] + pfidx], 0), 1)
            candidate_l_constraints, candidate_constraint_jac, candidate_constraint_hess = \
                _compute_constraints(dbf, comps, phases, cur_conds,
                                     candidate_site_fracs, candidate_phase_fracs, phase_records, mole_fractions=mole_fractions)
            candidate_energy, candidate_gradient_term = \
                _build_multiphase_gradient(dbf, comps, phases, cur_conds, candidate_site_fracs,
                                           candidate_phase_fracs, candidate_l_constraints,
                                           candidate_constraint_jac, l_multipliers,
                                           callable_dict, phase_records)
            # We updated degrees of freedom this iteration
            new_l_multipliers = np.linalg.solve(np.dot(constraint_jac, ymat).T,
                                                np.dot(ymat.T, gradient_term + np.dot(l_hessian, step)))
            np.clip(new_l_multipliers, -MAX_ABS_LAGRANGE_MULTIPLIER, MAX_ABS_LAGRANGE_MULTIPLIER,
                    out=new_l_multipliers)
            # XXX: Should fix underlying numerical problem at edges of composition space instead of working around
            if np.any(np.isnan(new_l_multipliers)):
                print('WARNING: Unstable Lagrange multipliers: ', new_l_multipliers)
                # Equation 18.16 in Nocedal and Wright
                # This method is less accurate but more stable
                new_l_multipliers = np.dot(np.dot(np.linalg.inv(np.dot(candidate_constraint_jac,
                                                                       candidate_constraint_jac.T)),
                                           candidate_constraint_jac), candidate_gradient_term)
                np.clip(new_l_multipliers, -MAX_ABS_LAGRANGE_MULTIPLIER, MAX_ABS_LAGRANGE_MULTIPLIER,
                    out=new_l_multipliers)
            l_multipliers = new_l_multipliers
            if np.any(np.isnan(l_multipliers)):
                print('Invalid l_multipliers after recalculation', l_multipliers)
                l_multipliers[:] = 0
            if verbose:
                print('NEW_L_MULTIPLIERS', l_multipliers)
            num_mass_bals = len([i for i in cur_conds.keys() if i.startswith('X_')]) + 1
            chemical_potentials = l_multipliers[sum([len(dbf.phases[i].sublattices) for i in phases]):
                                                sum([len(dbf.phases[i].sublattices) for i in phases]) + num_mass_bals]
            prop_MU_values[it.multi_index] = chemical_potentials
            prop_NP_values[it.multi_index + np.index_exp[:len(phases)]] = candidate_phase_fracs
            prop_X_values[it.multi_index + np.index_exp[:len(phases)]] = 0
            prop_GM_values[it.multi_index] = candidate_energy
            var_offset = 0
            for phase_idx in range(len(phases)):
                prop_Y_values[it.multi_index + np.index_exp[phase_idx, :phase_dof[phase_idx]]] = \
                    candidate_site_fracs[var_offset:var_offset + phase_dof[phase_idx]]
                for comp_idx, comp in enumerate([c for c in comps if c != 'VA']):
                    prop_X_values[it.multi_index + np.index_exp[phase_idx, comp_idx]] = \
                        mole_fractions[(phases[phase_idx], comp)][0](
                            [candidate_site_fracs[var_offset:var_offset + phase_dof[phase_idx]]])
                var_offset += phase_dof[phase_idx]

            properties.attrs['solve_iterations'] += 1
            total_comp = np.nansum(prop_NP_values[it.multi_index][..., np.newaxis] * \
                                   prop_X_values[it.multi_index], axis=-2)
            driving_force = (prop_MU_values[it.multi_index] * total_comp).sum(axis=-1) - \
                             prop_GM_values[it.multi_index]
            driving_force = np.squeeze(driving_force)
            if verbose:
                print('Chem pot progress', prop_MU_values[it.multi_index] - old_chem_pots)
                print('Energy progress', prop_GM_values[it.multi_index] - old_energy)
                print('Driving force', driving_force)
            no_progress = np.abs(prop_MU_values[it.multi_index] - old_chem_pots).max() < 0.01
            no_progress &= np.abs(prop_GM_values[it.multi_index] - old_energy) < MIN_SOLVE_ENERGY_PROGRESS
            if no_progress and np.abs(driving_force) > MAX_SOLVE_DRIVING_FORCE:
                print('Driving force failed to converge: {}'.format(cur_conds))
                prop_MU_values[it.multi_index] = np.nan
                prop_NP_values[it.multi_index] = np.nan
                prop_X_values[it.multi_index] = np.nan
                prop_Y_values[it.multi_index] = np.nan
                prop_GM_values[it.multi_index] = np.nan
                prop_Phase_values[it.multi_index] = ''
                break
            elif no_progress:
                if verbose:
                    print('No progress')
                num_mass_bals = len([i for i in cur_conds.keys() if i.startswith('X_')]) + 1
                chemical_potentials = l_multipliers[sum([len(dbf.phases[i].sublattices) for i in phases]):
                                                    sum([len(dbf.phases[i].sublattices) for i in phases]) + num_mass_bals]
                prop_MU_values[it.multi_index] = chemical_potentials
                break
            elif (not no_progress) and cur_iter == MAX_SOLVE_ITERATIONS-1:
                print('Failed to converge: {}'.format(cur_conds))
                prop_MU_values[it.multi_index] = np.nan
                prop_NP_values[it.multi_index] = np.nan
                prop_X_values[it.multi_index] = np.nan
                prop_Y_values[it.multi_index] = np.nan
                prop_GM_values[it.multi_index] = np.nan
                prop_Phase_values[it.multi_index] = ''
        it.iternext()
    return properties
```

<!DOCTYPE html>
<!-- Generated by Cython 0.25.1 -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Cython: _cython_magic_179ec25e50428c13c53b0ba863f4b74e.pyx</title>
    <style type="text/css">

body.cython { font-family: courier; font-size: 12; }

.cython.tag  {  }
.cython.line { margin: 0em }
.cython.code { font-size: 9; color: #444444; display: none; margin: 0px 0px 0px 8px; border-left: 8px none; }

.cython.line .run { background-color: #B0FFB0; }
.cython.line .mis { background-color: #FFB0B0; }
.cython.code.run  { border-left: 8px solid #B0FFB0; }
.cython.code.mis  { border-left: 8px solid #FFB0B0; }

.cython.code .py_c_api  { color: red; }
.cython.code .py_macro_api  { color: #FF7000; }
.cython.code .pyx_c_api  { color: #FF3000; }
.cython.code .pyx_macro_api  { color: #FF7000; }
.cython.code .refnanny  { color: #FFA000; }
.cython.code .trace  { color: #FFA000; }
.cython.code .error_goto  { color: #FFA000; }

.cython.code .coerce  { color: #008000; border: 1px dotted #008000 }
.cython.code .py_attr { color: #FF0000; font-weight: bold; }
.cython.code .c_attr  { color: #0000FF; }
.cython.code .py_call { color: #FF0000; font-weight: bold; }
.cython.code .c_call  { color: #0000FF; }

.cython.score-0 {background-color: #FFFFff;}
.cython.score-1 {background-color: #FFFFe7;}
.cython.score-2 {background-color: #FFFFd4;}
.cython.score-3 {background-color: #FFFFc4;}
.cython.score-4 {background-color: #FFFFb6;}
.cython.score-5 {background-color: #FFFFaa;}
.cython.score-6 {background-color: #FFFF9f;}
.cython.score-7 {background-color: #FFFF96;}
.cython.score-8 {background-color: #FFFF8d;}
.cython.score-9 {background-color: #FFFF86;}
.cython.score-10 {background-color: #FFFF7f;}
.cython.score-11 {background-color: #FFFF79;}
.cython.score-12 {background-color: #FFFF73;}
.cython.score-13 {background-color: #FFFF6e;}
.cython.score-14 {background-color: #FFFF6a;}
.cython.score-15 {background-color: #FFFF66;}
.cython.score-16 {background-color: #FFFF62;}
.cython.score-17 {background-color: #FFFF5e;}
.cython.score-18 {background-color: #FFFF5b;}
.cython.score-19 {background-color: #FFFF57;}
.cython.score-20 {background-color: #FFFF55;}
.cython.score-21 {background-color: #FFFF52;}
.cython.score-22 {background-color: #FFFF4f;}
.cython.score-23 {background-color: #FFFF4d;}
.cython.score-24 {background-color: #FFFF4b;}
.cython.score-25 {background-color: #FFFF48;}
.cython.score-26 {background-color: #FFFF46;}
.cython.score-27 {background-color: #FFFF44;}
.cython.score-28 {background-color: #FFFF43;}
.cython.score-29 {background-color: #FFFF41;}
.cython.score-30 {background-color: #FFFF3f;}
.cython.score-31 {background-color: #FFFF3e;}
.cython.score-32 {background-color: #FFFF3c;}
.cython.score-33 {background-color: #FFFF3b;}
.cython.score-34 {background-color: #FFFF39;}
.cython.score-35 {background-color: #FFFF38;}
.cython.score-36 {background-color: #FFFF37;}
.cython.score-37 {background-color: #FFFF36;}
.cython.score-38 {background-color: #FFFF35;}
.cython.score-39 {background-color: #FFFF34;}
.cython.score-40 {background-color: #FFFF33;}
.cython.score-41 {background-color: #FFFF32;}
.cython.score-42 {background-color: #FFFF31;}
.cython.score-43 {background-color: #FFFF30;}
.cython.score-44 {background-color: #FFFF2f;}
.cython.score-45 {background-color: #FFFF2e;}
.cython.score-46 {background-color: #FFFF2d;}
.cython.score-47 {background-color: #FFFF2c;}
.cython.score-48 {background-color: #FFFF2b;}
.cython.score-49 {background-color: #FFFF2b;}
.cython.score-50 {background-color: #FFFF2a;}
.cython.score-51 {background-color: #FFFF29;}
.cython.score-52 {background-color: #FFFF29;}
.cython.score-53 {background-color: #FFFF28;}
.cython.score-54 {background-color: #FFFF27;}
.cython.score-55 {background-color: #FFFF27;}
.cython.score-56 {background-color: #FFFF26;}
.cython.score-57 {background-color: #FFFF26;}
.cython.score-58 {background-color: #FFFF25;}
.cython.score-59 {background-color: #FFFF24;}
.cython.score-60 {background-color: #FFFF24;}
.cython.score-61 {background-color: #FFFF23;}
.cython.score-62 {background-color: #FFFF23;}
.cython.score-63 {background-color: #FFFF22;}
.cython.score-64 {background-color: #FFFF22;}
.cython.score-65 {background-color: #FFFF22;}
.cython.score-66 {background-color: #FFFF21;}
.cython.score-67 {background-color: #FFFF21;}
.cython.score-68 {background-color: #FFFF20;}
.cython.score-69 {background-color: #FFFF20;}
.cython.score-70 {background-color: #FFFF1f;}
.cython.score-71 {background-color: #FFFF1f;}
.cython.score-72 {background-color: #FFFF1f;}
.cython.score-73 {background-color: #FFFF1e;}
.cython.score-74 {background-color: #FFFF1e;}
.cython.score-75 {background-color: #FFFF1e;}
.cython.score-76 {background-color: #FFFF1d;}
.cython.score-77 {background-color: #FFFF1d;}
.cython.score-78 {background-color: #FFFF1c;}
.cython.score-79 {background-color: #FFFF1c;}
.cython.score-80 {background-color: #FFFF1c;}
.cython.score-81 {background-color: #FFFF1c;}
.cython.score-82 {background-color: #FFFF1b;}
.cython.score-83 {background-color: #FFFF1b;}
.cython.score-84 {background-color: #FFFF1b;}
.cython.score-85 {background-color: #FFFF1a;}
.cython.score-86 {background-color: #FFFF1a;}
.cython.score-87 {background-color: #FFFF1a;}
.cython.score-88 {background-color: #FFFF1a;}
.cython.score-89 {background-color: #FFFF19;}
.cython.score-90 {background-color: #FFFF19;}
.cython.score-91 {background-color: #FFFF19;}
.cython.score-92 {background-color: #FFFF19;}
.cython.score-93 {background-color: #FFFF18;}
.cython.score-94 {background-color: #FFFF18;}
.cython.score-95 {background-color: #FFFF18;}
.cython.score-96 {background-color: #FFFF18;}
.cython.score-97 {background-color: #FFFF17;}
.cython.score-98 {background-color: #FFFF17;}
.cython.score-99 {background-color: #FFFF17;}
.cython.score-100 {background-color: #FFFF17;}
.cython.score-101 {background-color: #FFFF16;}
.cython.score-102 {background-color: #FFFF16;}
.cython.score-103 {background-color: #FFFF16;}
.cython.score-104 {background-color: #FFFF16;}
.cython.score-105 {background-color: #FFFF16;}
.cython.score-106 {background-color: #FFFF15;}
.cython.score-107 {background-color: #FFFF15;}
.cython.score-108 {background-color: #FFFF15;}
.cython.score-109 {background-color: #FFFF15;}
.cython.score-110 {background-color: #FFFF15;}
.cython.score-111 {background-color: #FFFF15;}
.cython.score-112 {background-color: #FFFF14;}
.cython.score-113 {background-color: #FFFF14;}
.cython.score-114 {background-color: #FFFF14;}
.cython.score-115 {background-color: #FFFF14;}
.cython.score-116 {background-color: #FFFF14;}
.cython.score-117 {background-color: #FFFF14;}
.cython.score-118 {background-color: #FFFF13;}
.cython.score-119 {background-color: #FFFF13;}
.cython.score-120 {background-color: #FFFF13;}
.cython.score-121 {background-color: #FFFF13;}
.cython.score-122 {background-color: #FFFF13;}
.cython.score-123 {background-color: #FFFF13;}
.cython.score-124 {background-color: #FFFF13;}
.cython.score-125 {background-color: #FFFF12;}
.cython.score-126 {background-color: #FFFF12;}
.cython.score-127 {background-color: #FFFF12;}
.cython.score-128 {background-color: #FFFF12;}
.cython.score-129 {background-color: #FFFF12;}
.cython.score-130 {background-color: #FFFF12;}
.cython.score-131 {background-color: #FFFF12;}
.cython.score-132 {background-color: #FFFF11;}
.cython.score-133 {background-color: #FFFF11;}
.cython.score-134 {background-color: #FFFF11;}
.cython.score-135 {background-color: #FFFF11;}
.cython.score-136 {background-color: #FFFF11;}
.cython.score-137 {background-color: #FFFF11;}
.cython.score-138 {background-color: #FFFF11;}
.cython.score-139 {background-color: #FFFF11;}
.cython.score-140 {background-color: #FFFF11;}
.cython.score-141 {background-color: #FFFF10;}
.cython.score-142 {background-color: #FFFF10;}
.cython.score-143 {background-color: #FFFF10;}
.cython.score-144 {background-color: #FFFF10;}
.cython.score-145 {background-color: #FFFF10;}
.cython.score-146 {background-color: #FFFF10;}
.cython.score-147 {background-color: #FFFF10;}
.cython.score-148 {background-color: #FFFF10;}
.cython.score-149 {background-color: #FFFF10;}
.cython.score-150 {background-color: #FFFF0f;}
.cython.score-151 {background-color: #FFFF0f;}
.cython.score-152 {background-color: #FFFF0f;}
.cython.score-153 {background-color: #FFFF0f;}
.cython.score-154 {background-color: #FFFF0f;}
.cython.score-155 {background-color: #FFFF0f;}
.cython.score-156 {background-color: #FFFF0f;}
.cython.score-157 {background-color: #FFFF0f;}
.cython.score-158 {background-color: #FFFF0f;}
.cython.score-159 {background-color: #FFFF0f;}
.cython.score-160 {background-color: #FFFF0f;}
.cython.score-161 {background-color: #FFFF0e;}
.cython.score-162 {background-color: #FFFF0e;}
.cython.score-163 {background-color: #FFFF0e;}
.cython.score-164 {background-color: #FFFF0e;}
.cython.score-165 {background-color: #FFFF0e;}
.cython.score-166 {background-color: #FFFF0e;}
.cython.score-167 {background-color: #FFFF0e;}
.cython.score-168 {background-color: #FFFF0e;}
.cython.score-169 {background-color: #FFFF0e;}
.cython.score-170 {background-color: #FFFF0e;}
.cython.score-171 {background-color: #FFFF0e;}
.cython.score-172 {background-color: #FFFF0e;}
.cython.score-173 {background-color: #FFFF0d;}
.cython.score-174 {background-color: #FFFF0d;}
.cython.score-175 {background-color: #FFFF0d;}
.cython.score-176 {background-color: #FFFF0d;}
.cython.score-177 {background-color: #FFFF0d;}
.cython.score-178 {background-color: #FFFF0d;}
.cython.score-179 {background-color: #FFFF0d;}
.cython.score-180 {background-color: #FFFF0d;}
.cython.score-181 {background-color: #FFFF0d;}
.cython.score-182 {background-color: #FFFF0d;}
.cython.score-183 {background-color: #FFFF0d;}
.cython.score-184 {background-color: #FFFF0d;}
.cython.score-185 {background-color: #FFFF0d;}
.cython.score-186 {background-color: #FFFF0d;}
.cython.score-187 {background-color: #FFFF0c;}
.cython.score-188 {background-color: #FFFF0c;}
.cython.score-189 {background-color: #FFFF0c;}
.cython.score-190 {background-color: #FFFF0c;}
.cython.score-191 {background-color: #FFFF0c;}
.cython.score-192 {background-color: #FFFF0c;}
.cython.score-193 {background-color: #FFFF0c;}
.cython.score-194 {background-color: #FFFF0c;}
.cython.score-195 {background-color: #FFFF0c;}
.cython.score-196 {background-color: #FFFF0c;}
.cython.score-197 {background-color: #FFFF0c;}
.cython.score-198 {background-color: #FFFF0c;}
.cython.score-199 {background-color: #FFFF0c;}
.cython.score-200 {background-color: #FFFF0c;}
.cython.score-201 {background-color: #FFFF0c;}
.cython.score-202 {background-color: #FFFF0c;}
.cython.score-203 {background-color: #FFFF0b;}
.cython.score-204 {background-color: #FFFF0b;}
.cython.score-205 {background-color: #FFFF0b;}
.cython.score-206 {background-color: #FFFF0b;}
.cython.score-207 {background-color: #FFFF0b;}
.cython.score-208 {background-color: #FFFF0b;}
.cython.score-209 {background-color: #FFFF0b;}
.cython.score-210 {background-color: #FFFF0b;}
.cython.score-211 {background-color: #FFFF0b;}
.cython.score-212 {background-color: #FFFF0b;}
.cython.score-213 {background-color: #FFFF0b;}
.cython.score-214 {background-color: #FFFF0b;}
.cython.score-215 {background-color: #FFFF0b;}
.cython.score-216 {background-color: #FFFF0b;}
.cython.score-217 {background-color: #FFFF0b;}
.cython.score-218 {background-color: #FFFF0b;}
.cython.score-219 {background-color: #FFFF0b;}
.cython.score-220 {background-color: #FFFF0b;}
.cython.score-221 {background-color: #FFFF0b;}
.cython.score-222 {background-color: #FFFF0a;}
.cython.score-223 {background-color: #FFFF0a;}
.cython.score-224 {background-color: #FFFF0a;}
.cython.score-225 {background-color: #FFFF0a;}
.cython.score-226 {background-color: #FFFF0a;}
.cython.score-227 {background-color: #FFFF0a;}
.cython.score-228 {background-color: #FFFF0a;}
.cython.score-229 {background-color: #FFFF0a;}
.cython.score-230 {background-color: #FFFF0a;}
.cython.score-231 {background-color: #FFFF0a;}
.cython.score-232 {background-color: #FFFF0a;}
.cython.score-233 {background-color: #FFFF0a;}
.cython.score-234 {background-color: #FFFF0a;}
.cython.score-235 {background-color: #FFFF0a;}
.cython.score-236 {background-color: #FFFF0a;}
.cython.score-237 {background-color: #FFFF0a;}
.cython.score-238 {background-color: #FFFF0a;}
.cython.score-239 {background-color: #FFFF0a;}
.cython.score-240 {background-color: #FFFF0a;}
.cython.score-241 {background-color: #FFFF0a;}
.cython.score-242 {background-color: #FFFF0a;}
.cython.score-243 {background-color: #FFFF0a;}
.cython.score-244 {background-color: #FFFF0a;}
.cython.score-245 {background-color: #FFFF0a;}
.cython.score-246 {background-color: #FFFF09;}
.cython.score-247 {background-color: #FFFF09;}
.cython.score-248 {background-color: #FFFF09;}
.cython.score-249 {background-color: #FFFF09;}
.cython.score-250 {background-color: #FFFF09;}
.cython.score-251 {background-color: #FFFF09;}
.cython.score-252 {background-color: #FFFF09;}
.cython.score-253 {background-color: #FFFF09;}
.cython.score-254 {background-color: #FFFF09;}
.cython .hll { background-color: #ffffcc }
.cython  { background: #f8f8f8; }
.cython .c { color: #408080; font-style: italic } /* Comment */
.cython .err { border: 1px solid #FF0000 } /* Error */
.cython .k { color: #008000; font-weight: bold } /* Keyword */
.cython .o { color: #666666 } /* Operator */
.cython .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.cython .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cython .cp { color: #BC7A00 } /* Comment.Preproc */
.cython .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.cython .c1 { color: #408080; font-style: italic } /* Comment.Single */
.cython .cs { color: #408080; font-style: italic } /* Comment.Special */
.cython .gd { color: #A00000 } /* Generic.Deleted */
.cython .ge { font-style: italic } /* Generic.Emph */
.cython .gr { color: #FF0000 } /* Generic.Error */
.cython .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.cython .gi { color: #00A000 } /* Generic.Inserted */
.cython .go { color: #888888 } /* Generic.Output */
.cython .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.cython .gs { font-weight: bold } /* Generic.Strong */
.cython .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.cython .gt { color: #0044DD } /* Generic.Traceback */
.cython .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.cython .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.cython .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.cython .kp { color: #008000 } /* Keyword.Pseudo */
.cython .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.cython .kt { color: #B00040 } /* Keyword.Type */
.cython .m { color: #666666 } /* Literal.Number */
.cython .s { color: #BA2121 } /* Literal.String */
.cython .na { color: #7D9029 } /* Name.Attribute */
.cython .nb { color: #008000 } /* Name.Builtin */
.cython .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.cython .no { color: #880000 } /* Name.Constant */
.cython .nd { color: #AA22FF } /* Name.Decorator */
.cython .ni { color: #999999; font-weight: bold } /* Name.Entity */
.cython .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.cython .nf { color: #0000FF } /* Name.Function */
.cython .nl { color: #A0A000 } /* Name.Label */
.cython .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.cython .nt { color: #008000; font-weight: bold } /* Name.Tag */
.cython .nv { color: #19177C } /* Name.Variable */
.cython .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.cython .w { color: #bbbbbb } /* Text.Whitespace */
.cython .mb { color: #666666 } /* Literal.Number.Bin */
.cython .mf { color: #666666 } /* Literal.Number.Float */
.cython .mh { color: #666666 } /* Literal.Number.Hex */
.cython .mi { color: #666666 } /* Literal.Number.Integer */
.cython .mo { color: #666666 } /* Literal.Number.Oct */
.cython .sb { color: #BA2121 } /* Literal.String.Backtick */
.cython .sc { color: #BA2121 } /* Literal.String.Char */
.cython .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.cython .s2 { color: #BA2121 } /* Literal.String.Double */
.cython .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.cython .sh { color: #BA2121 } /* Literal.String.Heredoc */
.cython .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.cython .sx { color: #008000 } /* Literal.String.Other */
.cython .sr { color: #BB6688 } /* Literal.String.Regex */
.cython .s1 { color: #BA2121 } /* Literal.String.Single */
.cython .ss { color: #19177C } /* Literal.String.Symbol */
.cython .bp { color: #008000 } /* Name.Builtin.Pseudo */
.cython .vc { color: #19177C } /* Name.Variable.Class */
.cython .vg { color: #19177C } /* Name.Variable.Global */
.cython .vi { color: #19177C } /* Name.Variable.Instance */
.cython .il { color: #666666 } /* Literal.Number.Integer.Long */
    </style>

</head>
<body class="cython">
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 0.25.1</span></p>
<p>
    <span style="background-color: #FFFF00">Yellow lines</span> hint at Python interaction.<br />
    Click on a line that starts with a "<code>+</code>" to see the C code that Cython generated for it.
</p>
<div class="cython"><pre class="cython line score-27" onclick='toggleDiv(this)'>+<span class="">001</span>: <span class="k">import</span> <span class="nn">pycalphad.variables</span> <span class="k">as</span> <span class="nn">v</span></pre>
<pre class='cython code score-27 '>  <span class='trace'>__Pyx_TraceLine</span>(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s__33);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s__33);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s__33);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_variables, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_v, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
/* … */
  <span class='trace'>__Pyx_TraceLine</span>(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">002</span>: <span class="k">from</span> <span class="nn">pycalphad.core.utils</span> <span class="k">import</span> <span class="n">unpack_kwarg</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(2,0,__PYX_ERR(0, 2, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_unpack_kwarg);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_unpack_kwarg);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_unpack_kwarg);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_utils, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_unpack_kwarg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_unpack_kwarg, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-29" onclick='toggleDiv(this)'>+<span class="">003</span>: <span class="k">from</span> <span class="nn">pycalphad.core.utils</span> <span class="k">import</span> <span class="n">unpack_condition</span><span class="p">,</span> <span class="n">unpack_phases</span></pre>
<pre class='cython code score-29 '>  <span class='trace'>__Pyx_TraceLine</span>(3,0,__PYX_ERR(0, 3, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_unpack_condition);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_unpack_condition);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_unpack_condition);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_unpack_phases);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_unpack_phases);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 1, __pyx_n_s_unpack_phases);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_utils, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_unpack_condition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_unpack_condition, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_unpack_phases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_unpack_phases, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-29" onclick='toggleDiv(this)'>+<span class="">004</span>: <span class="k">from</span> <span class="nn">pycalphad</span> <span class="k">import</span> <span class="n">calculate</span><span class="p">,</span> <span class="n">Model</span></pre>
<pre class='cython code score-29 '>  <span class='trace'>__Pyx_TraceLine</span>(4,0,__PYX_ERR(0, 4, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_calculate);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_calculate);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_calculate);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Model);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Model);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 1, __pyx_n_s_Model);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_calculate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_calculate, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_Model); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Model, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">005</span>: <span class="k">from</span> <span class="nn">pycalphad.constraints</span> <span class="k">import</span> <span class="n">mole_fraction</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(5,0,__PYX_ERR(0, 5, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_mole_fraction);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_mole_fraction);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_mole_fraction);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_constraints, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_mole_fraction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_mole_fraction, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">006</span>: <span class="k">from</span> <span class="nn">pycalphad.core.lower_convex_hull</span> <span class="k">import</span> <span class="n">lower_convex_hull</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(6,0,__PYX_ERR(0, 6, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_lower_convex_hull);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_lower_convex_hull);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_lower_convex_hull);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_lower_convex_hull, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_lower_convex_hull); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_lower_convex_hull, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">007</span>: <span class="k">from</span> <span class="nn">pycalphad.core.sympydiff_utils</span> <span class="k">import</span> <span class="n">build_functions</span> <span class="k">as</span> <span class="n">compiled_build_functions</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(7,0,__PYX_ERR(0, 7, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_build_functions);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_build_functions);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_build_functions);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_sympydiff_utils, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_build_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_compiled_build_functions, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">008</span>: <span class="k">from</span> <span class="nn">pycalphad.core.constants</span> <span class="k">import</span> <span class="n">MIN_SITE_FRACTION</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(8,0,__PYX_ERR(0, 8, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_MIN_SITE_FRACTION);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_MIN_SITE_FRACTION);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_MIN_SITE_FRACTION);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_constants, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_MIN_SITE_FRACTION, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">009</span>: <span class="k">from</span> <span class="nn">pycalphad.core.eqsolver</span> <span class="k">import</span> <span class="n">_solve_eq_at_conditions</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(9,0,__PYX_ERR(0, 9, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_solve_eq_at_conditions);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_solve_eq_at_conditions);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_solve_eq_at_conditions);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_eqsolver, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_solve_eq_at_conditions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_solve_eq_at_conditions, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-29" onclick='toggleDiv(this)'>+<span class="">010</span>: <span class="k">from</span> <span class="nn">sympy</span> <span class="k">import</span> <span class="n">Add</span><span class="p">,</span> <span class="n">Symbol</span></pre>
<pre class='cython code score-29 '>  <span class='trace'>__Pyx_TraceLine</span>(10,0,__PYX_ERR(0, 10, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Add);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Add);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_Add);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Symbol);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Symbol);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 1, __pyx_n_s_Symbol);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_sympy, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_Add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Add, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Symbol, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">011</span>: <span class="k">import</span> <span class="nn">dask</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(11,0,__PYX_ERR(0, 11, __pyx_L1_error))
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_dask, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_dask, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">012</span>: <span class="k">from</span> <span class="nn">dask</span> <span class="k">import</span> <span class="n">delayed</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(12,0,__PYX_ERR(0, 12, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_delayed);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_delayed);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_delayed);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_dask, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_delayed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_delayed, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-16" onclick='toggleDiv(this)'>+<span class="">013</span>: <span class="k">import</span> <span class="nn">dask.multiprocessing</span><span class="o">,</span> <span class="nn">dask.async</span></pre>
<pre class='cython code score-16 '>  <span class='trace'>__Pyx_TraceLine</span>(13,0,__PYX_ERR(0, 13, __pyx_L1_error))
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_dask_multiprocessing, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_dask, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_dask_async, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_dask, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">014</span>: <span class="k">from</span> <span class="nn">xarray</span> <span class="k">import</span> <span class="n">Dataset</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(14,0,__PYX_ERR(0, 14, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Dataset);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Dataset);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_Dataset);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_xarray, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Dataset, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">015</span>: <span class="k">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-0"> <span class="">016</span>: <span class="k">cimport</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span></pre>
<pre class="cython line score-29" onclick='toggleDiv(this)'>+<span class="">017</span>: <span class="k">from</span> <span class="nn">collections</span> <span class="k">import</span> <span class="n">namedtuple</span><span class="p">,</span> <span class="n">OrderedDict</span></pre>
<pre class='cython code score-29 '>
  /* "_cython_magic_179ec25e50428c13c53b0ba863f4b74e.pyx":17
 * import numpy as np
 * cimport numpy as np
 * from collections import namedtuple, OrderedDict             # <<<<<<<<<<<<<<
 * from datetime import datetime
 * from pycalphad.core.eqsolver import *
 */
  <span class='trace'>__Pyx_TraceLine</span>(17,0,__PYX_ERR(0, 17, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_namedtuple);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_namedtuple);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s_namedtuple);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_OrderedDict);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_OrderedDict);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 1, __pyx_n_s_OrderedDict);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">018</span>: <span class="k">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span></pre>
<pre class='cython code score-19 '>  <span class='trace'>__Pyx_TraceLine</span>(18,0,__PYX_ERR(0, 18, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_datetime);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_datetime);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_datetime);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_datetime, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-11" onclick='toggleDiv(this)'>+<span class="">019</span>: <span class="k">from</span> <span class="nn">pycalphad.core.eqsolver</span> <span class="k">import</span> <span class="o">*</span></pre>
<pre class='cython code score-11 '>  <span class='trace'>__Pyx_TraceLine</span>(19,0,__PYX_ERR(0, 19, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s__33);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s__33);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_1, 0, __pyx_n_s__33);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_eqsolver, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-59" onclick='toggleDiv(this)'>+<span class="">020</span>: <span class="k">from</span> <span class="nn">pycalphad.core.eqsolver</span> <span class="k">import</span> <span class="n">_build_multiphase_gradient</span><span class="p">,</span> \</pre>
<pre class='cython code score-59 '>  <span class='trace'>__Pyx_TraceLine</span>(20,0,__PYX_ERR(0, 20, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_build_multiphase_gradient);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_build_multiphase_gradient);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_build_multiphase_gradient);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_build_multiphase_system);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_build_multiphase_system);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 1, __pyx_n_s_build_multiphase_system);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_compute_constraints);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_compute_constraints);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 2, __pyx_n_s_compute_constraints);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_compute_phase_dof);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_compute_phase_dof);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 3, __pyx_n_s_compute_phase_dof);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_remove_degenerate_phases);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_remove_degenerate_phases);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_2, 4, __pyx_n_s_remove_degenerate_phases);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_pycalphad_core_eqsolver, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_build_multiphase_gradient); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_build_multiphase_gradient, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_build_multiphase_system); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_build_multiphase_system, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_compute_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_compute_constraints, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_compute_phase_dof); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_compute_phase_dof, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_1, __pyx_n_s_remove_degenerate_phases); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_remove_degenerate_phases, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-0"> <span class="">021</span>:     <span class="n">_build_multiphase_system</span><span class="p">,</span> <span class="n">_compute_constraints</span><span class="p">,</span> <span class="n">_compute_phase_dof</span><span class="p">,</span> <span class="n">remove_degenerate_phases</span></pre>
<pre class="cython line score-0"> <span class="">022</span>: <span class="k">cimport</span> <span class="nn">cython</span></pre>
<pre class="cython line score-0"> <span class="">023</span>: </pre>
<pre class="cython line score-220" onclick='toggleDiv(this)'>+<span class="">024</span>: <span class="k">def</span> <span class="nf">_solve_eq_at_conditions</span><span class="p">(</span><span class="n">dbf</span><span class="p">,</span> <span class="n">comps</span><span class="p">,</span> <span class="n">properties</span><span class="p">,</span> <span class="n">phase_records</span><span class="p">,</span> <span class="n">callable_dict</span><span class="p">,</span> <span class="n">conds_keys</span><span class="p">,</span> <span class="n">verbose</span><span class="p">):</span></pre>
<pre class='cython code score-220 '>/* Python wrapper */
static PyObject *__pyx_pw_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e_1_solve_eq_at_conditions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e__solve_eq_at_conditions[] = "\n    Compute equilibrium for the given conditions.\n    This private function is meant to be called from a worker subprocess.\n    For that case, usually only a small slice of the master 'properties' is provided.\n    Since that slice will be copied, we also return the modified 'properties'.\n\n    Parameters\n    ----------\n    dbf : Database\n        Thermodynamic database containing the relevant parameters.\n    comps : list\n        Names of components to consider in the calculation.\n    properties : Dataset\n        Will be modified! Thermodynamic properties and conditions.\n    phase_records : dict of PhaseRecord\n        Details on phase callables.\n    callable_dict : dict of callable\n        Objective functions for each phase.\n    conds_keys : list of str\n        List of conditions axes in dimension order.\n    verbose : bool\n        Print details.\n\n    Returns\n    -------\n    properties : Dataset\n        Modified with equilibrium values.\n    ";
static PyMethodDef __pyx_mdef_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e_1_solve_eq_at_conditions = {"_solve_eq_at_conditions", (PyCFunction)__pyx_pw_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e_1_solve_eq_at_conditions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e__solve_eq_at_conditions};
static PyObject *__pyx_pw_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e_1_solve_eq_at_conditions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dbf = 0;
  PyObject *__pyx_v_comps = 0;
  PyObject *__pyx_v_properties = 0;
  PyObject *__pyx_v_phase_records = 0;
  PyObject *__pyx_v_callable_dict = 0;
  PyObject *__pyx_v_conds_keys = 0;
  PyObject *__pyx_v_verbose = 0;
  PyObject *__pyx_r = 0;
  <span class='refnanny'>__Pyx_RefNannyDeclarations</span>
  <span class='refnanny'>__Pyx_RefNannySetupContext</span>("_solve_eq_at_conditions (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dbf,&__pyx_n_s_comps,&__pyx_n_s_properties,&__pyx_n_s_phase_records,&__pyx_n_s_callable_dict,&__pyx_n_s_conds_keys,&__pyx_n_s_verbose,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 6);
        case  6: values[5] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 5);
        case  5: values[4] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 4);
        case  4: values[3] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 3);
        case  3: values[2] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 2);
        case  2: values[1] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 1);
        case  1: values[0] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = <span class='py_c_api'>PyDict_Size</span>(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_dbf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_comps)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 1); __PYX_ERR(0, 24, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_properties)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 2); __PYX_ERR(0, 24, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_phase_records)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 3); __PYX_ERR(0, 24, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_callable_dict)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 4); __PYX_ERR(0, 24, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_conds_keys)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 5); __PYX_ERR(0, 24, __pyx_L3_error)
        }
        case  6:
        if (likely((values[6] = <span class='py_c_api'>PyDict_GetItem</span>(__pyx_kwds, __pyx_n_s_verbose)) != 0)) kw_args--;
        else {
          <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, 6); __PYX_ERR(0, 24, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_solve_eq_at_conditions") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
      }
    } else if (<span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 0);
      values[1] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 1);
      values[2] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 2);
      values[3] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 3);
      values[4] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 4);
      values[5] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 5);
      values[6] = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_args, 6);
    }
    __pyx_v_dbf = values[0];
    __pyx_v_comps = values[1];
    __pyx_v_properties = values[2];
    __pyx_v_phase_records = values[3];
    __pyx_v_callable_dict = values[4];
    __pyx_v_conds_keys = values[5];
    __pyx_v_verbose = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  <span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("_solve_eq_at_conditions", 1, 7, 7, <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
  __pyx_L3_error:;
  <span class='pyx_c_api'>__Pyx_AddTraceback</span>("_cython_magic_179ec25e50428c13c53b0ba863f4b74e._solve_eq_at_conditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  <span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e__solve_eq_at_conditions(__pyx_self, __pyx_v_dbf, __pyx_v_comps, __pyx_v_properties, __pyx_v_phase_records, __pyx_v_callable_dict, __pyx_v_conds_keys, __pyx_v_verbose);

  /* function exit code */
  <span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
  return __pyx_r;
}

static PyObject *__pyx_pf_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e__solve_eq_at_conditions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dbf, PyObject *__pyx_v_comps, PyObject *__pyx_v_properties, PyObject *__pyx_v_phase_records, PyObject *__pyx_v_callable_dict, PyObject *__pyx_v_conds_keys, PyObject *__pyx_v_verbose) {
  double __pyx_v_indep_sum;
  int __pyx_v_num_phases;
  CYTHON_UNUSED int __pyx_v_num_vars;
  int __pyx_v_cur_iter;
  int __pyx_v_old_phase_length;
  int __pyx_v_new_phase_length;
  int __pyx_v_var_idx;
  int __pyx_v_sfidx;
  int __pyx_v_pfidx;
  int __pyx_v_m;
  int __pyx_v_n;
  PyArrayObject *__pyx_v_gradient_term = 0;
  PyArrayObject *__pyx_v_p_y = 0;
  PyArrayObject *__pyx_v_l_constraints = 0;
  PyArrayObject *__pyx_v_step = 0;
  PyArrayObject *__pyx_v_site_fracs = 0;
  PyArrayObject *__pyx_v_candidate_site_fracs = 0;
  PyArrayObject *__pyx_v_l_multipliers = 0;
  PyArrayObject *__pyx_v_new_l_multipliers = 0;
  PyArrayObject *__pyx_v_candidate_phase_fracs = 0;
  PyArrayObject *__pyx_v_phase_fracs = 0;
  PyArrayObject *__pyx_v_l_hessian = 0;
  PyArrayObject *__pyx_v_ymat = 0;
  PyArrayObject *__pyx_v_zmat = 0;
  PyArrayObject *__pyx_v_qmat = 0;
  PyArrayObject *__pyx_v_rmat = 0;
  PyArrayObject *__pyx_v_constraint_jac = 0;
  PyObject *__pyx_v_prop_MU_values = NULL;
  PyObject *__pyx_v_prop_NP_values = NULL;
  PyObject *__pyx_v_prop_Phase_values = NULL;
  PyObject *__pyx_v_prop_X_values = NULL;
  PyObject *__pyx_v_prop_Y_values = NULL;
  PyObject *__pyx_v_prop_GM_values = NULL;
  PyObject *__pyx_v_it = NULL;
  PyObject *__pyx_v_cur_conds = NULL;
  PyObject *__pyx_v_dependent_comp = NULL;
  PyObject *__pyx_v_mole_fractions = NULL;
  PyObject *__pyx_v_phases = NULL;
  PyObject *__pyx_v_zero_dof = NULL;
  PyObject *__pyx_v_phase_dof = NULL;
  PyObject *__pyx_v_name = NULL;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_active_in_subl = NULL;
  PyObject *__pyx_v_ais = NULL;
  PyObject *__pyx_v_constraint_hess = NULL;
  PyObject *__pyx_v_p_z = NULL;
  PyObject *__pyx_v_old_energy = NULL;
  PyObject *__pyx_v_old_chem_pots = NULL;
  PyObject *__pyx_v_candidate_l_constraints = NULL;
  PyObject *__pyx_v_candidate_constraint_jac = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_candidate_constraint_hess = NULL;
  PyObject *__pyx_v_candidate_energy = NULL;
  PyObject *__pyx_v_candidate_gradient_term = NULL;
  PyObject *__pyx_v_num_mass_bals = NULL;
  PyObject *__pyx_v_chemical_potentials = NULL;
  PyObject *__pyx_v_var_offset = NULL;
  Py_ssize_t __pyx_v_phase_idx;
  PyObject *__pyx_v_comp_idx = NULL;
  PyObject *__pyx_v_comp = NULL;
  PyObject *__pyx_v_total_comp = NULL;
  PyObject *__pyx_v_driving_force = NULL;
  PyObject *__pyx_v_no_progress = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_candidate_phase_fracs;
  __Pyx_Buffer __pyx_pybuffer_candidate_phase_fracs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_candidate_site_fracs;
  __Pyx_Buffer __pyx_pybuffer_candidate_site_fracs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_constraint_jac;
  __Pyx_Buffer __pyx_pybuffer_constraint_jac;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_gradient_term;
  __Pyx_Buffer __pyx_pybuffer_gradient_term;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_l_constraints;
  __Pyx_Buffer __pyx_pybuffer_l_constraints;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_l_hessian;
  __Pyx_Buffer __pyx_pybuffer_l_hessian;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_l_multipliers;
  __Pyx_Buffer __pyx_pybuffer_l_multipliers;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new_l_multipliers;
  __Pyx_Buffer __pyx_pybuffer_new_l_multipliers;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_p_y;
  __Pyx_Buffer __pyx_pybuffer_p_y;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_phase_fracs;
  __Pyx_Buffer __pyx_pybuffer_phase_fracs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_qmat;
  __Pyx_Buffer __pyx_pybuffer_qmat;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_rmat;
  __Pyx_Buffer __pyx_pybuffer_rmat;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_site_fracs;
  __Pyx_Buffer __pyx_pybuffer_site_fracs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_step;
  __Pyx_Buffer __pyx_pybuffer_step;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ymat;
  __Pyx_Buffer __pyx_pybuffer_ymat;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_zmat;
  __Pyx_Buffer __pyx_pybuffer_zmat;
  PyObject *__pyx_r = NULL;
  <span class='trace'>__Pyx_TraceDeclarations</span>
  <span class='trace'>__Pyx_TraceFrameInit</span>(__pyx_codeobj_)
  <span class='refnanny'>__Pyx_RefNannyDeclarations</span>
  <span class='refnanny'>__Pyx_RefNannySetupContext</span>("_solve_eq_at_conditions", 0);
  <span class='trace'>__Pyx_TraceCall</span>("_solve_eq_at_conditions", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
  __pyx_pybuffer_gradient_term.pybuffer.buf = NULL;
  __pyx_pybuffer_gradient_term.refcount = 0;
  __pyx_pybuffernd_gradient_term.data = NULL;
  __pyx_pybuffernd_gradient_term.rcbuffer = &__pyx_pybuffer_gradient_term;
  __pyx_pybuffer_p_y.pybuffer.buf = NULL;
  __pyx_pybuffer_p_y.refcount = 0;
  __pyx_pybuffernd_p_y.data = NULL;
  __pyx_pybuffernd_p_y.rcbuffer = &__pyx_pybuffer_p_y;
  __pyx_pybuffer_l_constraints.pybuffer.buf = NULL;
  __pyx_pybuffer_l_constraints.refcount = 0;
  __pyx_pybuffernd_l_constraints.data = NULL;
  __pyx_pybuffernd_l_constraints.rcbuffer = &__pyx_pybuffer_l_constraints;
  __pyx_pybuffer_step.pybuffer.buf = NULL;
  __pyx_pybuffer_step.refcount = 0;
  __pyx_pybuffernd_step.data = NULL;
  __pyx_pybuffernd_step.rcbuffer = &__pyx_pybuffer_step;
  __pyx_pybuffer_site_fracs.pybuffer.buf = NULL;
  __pyx_pybuffer_site_fracs.refcount = 0;
  __pyx_pybuffernd_site_fracs.data = NULL;
  __pyx_pybuffernd_site_fracs.rcbuffer = &__pyx_pybuffer_site_fracs;
  __pyx_pybuffer_candidate_site_fracs.pybuffer.buf = NULL;
  __pyx_pybuffer_candidate_site_fracs.refcount = 0;
  __pyx_pybuffernd_candidate_site_fracs.data = NULL;
  __pyx_pybuffernd_candidate_site_fracs.rcbuffer = &__pyx_pybuffer_candidate_site_fracs;
  __pyx_pybuffer_l_multipliers.pybuffer.buf = NULL;
  __pyx_pybuffer_l_multipliers.refcount = 0;
  __pyx_pybuffernd_l_multipliers.data = NULL;
  __pyx_pybuffernd_l_multipliers.rcbuffer = &__pyx_pybuffer_l_multipliers;
  __pyx_pybuffer_new_l_multipliers.pybuffer.buf = NULL;
  __pyx_pybuffer_new_l_multipliers.refcount = 0;
  __pyx_pybuffernd_new_l_multipliers.data = NULL;
  __pyx_pybuffernd_new_l_multipliers.rcbuffer = &__pyx_pybuffer_new_l_multipliers;
  __pyx_pybuffer_candidate_phase_fracs.pybuffer.buf = NULL;
  __pyx_pybuffer_candidate_phase_fracs.refcount = 0;
  __pyx_pybuffernd_candidate_phase_fracs.data = NULL;
  __pyx_pybuffernd_candidate_phase_fracs.rcbuffer = &__pyx_pybuffer_candidate_phase_fracs;
  __pyx_pybuffer_phase_fracs.pybuffer.buf = NULL;
  __pyx_pybuffer_phase_fracs.refcount = 0;
  __pyx_pybuffernd_phase_fracs.data = NULL;
  __pyx_pybuffernd_phase_fracs.rcbuffer = &__pyx_pybuffer_phase_fracs;
  __pyx_pybuffer_l_hessian.pybuffer.buf = NULL;
  __pyx_pybuffer_l_hessian.refcount = 0;
  __pyx_pybuffernd_l_hessian.data = NULL;
  __pyx_pybuffernd_l_hessian.rcbuffer = &__pyx_pybuffer_l_hessian;
  __pyx_pybuffer_ymat.pybuffer.buf = NULL;
  __pyx_pybuffer_ymat.refcount = 0;
  __pyx_pybuffernd_ymat.data = NULL;
  __pyx_pybuffernd_ymat.rcbuffer = &__pyx_pybuffer_ymat;
  __pyx_pybuffer_zmat.pybuffer.buf = NULL;
  __pyx_pybuffer_zmat.refcount = 0;
  __pyx_pybuffernd_zmat.data = NULL;
  __pyx_pybuffernd_zmat.rcbuffer = &__pyx_pybuffer_zmat;
  __pyx_pybuffer_qmat.pybuffer.buf = NULL;
  __pyx_pybuffer_qmat.refcount = 0;
  __pyx_pybuffernd_qmat.data = NULL;
  __pyx_pybuffernd_qmat.rcbuffer = &__pyx_pybuffer_qmat;
  __pyx_pybuffer_rmat.pybuffer.buf = NULL;
  __pyx_pybuffer_rmat.refcount = 0;
  __pyx_pybuffernd_rmat.data = NULL;
  __pyx_pybuffernd_rmat.rcbuffer = &__pyx_pybuffer_rmat;
  __pyx_pybuffer_constraint_jac.pybuffer.buf = NULL;
  __pyx_pybuffer_constraint_jac.refcount = 0;
  __pyx_pybuffernd_constraint_jac.data = NULL;
  __pyx_pybuffernd_constraint_jac.rcbuffer = &__pyx_pybuffer_constraint_jac;
/* … */
  /* function exit code */
  __pyx_L1_error:;
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_31);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_45);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    <span class='pyx_c_api'>__Pyx_ErrFetch</span>(&__pyx_type, &__pyx_value, &__pyx_tb);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_gradient_term.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_constraints.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_hessian.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_p_y.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_qmat.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_rmat.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_ymat.rcbuffer->pybuffer);
    <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_zmat.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_ErrRestore</span>(__pyx_type, __pyx_value, __pyx_tb);}
  <span class='pyx_c_api'>__Pyx_AddTraceback</span>("_cython_magic_179ec25e50428c13c53b0ba863f4b74e._solve_eq_at_conditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_gradient_term.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_constraints.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_hessian.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_p_y.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_qmat.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_rmat.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_ymat.rcbuffer->pybuffer);
  <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_zmat.rcbuffer->pybuffer);
  __pyx_L2:;
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_gradient_term);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_p_y);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_l_constraints);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_step);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_site_fracs);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_candidate_site_fracs);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_l_multipliers);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_new_l_multipliers);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_candidate_phase_fracs);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_phase_fracs);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_l_hessian);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_ymat);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_zmat);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_qmat);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_rmat);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>((PyObject *)__pyx_v_constraint_jac);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_MU_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_NP_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_Phase_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_X_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_Y_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_prop_GM_values);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_it);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_cur_conds);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_dependent_comp);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_mole_fractions);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_phases);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_zero_dof);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_phase_dof);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_name);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_active_in_subl);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_ais);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_constraint_hess);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_p_z);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_old_energy);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_old_chem_pots);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_candidate_l_constraints);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_candidate_constraint_jac);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_candidate_constraint_hess);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_candidate_energy);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_candidate_gradient_term);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_num_mass_bals);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_chemical_potentials);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_var_offset);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_comp_idx);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_comp);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_total_comp);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_driving_force);
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_no_progress);
  <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
  <span class='trace'>__Pyx_TraceReturn</span>(__pyx_r, 0);
  <span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
  return __pyx_r;
}
/* … */
  __pyx_tuple__34 = <span class='py_c_api'>PyTuple_Pack</span>(69, __pyx_n_s_dbf, __pyx_n_s_comps, __pyx_n_s_properties, __pyx_n_s_phase_records, __pyx_n_s_callable_dict, __pyx_n_s_conds_keys, __pyx_n_s_verbose, __pyx_n_s_indep_sum, __pyx_n_s_num_phases, __pyx_n_s_num_vars, __pyx_n_s_cur_iter, __pyx_n_s_old_phase_length, __pyx_n_s_new_phase_length, __pyx_n_s_var_idx, __pyx_n_s_sfidx, __pyx_n_s_pfidx, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_gradient_term, __pyx_n_s_p_y, __pyx_n_s_l_constraints, __pyx_n_s_step, __pyx_n_s_site_fracs, __pyx_n_s_candidate_site_fracs, __pyx_n_s_l_multipliers, __pyx_n_s_new_l_multipliers, __pyx_n_s_candidate_phase_fracs, __pyx_n_s_phase_fracs, __pyx_n_s_l_hessian, __pyx_n_s_ymat, __pyx_n_s_zmat, __pyx_n_s_qmat, __pyx_n_s_rmat, __pyx_n_s_constraint_jac, __pyx_n_s_prop_MU_values, __pyx_n_s_prop_NP_values, __pyx_n_s_prop_Phase_values, __pyx_n_s_prop_X_values, __pyx_n_s_prop_Y_values, __pyx_n_s_prop_GM_values, __pyx_n_s_it, __pyx_n_s_cur_conds, __pyx_n_s_dependent_comp, __pyx_n_s_mole_fractions, __pyx_n_s_phases, __pyx_n_s_zero_dof, __pyx_n_s_phase_dof, __pyx_n_s_name, __pyx_n_s_idx, __pyx_n_s_active_in_subl, __pyx_n_s_ais, __pyx_n_s_constraint_hess, __pyx_n_s_p_z, __pyx_n_s_old_energy, __pyx_n_s_old_chem_pots, __pyx_n_s_candidate_l_constraints, __pyx_n_s_candidate_constraint_jac, __pyx_n_s_candidate_constraint_hess, __pyx_n_s_candidate_energy, __pyx_n_s_candidate_gradient_term, __pyx_n_s_num_mass_bals, __pyx_n_s_chemical_potentials, __pyx_n_s_var_offset, __pyx_n_s_phase_idx, __pyx_n_s_comp_idx, __pyx_n_s_comp, __pyx_n_s_total_comp, __pyx_n_s_driving_force, __pyx_n_s_no_progress); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 24, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__34);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__34);
/* … */
  <span class='trace'>__Pyx_TraceLine</span>(24,0,__PYX_ERR(0, 24, __pyx_L1_error))
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_CyFunction_NewEx</span>(&__pyx_mdef_46_cython_magic_179ec25e50428c13c53b0ba863f4b74e_1_solve_eq_at_conditions, 0, __pyx_n_s_solve_eq_at_conditions, NULL, __pyx_n_s_cython_magic_179ec25e50428c13c5, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_solve_eq_at_conditions, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class="cython line score-0"> <span class="">025</span>:     <span class="sd">"""</span></pre>
<pre class="cython line score-0"> <span class="">026</span>: <span class="sd">    Compute equilibrium for the given conditions.</span></pre>
<pre class="cython line score-0"> <span class="">027</span>: <span class="sd">    This private function is meant to be called from a worker subprocess.</span></pre>
<pre class="cython line score-0"> <span class="">028</span>: <span class="sd">    For that case, usually only a small slice of the master 'properties' is provided.</span></pre>
<pre class="cython line score-0"> <span class="">029</span>: <span class="sd">    Since that slice will be copied, we also return the modified 'properties'.</span></pre>
<pre class="cython line score-0"> <span class="">030</span>: </pre>
<pre class="cython line score-0"> <span class="">031</span>: <span class="sd">    Parameters</span></pre>
<pre class="cython line score-0"> <span class="">032</span>: <span class="sd">    ----------</span></pre>
<pre class="cython line score-0"> <span class="">033</span>: <span class="sd">    dbf : Database</span></pre>
<pre class="cython line score-0"> <span class="">034</span>: <span class="sd">        Thermodynamic database containing the relevant parameters.</span></pre>
<pre class="cython line score-0"> <span class="">035</span>: <span class="sd">    comps : list</span></pre>
<pre class="cython line score-0"> <span class="">036</span>: <span class="sd">        Names of components to consider in the calculation.</span></pre>
<pre class="cython line score-0"> <span class="">037</span>: <span class="sd">    properties : Dataset</span></pre>
<pre class="cython line score-0"> <span class="">038</span>: <span class="sd">        Will be modified! Thermodynamic properties and conditions.</span></pre>
<pre class="cython line score-0"> <span class="">039</span>: <span class="sd">    phase_records : dict of PhaseRecord</span></pre>
<pre class="cython line score-0"> <span class="">040</span>: <span class="sd">        Details on phase callables.</span></pre>
<pre class="cython line score-0"> <span class="">041</span>: <span class="sd">    callable_dict : dict of callable</span></pre>
<pre class="cython line score-0"> <span class="">042</span>: <span class="sd">        Objective functions for each phase.</span></pre>
<pre class="cython line score-0"> <span class="">043</span>: <span class="sd">    conds_keys : list of str</span></pre>
<pre class="cython line score-0"> <span class="">044</span>: <span class="sd">        List of conditions axes in dimension order.</span></pre>
<pre class="cython line score-0"> <span class="">045</span>: <span class="sd">    verbose : bool</span></pre>
<pre class="cython line score-0"> <span class="">046</span>: <span class="sd">        Print details.</span></pre>
<pre class="cython line score-0"> <span class="">047</span>: </pre>
<pre class="cython line score-0"> <span class="">048</span>: <span class="sd">    Returns</span></pre>
<pre class="cython line score-0"> <span class="">049</span>: <span class="sd">    -------</span></pre>
<pre class="cython line score-0"> <span class="">050</span>: <span class="sd">    properties : Dataset</span></pre>
<pre class="cython line score-0"> <span class="">051</span>: <span class="sd">        Modified with equilibrium values.</span></pre>
<pre class="cython line score-0"> <span class="">052</span>: <span class="sd">    """</span></pre>
<pre class="cython line score-0"> <span class="">053</span>:     <span class="k">cdef</span><span class="p">:</span></pre>
<pre class="cython line score-0"> <span class="">054</span>:         <span class="n">double</span> <span class="n">indep_sum</span></pre>
<pre class="cython line score-0"> <span class="">055</span>:         <span class="nb">int</span> <span class="n">num_phases</span><span class="p">,</span> <span class="n">num_vars</span><span class="p">,</span> <span class="n">cur_iter</span><span class="p">,</span> <span class="n">old_phase_length</span><span class="p">,</span> <span class="n">new_phase_length</span><span class="p">,</span> <span class="n">var_idx</span><span class="p">,</span> <span class="n">sfidx</span><span class="p">,</span> <span class="n">pfidx</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">n</span></pre>
<pre class="cython line score-0"> <span class="">056</span>:         <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">[</span><span class="n">ndim</span><span class="o">=</span><span class="mf">1</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float64_t</span><span class="p">]</span> <span class="n">gradient_term</span><span class="p">,</span> <span class="n">p_y</span><span class="p">,</span> <span class="n">l_constraints</span><span class="p">,</span> <span class="n">step</span></pre>
<pre class="cython line score-0"> <span class="">057</span>:         <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">[</span><span class="n">ndim</span><span class="o">=</span><span class="mf">1</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float64_t</span><span class="p">]</span> <span class="n">site_fracs</span><span class="p">,</span> <span class="n">candidate_site_fracs</span><span class="p">,</span> <span class="n">l_multipliers</span><span class="p">,</span> <span class="n">new_l_multipliers</span><span class="p">,</span> <span class="n">candidate_phase_fracs</span><span class="p">,</span> <span class="n">phase_fracs</span></pre>
<pre class="cython line score-0"> <span class="">058</span>:         <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">[</span><span class="n">ndim</span><span class="o">=</span><span class="mf">2</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float64_t</span><span class="p">]</span> <span class="n">l_hessian</span><span class="p">,</span> <span class="n">ymat</span><span class="p">,</span> <span class="n">zmat</span><span class="p">,</span> <span class="n">qmat</span><span class="p">,</span> <span class="n">rmat</span><span class="p">,</span> <span class="n">constraint_jac</span></pre>
<pre class="cython line score-0"> <span class="">059</span>:     <span class="c"># Factored out via profiling</span></pre>
<pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">060</span>:     <span class="n">prop_MU_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'MU'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(60,0,__PYX_ERR(0, 60, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_MU); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_prop_MU_values = __pyx_t_2;
  __pyx_t_2 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">061</span>:     <span class="n">prop_NP_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'NP'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(61,0,__PYX_ERR(0, 61, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_NP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_prop_NP_values = __pyx_t_1;
  __pyx_t_1 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">062</span>:     <span class="n">prop_Phase_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'Phase'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(62,0,__PYX_ERR(0, 62, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_Phase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_prop_Phase_values = __pyx_t_2;
  __pyx_t_2 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">063</span>:     <span class="n">prop_X_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'X'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(63,0,__PYX_ERR(0, 63, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_prop_X_values = __pyx_t_1;
  __pyx_t_1 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">064</span>:     <span class="n">prop_Y_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'Y'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(64,0,__PYX_ERR(0, 64, __pyx_L1_error))
  __pyx_t_1 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_Y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_prop_Y_values = __pyx_t_2;
  __pyx_t_2 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">065</span>:     <span class="n">prop_GM_values</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'GM'</span><span class="p">]</span><span class="o">.</span><span class="n">values</span></pre>
<pre class='cython code score-8 '>  <span class='trace'>__Pyx_TraceLine</span>(65,0,__PYX_ERR(0, 65, __pyx_L1_error))
  __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_GM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_prop_GM_values = __pyx_t_1;
  __pyx_t_1 = 0;
</pre><pre class="cython line score-0"> <span class="">066</span>: </pre>
<pre class="cython line score-35" onclick='toggleDiv(this)'>+<span class="">067</span>:     <span class="n">it</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nditer</span><span class="p">(</span><span class="n">prop_GM_values</span><span class="p">,</span> <span class="n">flags</span><span class="o">=</span><span class="p">[</span><span class="s">'multi_index'</span><span class="p">])</span></pre>
<pre class='cython code score-35 '>  <span class='trace'>__Pyx_TraceLine</span>(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
  __pyx_t_1 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_nditer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_prop_GM_values);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_prop_GM_values);
  <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_1, 0, __pyx_v_prop_GM_values);
  __pyx_t_3 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
  __pyx_t_4 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_u_multi_index);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_u_multi_index);
  <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_4, 0, __pyx_n_u_multi_index);
  if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_3, __pyx_n_s_flags, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
  <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_it = __pyx_t_4;
  __pyx_t_4 = 0;
</pre><pre class="cython line score-0"> <span class="">068</span>: </pre>
<pre class="cython line score-0"> <span class="">069</span>:     <span class="c">#if verbose:</span></pre>
<pre class="cython line score-0"> <span class="">070</span>:     <span class="c">#    print('INITIAL CONFIGURATION')</span></pre>
<pre class="cython line score-0"> <span class="">071</span>:     <span class="c">#    print(properties.MU)</span></pre>
<pre class="cython line score-0"> <span class="">072</span>:     <span class="c">#    print(properties.Phase)</span></pre>
<pre class="cython line score-0"> <span class="">073</span>:     <span class="c">#    print(properties.NP)</span></pre>
<pre class="cython line score-0"> <span class="">074</span>:     <span class="c">#    print(properties.X)</span></pre>
<pre class="cython line score-0"> <span class="">075</span>:     <span class="c">#    print(properties.Y)</span></pre>
<pre class="cython line score-0"> <span class="">076</span>:     <span class="c">#    print('---------------------')</span></pre>
<pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">077</span>:     <span class="k">while</span> <span class="ow">not</span> <span class="n">it</span><span class="o">.</span><span class="n">finished</span><span class="p">:</span></pre>
<pre class='cython code score-5 '>  <span class='trace'>__Pyx_TraceLine</span>(77,0,__PYX_ERR(0, 77, __pyx_L1_error))
  while (1) {
    __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_finished); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
    __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 77, __pyx_L1_error)
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (!__pyx_t_6) break;
</pre><pre class="cython line score-0"> <span class="">078</span>:         <span class="c"># A lot of this code relies on cur_conds being ordered!</span></pre>
<pre class="cython line score-53" onclick='toggleDiv(this)'>+<span class="">079</span>:         <span class="n">cur_conds</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">(</span><span class="nb">zip</span><span class="p">(</span><span class="n">conds_keys</span><span class="p">,</span></pre>
<pre class='cython code score-53 '>    <span class='trace'>__Pyx_TraceLine</span>(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
    __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    { /* enter inner scope */
      PyObject *__pyx_7genexpr__pyx_v_a = NULL;
      PyObject *__pyx_7genexpr__pyx_v_b = NULL;
/* … */
    <span class='trace'>__Pyx_TraceLine</span>(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
    __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
    <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_conds_keys);
    <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_conds_keys);
    <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_v_conds_keys);
    <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
    <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_zip, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
      __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      {
        __pyx_t_14 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 79, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      }
    }
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_cur_conds, __pyx_t_4);
    __pyx_t_4 = 0;
</pre><pre class="cython line score-60" onclick='toggleDiv(this)'>+<span class="">080</span>:                                     <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">properties</span><span class="p">[</span><span class="s">'GM'</span><span class="p">]</span><span class="o">.</span><span class="n">coords</span><span class="p">[</span><span class="n">b</span><span class="p">][</span><span class="n">a</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float</span><span class="p">)</span></pre>
<pre class='cython code score-60 '>      <span class='trace'>__Pyx_TraceLine</span>(80,0,__PYX_ERR(0, 80, __pyx_L7_error))
      __pyx_t_1 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L7_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(80,0,__PYX_ERR(0, 80, __pyx_L7_error))
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_GM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_coords); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_10, __pyx_7genexpr__pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_2, __pyx_7genexpr__pyx_v_a); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_10 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_float); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_1, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 80, __pyx_L7_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
</pre><pre class="cython line score-112" onclick='toggleDiv(this)'>+<span class="">081</span>:                                      <span class="k">for</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">,</span> <span class="n">conds_keys</span><span class="p">)]))</span></pre>
<pre class='cython code score-112 '>      <span class='trace'>__Pyx_TraceLine</span>(81,0,__PYX_ERR(0, 81, __pyx_L7_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L7_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 81, __pyx_L7_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_conds_keys);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_conds_keys);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 1, __pyx_v_conds_keys);
      __pyx_t_2 = 0;
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_zip, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L7_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_2)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_2)) {
        __pyx_t_7 = __pyx_t_2; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_7 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 81, __pyx_L7_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 81, __pyx_L7_error)
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_7))) {
            if (__pyx_t_8 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_7, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 81, __pyx_L7_error)
            #else
            __pyx_t_2 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L7_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_8 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_7, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 81, __pyx_L7_error)
            #else
            __pyx_t_2 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L7_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_9(__pyx_t_7);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
              else __PYX_ERR(0, 81, __pyx_L7_error)
            }
            break;
          }
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        }
        if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_2))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_2))) {
          PyObject* sequence = __pyx_t_2;
          #if !CYTHON_COMPILING_IN_PYPY
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(2);
            else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
            __PYX_ERR(0, 81, __pyx_L7_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
            __pyx_t_10 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
            __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
          } else {
            __pyx_t_10 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
            __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
          }
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
          #else
          __pyx_t_10 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L7_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L7_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          #endif
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_12 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 81, __pyx_L7_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
          index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L10_unpacking_failed;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L10_unpacking_failed;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 81, __pyx_L7_error)
          __pyx_t_13 = NULL;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_unpacking_failed:;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
          if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
          __PYX_ERR(0, 81, __pyx_L7_error)
          __pyx_L11_unpacking_done:;
        }
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_7genexpr__pyx_v_a, __pyx_t_10);
        __pyx_t_10 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_7genexpr__pyx_v_b, __pyx_t_11);
        __pyx_t_11 = 0;
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(81,0,__PYX_ERR(0, 81, __pyx_L7_error))
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_7genexpr__pyx_v_a);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_7genexpr__pyx_v_b);
      goto __pyx_L12_exit_scope;
      __pyx_L7_error:;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_7genexpr__pyx_v_a);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_7genexpr__pyx_v_b);
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">082</span>:         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">cur_conds</span><span class="p">)</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-5 '>    <span class='trace'>__Pyx_TraceLine</span>(82,0,__PYX_ERR(0, 82, __pyx_L1_error))
    __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_cur_conds); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 82, __pyx_L1_error)
    __pyx_t_6 = ((__pyx_t_8 == 0) != 0);
    if (__pyx_t_6) {
/* … */
    }
</pre><pre class="cython line score-9" onclick='toggleDiv(this)'>+<span class="">083</span>:             <span class="n">cur_conds</span> <span class="o">=</span> <span class="n">properties</span><span class="p">[</span><span class="s">'GM'</span><span class="p">]</span><span class="o">.</span><span class="n">coords</span></pre>
<pre class='cython code score-9 '>      <span class='trace'>__Pyx_TraceLine</span>(83,0,__PYX_ERR(0, 83, __pyx_L1_error))
      __pyx_t_4 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_properties, __pyx_n_u_GM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_cur_conds, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-0"> <span class="">084</span>:         <span class="c"># sum of independently specified components</span></pre>
<pre class="cython line score-91" onclick='toggleDiv(this)'>+<span class="">085</span>:         <span class="n">indep_sum</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">([</span><span class="nb">float</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">val</span> <span class="ow">in</span> <span class="n">cur_conds</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">i</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">'X_'</span><span class="p">)])</span></pre>
<pre class='cython code score-91 '>    <span class='trace'>__Pyx_TraceLine</span>(85,0,__PYX_ERR(0, 85, __pyx_L1_error))
    __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
    __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 85, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
    { /* enter inner scope */
      PyObject *__pyx_8genexpr1__pyx_v_i = NULL;
      PyObject *__pyx_8genexpr1__pyx_v_val = NULL;
      __pyx_t_4 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L16_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_8 = 0;
      if (unlikely(__pyx_v_cur_conds == Py_None)) {
        <span class='py_c_api'>PyErr_Format</span>(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
        __PYX_ERR(0, 85, __pyx_L16_error)
      }
      __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_cur_conds, 0, __pyx_n_s_items, (&__pyx_t_15), (&__pyx_t_16)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L16_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
      __pyx_t_1 = __pyx_t_7;
      __pyx_t_7 = 0;
      while (1) {
        __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_15, &__pyx_t_8, &__pyx_t_7, &__pyx_t_10, NULL, __pyx_t_16);
        if (unlikely(__pyx_t_17 == 0)) break;
        if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 85, __pyx_L16_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr1__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr1__pyx_v_val, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_8genexpr1__pyx_v_i, __pyx_n_s_startswith); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 85, __pyx_L16_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_10, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L16_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 85, __pyx_L16_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_6) {
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyNumber_Float</span>(__pyx_8genexpr1__pyx_v_val); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L16_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 85, __pyx_L16_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr1__pyx_v_i);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr1__pyx_v_val);
      goto __pyx_L20_exit_scope;
      __pyx_L16_error:;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr1__pyx_v_i);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr1__pyx_v_val);
      goto __pyx_L1_error;
      __pyx_L20_exit_scope:;
    } /* exit inner scope */
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
      __pyx_t_1 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
      if (likely(__pyx_t_1)) {
        PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_1);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_14)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_14)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_18 = __pyx_<span class='py_c_api'>PyFloat_AsDouble</span>(__pyx_t_3); if (unlikely((__pyx_t_18 == (double)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 85, __pyx_L1_error)
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_indep_sum = __pyx_t_18;
/* … */
  __pyx_tuple__2 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_u_X_2); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 85, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__2);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__2);
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">086</span>:         <span class="k">if</span> <span class="n">indep_sum</span> <span class="o">></span> <span class="mf">1</span><span class="p">:</span></pre>
<pre class='cython code score-0 '>    <span class='trace'>__Pyx_TraceLine</span>(86,0,__PYX_ERR(0, 86, __pyx_L1_error))
    __pyx_t_6 = ((__pyx_v_indep_sum > 1.0) != 0);
    if (__pyx_t_6) {
/* … */
    }
</pre><pre class="cython line score-0"> <span class="">087</span>:             <span class="c"># Sum of independent component mole fractions greater than one</span></pre>
<pre class="cython line score-0"> <span class="">088</span>:             <span class="c"># Skip this condition set</span></pre>
<pre class="cython line score-0"> <span class="">089</span>:             <span class="c"># We silently allow this to make 2-D composition mapping easier</span></pre>
<pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">090</span>:             <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>      <span class='trace'>__Pyx_TraceLine</span>(90,0,__PYX_ERR(0, 90, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 90, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_3, __pyx_t_14) < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
</pre><pre class="cython line score-36" onclick='toggleDiv(this)'>+<span class="">091</span>:             <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-36 '>      <span class='trace'>__Pyx_TraceLine</span>(91,0,__PYX_ERR(0, 91, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_v_phases)) { <span class='pyx_c_api'>__Pyx_RaiseUnboundLocalError</span>("phases"); __PYX_ERR(0, 91, __pyx_L1_error) }
      __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_4, 0, __pyx_t_15, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_NP_values, __pyx_t_4, __pyx_t_3) < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-30" onclick='toggleDiv(this)'>+<span class="">092</span>:             <span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span> <span class="o">=</span> <span class="s">''</span></pre>
<pre class='cython code score-30 '>      <span class='trace'>__Pyx_TraceLine</span>(92,0,__PYX_ERR(0, 92, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_v_phases)) { <span class='pyx_c_api'>__Pyx_RaiseUnboundLocalError</span>("phases"); __PYX_ERR(0, 92, __pyx_L1_error) }
      __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 92, __pyx_L1_error)
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_7, 0, __pyx_t_15, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_7, __pyx_kp_u__3) < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-36" onclick='toggleDiv(this)'>+<span class="">093</span>:             <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-36 '>      <span class='trace'>__Pyx_TraceLine</span>(93,0,__PYX_ERR(0, 93, __pyx_L1_error))
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_v_phases)) { <span class='pyx_c_api'>__Pyx_RaiseUnboundLocalError</span>("phases"); __PYX_ERR(0, 93, __pyx_L1_error) }
      __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 93, __pyx_L1_error)
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_14, 0, __pyx_t_15, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_X_values, __pyx_t_14, __pyx_t_4) < 0)) __PYX_ERR(0, 93, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">094</span>:             <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>      <span class='trace'>__Pyx_TraceLine</span>(94,0,__PYX_ERR(0, 94, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 94, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Y_values, __pyx_t_4, __pyx_t_14) < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">095</span>:             <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>      <span class='trace'>__Pyx_TraceLine</span>(95,0,__PYX_ERR(0, 95, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 95, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 95, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_GM_values, __pyx_t_14, __pyx_t_4) < 0)) __PYX_ERR(0, 95, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">096</span>:             <span class="n">it</span><span class="o">.</span><span class="n">iternext</span><span class="p">()</span></pre>
<pre class='cython code score-19 '>      <span class='trace'>__Pyx_TraceLine</span>(96,0,__PYX_ERR(0, 96, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_iternext); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 96, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_CallNoArg</span>(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
      }
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">097</span>:             <span class="k">continue</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(97,0,__PYX_ERR(0, 97, __pyx_L1_error))
      goto __pyx_L3_continue;
</pre><pre class="cython line score-74" onclick='toggleDiv(this)'>+<span class="">098</span>:         <span class="n">dependent_comp</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">comps</span><span class="p">)</span> <span class="o">-</span> <span class="nb">set</span><span class="p">([</span><span class="n">i</span><span class="p">[</span><span class="mf">2</span><span class="p">:]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">cur_conds</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="k">if</span> <span class="n">i</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">'X_'</span><span class="p">)])</span> <span class="o">-</span> <span class="p">{</span><span class="s">'VA'</span><span class="p">}</span></pre>
<pre class='cython code score-74 '>    <span class='trace'>__Pyx_TraceLine</span>(98,0,__PYX_ERR(0, 98, __pyx_L1_error))
    __pyx_t_4 = <span class='py_c_api'>PySet_New</span>(__pyx_v_comps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
    { /* enter inner scope */
      PyObject *__pyx_8genexpr2__pyx_v_i = NULL;
      __pyx_t_14 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 98, __pyx_L24_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_15 = 0;
      if (unlikely(__pyx_v_cur_conds == Py_None)) {
        <span class='py_c_api'>PyErr_Format</span>(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
        __PYX_ERR(0, 98, __pyx_L24_error)
      }
      __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_cur_conds, 0, __pyx_n_s_keys, (&__pyx_t_8), (&__pyx_t_16)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L24_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
      __pyx_t_3 = __pyx_t_7;
      __pyx_t_7 = 0;
      while (1) {
        __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_8, &__pyx_t_15, &__pyx_t_7, NULL, NULL, __pyx_t_16);
        if (unlikely(__pyx_t_17 == 0)) break;
        if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 98, __pyx_L24_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr2__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_8genexpr2__pyx_v_i, __pyx_n_s_startswith); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L24_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L24_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 98, __pyx_L24_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_6) {
/* … */
  __pyx_tuple__4 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_u_X_2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 98, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__4);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__4);
          __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_8genexpr2__pyx_v_i, 2, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L24_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
          if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_14, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 98, __pyx_L24_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr2__pyx_v_i);
      goto __pyx_L28_exit_scope;
      __pyx_L24_error:;
      <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr2__pyx_v_i);
      goto __pyx_L1_error;
      __pyx_L28_exit_scope:;
    } /* exit inner scope */
    __pyx_t_3 = <span class='py_c_api'>PySet_New</span>(__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 98, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = <span class='py_c_api'>PySet_New</span>(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    if (<span class='py_c_api'>PySet_Add</span>(__pyx_t_3, __pyx_n_u_VA) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
    __pyx_t_4 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_dependent_comp, __pyx_t_4);
    __pyx_t_4 = 0;
  __pyx_slice__5 = <span class='py_c_api'>PySlice_New</span>(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 98, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__5);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__5);
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">099</span>:         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">dependent_comp</span><span class="p">)</span> <span class="o">==</span> <span class="mf">1</span><span class="p">:</span></pre>
<pre class='cython code score-5 '>    <span class='trace'>__Pyx_TraceLine</span>(99,0,__PYX_ERR(0, 99, __pyx_L1_error))
    __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_dependent_comp); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 99, __pyx_L1_error)
    __pyx_t_6 = ((__pyx_t_8 == 1) != 0);
    if (__pyx_t_6) {
/* … */
      goto __pyx_L29;
    }
</pre><pre class="cython line score-9" onclick='toggleDiv(this)'>+<span class="">100</span>:             <span class="n">dependent_comp</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">dependent_comp</span><span class="p">)[</span><span class="mf">0</span><span class="p">]</span></pre>
<pre class='cython code score-9 '>      <span class='trace'>__Pyx_TraceLine</span>(100,0,__PYX_ERR(0, 100, __pyx_L1_error))
      __pyx_t_4 = <span class='py_c_api'>PySequence_List</span>(__pyx_v_dependent_comp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetItemInt_List</span>(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_dependent_comp, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-0"> <span class="">101</span>:         <span class="k">else</span><span class="p">:</span></pre>
<pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">102</span>:             <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">'Number of dependent components different from one'</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>    <span class='trace'>__Pyx_TraceLine</span>(102,0,__PYX_ERR(0, 102, __pyx_L1_error))
    /*else*/ {
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_3, 0, 0, 0);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 102, __pyx_L1_error)
    }
    __pyx_L29:;
/* … */
  __pyx_tuple__6 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Number_of_dependent_components_d); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 102, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__6);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__6);
</pre><pre class="cython line score-0"> <span class="">103</span>:         <span class="c"># chem_pots = OrderedDict(zip(properties.coords['component'].values, properties['MU'].values[it.multi_index]))</span></pre>
<pre class="cython line score-0"> <span class="">104</span>:         <span class="c"># Used to cache generated mole fraction functions</span></pre>
<pre class="cython line score-6" onclick='toggleDiv(this)'>+<span class="">105</span>:         <span class="n">mole_fractions</span> <span class="o">=</span> <span class="p">{}</span></pre>
<pre class='cython code score-6 '>    <span class='trace'>__Pyx_TraceLine</span>(105,0,__PYX_ERR(0, 105, __pyx_L1_error))
    __pyx_t_3 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_mole_fractions, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">106</span>:         <span class="k">for</span> <span class="n">cur_iter</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">MAX_SOLVE_ITERATIONS</span><span class="p">):</span></pre>
<pre class='cython code score-10 '>    <span class='trace'>__Pyx_TraceLine</span>(106,0,__PYX_ERR(0, 106, __pyx_L1_error))
    __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_SOLVE_ITERATIONS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    __pyx_t_19 = <span class='pyx_c_api'>__Pyx_PyInt_As_long</span>(__pyx_t_3); if (unlikely((__pyx_t_19 == (long)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 106, __pyx_L1_error)
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_19; __pyx_t_16+=1) {
      __pyx_v_cur_iter = __pyx_t_16;
</pre><pre class="cython line score-0"> <span class="">107</span>:             <span class="c"># print('CUR_ITER:', cur_iter)</span></pre>
<pre class="cython line score-15" onclick='toggleDiv(this)'>+<span class="">108</span>:             <span class="n">phases</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">])</span></pre>
<pre class='cython code score-15 '>      <span class='trace'>__Pyx_TraceLine</span>(108,0,__PYX_ERR(0, 108, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_4 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PySequence_List</span>(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_phases, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">109</span>:             <span class="k">if</span> <span class="s">''</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(109,0,__PYX_ERR(0, 109, __pyx_L1_error))
      __pyx_t_6 = (<span class='pyx_c_api'>__Pyx_PySequence_ContainsTF</span>(__pyx_kp_u__3, __pyx_v_phases, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (__pyx_t_5) {
/* … */
        goto __pyx_L32;
      }
</pre><pre class="cython line score-18" onclick='toggleDiv(this)'>+<span class="">110</span>:                 <span class="n">old_phase_length</span> <span class="o">=</span> <span class="n">phases</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s">''</span><span class="p">)</span></pre>
<pre class='cython code score-18 '>        <span class='trace'>__Pyx_TraceLine</span>(110,0,__PYX_ERR(0, 110, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_phases, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_PyInt_As_int</span>(__pyx_t_4); if (unlikely((__pyx_t_17 == (int)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 110, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_old_phase_length = __pyx_t_17;
/* … */
  __pyx_tuple__7 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 110, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__7);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__7);
</pre><pre class="cython line score-0"> <span class="">111</span>:             <span class="k">else</span><span class="p">:</span></pre>
<pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">112</span>:                 <span class="n">old_phase_length</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(112,0,__PYX_ERR(0, 112, __pyx_L1_error))
      /*else*/ {
        __pyx_v_old_phase_length = -1;
      }
      __pyx_L32:;
</pre><pre class="cython line score-18" onclick='toggleDiv(this)'>+<span class="">113</span>:             <span class="n">remove_degenerate_phases</span><span class="p">(</span><span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">],</span> <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">],</span></pre>
<pre class='cython code score-18 '>      <span class='trace'>__Pyx_TraceLine</span>(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_remove_degenerate_phases); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 113, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_1 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 113, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_7 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_X_values, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
</pre><pre class="cython line score-62" onclick='toggleDiv(this)'>+<span class="">114</span>:                                      <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">],</span> <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">])</span></pre>
<pre class='cython code score-62 '>      <span class='trace'>__Pyx_TraceLine</span>(114,0,__PYX_ERR(0, 114, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 114, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_10 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Y_values, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 114, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 114, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_NP_values, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
        __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
        if (likely(__pyx_t_14)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[5] = {__pyx_t_14, __pyx_t_1, __pyx_t_7, __pyx_t_10, __pyx_t_2};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 4+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[5] = {__pyx_t_14, __pyx_t_1, __pyx_t_7, __pyx_t_10, __pyx_t_2};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 4+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(4+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 113, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (__pyx_t_14) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_14); __pyx_t_14 = NULL;
        }
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0+__pyx_t_17, __pyx_t_1);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1+__pyx_t_17, __pyx_t_7);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 2+__pyx_t_17, __pyx_t_10);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 3+__pyx_t_17, __pyx_t_2);
        __pyx_t_1 = 0;
        __pyx_t_7 = 0;
        __pyx_t_10 = 0;
        __pyx_t_2 = 0;
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-15" onclick='toggleDiv(this)'>+<span class="">115</span>:             <span class="n">phases</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">])</span></pre>
<pre class='cython code score-15 '>      <span class='trace'>__Pyx_TraceLine</span>(115,0,__PYX_ERR(0, 115, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='py_c_api'>PySequence_List</span>(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_phases, __pyx_t_4);
      __pyx_t_4 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">116</span>:             <span class="k">if</span> <span class="s">''</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(116,0,__PYX_ERR(0, 116, __pyx_L1_error))
      __pyx_t_5 = (<span class='pyx_c_api'>__Pyx_PySequence_ContainsTF</span>(__pyx_kp_u__3, __pyx_v_phases, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {
/* … */
        goto __pyx_L33;
      }
</pre><pre class="cython line score-18" onclick='toggleDiv(this)'>+<span class="">117</span>:                 <span class="n">new_phase_length</span> <span class="o">=</span> <span class="n">phases</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s">''</span><span class="p">)</span></pre>
<pre class='cython code score-18 '>        <span class='trace'>__Pyx_TraceLine</span>(117,0,__PYX_ERR(0, 117, __pyx_L1_error))
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_phases, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_PyInt_As_int</span>(__pyx_t_3); if (unlikely((__pyx_t_17 == (int)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 117, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_new_phase_length = __pyx_t_17;
/* … */
  __pyx_tuple__8 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 117, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__8);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__8);
</pre><pre class="cython line score-0"> <span class="">118</span>:             <span class="k">else</span><span class="p">:</span></pre>
<pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">119</span>:                 <span class="n">new_phase_length</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(119,0,__PYX_ERR(0, 119, __pyx_L1_error))
      /*else*/ {
        __pyx_v_new_phase_length = -1;
      }
      __pyx_L33:;
</pre><pre class="cython line score-0"> <span class="">120</span>:             <span class="c"># Are there removed phases?</span></pre>
<pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">121</span>:             <span class="k">if</span> <span class="s">''</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(121,0,__PYX_ERR(0, 121, __pyx_L1_error))
      __pyx_t_6 = (<span class='pyx_c_api'>__Pyx_PySequence_ContainsTF</span>(__pyx_kp_u__3, __pyx_v_phases, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (__pyx_t_5) {
/* … */
        goto __pyx_L34;
      }
</pre><pre class="cython line score-18" onclick='toggleDiv(this)'>+<span class="">122</span>:                 <span class="n">num_phases</span> <span class="o">=</span> <span class="n">phases</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s">''</span><span class="p">)</span></pre>
<pre class='cython code score-18 '>        <span class='trace'>__Pyx_TraceLine</span>(122,0,__PYX_ERR(0, 122, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_phases, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_PyInt_As_int</span>(__pyx_t_4); if (unlikely((__pyx_t_17 == (int)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 122, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_num_phases = __pyx_t_17;
/* … */
  __pyx_tuple__9 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 122, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__9);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__9);
</pre><pre class="cython line score-0"> <span class="">123</span>:             <span class="k">else</span><span class="p">:</span></pre>
<pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">124</span>:                 <span class="n">num_phases</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)</span></pre>
<pre class='cython code score-5 '>      <span class='trace'>__Pyx_TraceLine</span>(124,0,__PYX_ERR(0, 124, __pyx_L1_error))
      /*else*/ {
        __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 124, __pyx_L1_error)
        __pyx_v_num_phases = __pyx_t_8;
      }
      __pyx_L34:;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">125</span>:             <span class="k">if</span> <span class="n">num_phases</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
      __pyx_t_5 = ((__pyx_v_num_phases == 0) != 0);
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">126</span>:                 <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">'Zero phases are left in the system'</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>        <span class='trace'>__Pyx_TraceLine</span>(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_4, 0, 0, 0);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 126, __pyx_L1_error)
/* … */
  __pyx_tuple__10 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Zero_phases_are_left_in_the_syst); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 126, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__10);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__10);
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">127</span>:             <span class="n">zero_dof</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">all</span><span class="p">(</span></pre>
<pre class='cython code score-5 '>      <span class='trace'>__Pyx_TraceLine</span>(127,0,__PYX_ERR(0, 127, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 127, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-110" onclick='toggleDiv(this)'>+<span class="">128</span>:                 <span class="p">(</span><span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">==</span> <span class="mf">1.</span><span class="p">)</span> <span class="o">|</span> <span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]))</span></pre>
<pre class='cython code score-110 '>      <span class='trace'>__Pyx_TraceLine</span>(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Y_values, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFloat_EqObjC</span>(__pyx_t_2, __pyx_float_1_, 1., 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_10, __pyx_n_s_isnan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      __pyx_t_1 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Y_values, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_7))) {
        __pyx_t_10 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_1};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_1};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_14 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 128, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0, __pyx_t_10); __pyx_t_10 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = <span class='py_c_api'>PyNumber_Or</span>(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
          __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
          __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_zero_dof, __pyx_t_4);
      __pyx_t_4 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">129</span>:             <span class="k">if</span> <span class="p">(</span><span class="n">num_phases</span> <span class="o">==</span> <span class="mf">1</span><span class="p">)</span> <span class="ow">and</span> <span class="n">zero_dof</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
      __pyx_t_6 = ((__pyx_v_num_phases == 1) != 0);
      if (__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L37_bool_binop_done;
      }
      __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_zero_dof); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
      __pyx_t_5 = __pyx_t_6;
      __pyx_L37_bool_binop_done:;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-0"> <span class="">130</span>:                 <span class="c"># Single phase with zero internal degrees of freedom, can't do any refinement</span></pre>
<pre class="cython line score-0"> <span class="">131</span>:                 <span class="c"># TODO: In the future we may be able to refine other degrees of freedom like temperature</span></pre>
<pre class="cython line score-0"> <span class="">132</span>:                 <span class="c"># Chemical potentials have no meaning for this case</span></pre>
<pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">133</span>:                 <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 133, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_4, __pyx_t_11) < 0)) __PYX_ERR(0, 133, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">134</span>:                 <span class="k">break</span></pre>
<pre class='cython code score-0 '>        <span class='trace'>__Pyx_TraceLine</span>(134,0,__PYX_ERR(0, 134, __pyx_L1_error))
        goto __pyx_L31_break;
</pre><pre class="cython line score-24" onclick='toggleDiv(this)'>+<span class="">135</span>:             <span class="n">phases</span> <span class="o">=</span> <span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="n">num_phases</span><span class="p">]]</span></pre>
<pre class='cython code score-24 '>      <span class='trace'>__Pyx_TraceLine</span>(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_3, 0, __pyx_v_num_phases, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_phases, __pyx_t_4);
      __pyx_t_4 = 0;
</pre><pre class="cython line score-0"> <span class="">136</span>:             <span class="c"># num_sitefrac_bals = sum([len(dbf.phases[i].sublattices) for i in phases])</span></pre>
<pre class="cython line score-0"> <span class="">137</span>:             <span class="c"># num_mass_bals = len([i for i in cur_conds.keys() if i.startswith('X_')]) + 1</span></pre>
<pre class="cython line score-49" onclick='toggleDiv(this)'>+<span class="">138</span>:             <span class="n">phase_fracs</span> <span class="o">=</span> <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span></pre>
<pre class='cython code score-49 '>      <span class='trace'>__Pyx_TraceLine</span>(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 138, __pyx_L1_error)
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_11, 0, __pyx_t_8, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_NP_values, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 138, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_v_phase_fracs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_phase_fracs.diminfo[0].strides = __pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_phase_fracs.diminfo[0].shape = __pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_phase_fracs, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-116" onclick='toggleDiv(this)'>+<span class="">139</span>:             <span class="n">phase_dof</span> <span class="o">=</span> <span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">phase_records</span><span class="p">[</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">variables</span><span class="p">)</span> <span class="o">-</span> <span class="p">{</span><span class="n">v</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">v</span><span class="o">.</span><span class="n">P</span><span class="p">})</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">]</span></pre>
<pre class='cython code score-116 '>      <span class='trace'>__Pyx_TraceLine</span>(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
      { /* enter inner scope */
        PyObject *__pyx_8genexpr3__pyx_v_name = NULL;
        __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L41_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
          __pyx_t_11 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_11 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_9 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 139, __pyx_L41_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_11, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 139, __pyx_L41_error)
              #else
              __pyx_t_4 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L41_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              #endif
            } else {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_11, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 139, __pyx_L41_error)
              #else
              __pyx_t_4 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L41_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_9(__pyx_t_11);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                else __PYX_ERR(0, 139, __pyx_L41_error)
              }
              break;
            }
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          }
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr3__pyx_v_name, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_phase_records, __pyx_8genexpr3__pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_variables); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = <span class='py_c_api'>PySet_New</span>(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_P); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = <span class='py_c_api'>PySet_New</span>(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          if (<span class='py_c_api'>PySet_Add</span>(__pyx_t_7, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          if (<span class='py_c_api'>PySet_Add</span>(__pyx_t_7, __pyx_t_14) < 0) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_14); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_3, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 139, __pyx_L41_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr3__pyx_v_name);
        goto __pyx_L44_exit_scope;
        __pyx_L41_error:;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr3__pyx_v_name);
        goto __pyx_L1_error;
        __pyx_L44_exit_scope:;
      } /* exit inner scope */
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_phase_dof, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-0"> <span class="">140</span>:             <span class="c"># Flatten site fractions array and remove nan padding</span></pre>
<pre class="cython line score-48" onclick='toggleDiv(this)'>+<span class="">141</span>:             <span class="n">site_fracs</span> <span class="o">=</span> <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span><span class="o">.</span><span class="n">ravel</span><span class="p">()</span></pre>
<pre class='cython code score-48 '>      <span class='trace'>__Pyx_TraceLine</span>(141,0,__PYX_ERR(0, 141, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_14 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_Y_values, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 141, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_ravel); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_14)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (__pyx_t_14) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      } else {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallNoArg</span>(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
      }
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 141, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_v_site_fracs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_site_fracs.diminfo[0].strides = __pyx_pybuffernd_site_fracs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_site_fracs.diminfo[0].shape = __pyx_pybuffernd_site_fracs.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_site_fracs, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-0"> <span class="">142</span>:             <span class="c"># That *should* give us the internal dof</span></pre>
<pre class="cython line score-0"> <span class="">143</span>:             <span class="c"># This may break if non-padding nan's slipped in from elsewhere...</span></pre>
<pre class="cython line score-75" onclick='toggleDiv(this)'>+<span class="">144</span>:             <span class="n">site_fracs</span> <span class="o">=</span> <span class="n">site_fracs</span><span class="p">[</span><span class="o">~</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">)]</span></pre>
<pre class='cython code score-75 '>      <span class='trace'>__Pyx_TraceLine</span>(144,0,__PYX_ERR(0, 144, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 144, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_isnan); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 144, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
        __pyx_t_11 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
        if (likely(__pyx_t_11)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_14, ((PyObject *)__pyx_v_site_fracs)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_14)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, ((PyObject *)__pyx_v_site_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_14)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, ((PyObject *)__pyx_v_site_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_site_fracs));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_site_fracs));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_site_fracs));
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='py_c_api'>PyNumber_Invert</span>(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 144, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(((PyObject *)__pyx_v_site_fracs), __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 144, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_v_site_fracs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_site_fracs.diminfo[0].strides = __pyx_pybuffernd_site_fracs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_site_fracs.diminfo[0].shape = __pyx_pybuffernd_site_fracs.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 144, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_site_fracs, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-17" onclick='toggleDiv(this)'>+<span class="">145</span>:             <span class="n">site_fracs</span><span class="p">[</span><span class="n">site_fracs</span> <span class="o"><</span> <span class="n">MIN_SITE_FRACTION</span><span class="p">]</span> <span class="o">=</span> <span class="n">MIN_SITE_FRACTION</span></pre>
<pre class='cython code score-17 '>      <span class='trace'>__Pyx_TraceLine</span>(145,0,__PYX_ERR(0, 145, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 145, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_7 = <span class='py_c_api'>PyObject_RichCompare</span>(((PyObject *)__pyx_v_site_fracs), __pyx_t_14, Py_LT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(((PyObject *)__pyx_v_site_fracs), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">146</span>:             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">)</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-5 '>      <span class='trace'>__Pyx_TraceLine</span>(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(((PyObject *)__pyx_v_site_fracs)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 146, __pyx_L1_error)
      __pyx_t_5 = ((__pyx_t_8 == 0) != 0);
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-11" onclick='toggleDiv(this)'>+<span class="">147</span>:                 <span class="k">print</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span></pre>
<pre class='cython code score-11 '>        <span class='trace'>__Pyx_TraceLine</span>(147,0,__PYX_ERR(0, 147, __pyx_L1_error))
        __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_properties);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_properties);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_v_properties);
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">148</span>:                 <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">'Site fractions are invalid'</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>        <span class='trace'>__Pyx_TraceLine</span>(148,0,__PYX_ERR(0, 148, __pyx_L1_error))
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_7, 0, 0, 0);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 148, __pyx_L1_error)
/* … */
  __pyx_tuple__11 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Site_fractions_are_invalid); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 148, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__11);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__11);
</pre><pre class="cython line score-17" onclick='toggleDiv(this)'>+<span class="">149</span>:             <span class="n">phase_fracs</span><span class="p">[</span><span class="n">phase_fracs</span> <span class="o"><</span> <span class="n">MIN_SITE_FRACTION</span><span class="p">]</span> <span class="o">=</span> <span class="n">MIN_SITE_FRACTION</span></pre>
<pre class='cython code score-17 '>      <span class='trace'>__Pyx_TraceLine</span>(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_14 = <span class='py_c_api'>PyObject_RichCompare</span>(((PyObject *)__pyx_v_phase_fracs), __pyx_t_3, Py_LT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 149, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(((PyObject *)__pyx_v_phase_fracs), __pyx_t_14, __pyx_t_7) < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">150</span>:             <span class="n">var_idx</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(150,0,__PYX_ERR(0, 150, __pyx_L1_error))
      __pyx_v_var_idx = 0;
</pre><pre class="cython line score-46" onclick='toggleDiv(this)'>+<span class="">151</span>:             <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">:</span></pre>
<pre class='cython code score-46 '>      <span class='trace'>__Pyx_TraceLine</span>(151,0,__PYX_ERR(0, 151, __pyx_L1_error))
      if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
        __pyx_t_7 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_7 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_7))) {
            if (__pyx_t_8 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_14 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_7, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error)
            #else
            __pyx_t_14 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            #endif
          } else {
            if (__pyx_t_8 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_14 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_7, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error)
            #else
            __pyx_t_14 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            #endif
          }
        } else {
          __pyx_t_14 = __pyx_t_9(__pyx_t_7);
          if (unlikely(!__pyx_t_14)) {
            PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
              else __PYX_ERR(0, 151, __pyx_L1_error)
            }
            break;
          }
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        }
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_name, __pyx_t_14);
        __pyx_t_14 = 0;
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(151,0,__PYX_ERR(0, 151, __pyx_L1_error))
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-17" onclick='toggleDiv(this)'>+<span class="">152</span>:                 <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">sublattices</span><span class="p">)):</span></pre>
<pre class='cython code score-17 '>        <span class='trace'>__Pyx_TraceLine</span>(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 152, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_14, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_sublattices); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 152, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_14); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 152, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_15; __pyx_t_24+=1) {
          __pyx_v_idx = __pyx_t_24;
</pre><pre class="cython line score-61" onclick='toggleDiv(this)'>+<span class="">153</span>:                     <span class="n">active_in_subl</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">constituents</span><span class="p">[</span><span class="n">idx</span><span class="p">])</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">comps</span><span class="p">)</span></pre>
<pre class='cython code score-61 '>          <span class='trace'>__Pyx_TraceLine</span>(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          __pyx_t_11 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_constituents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetItemInt</span>(__pyx_t_3, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = <span class='py_c_api'>PySet_New</span>(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_intersection); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
            __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
            if (likely(__pyx_t_3)) {
              PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
              <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_v_comps); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 153, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          } else {
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_comps};
              __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 153, __pyx_L1_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
              PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_comps};
              __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 153, __pyx_L1_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            } else
            #endif
            {
              __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comps);
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comps);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0+1, __pyx_v_comps);
              __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 153, __pyx_L1_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            }
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_active_in_subl, __pyx_t_14);
          __pyx_t_14 = 0;
</pre><pre class="cython line score-66" onclick='toggleDiv(this)'>+<span class="">154</span>:                     <span class="k">for</span> <span class="n">ais</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">active_in_subl</span><span class="p">)):</span></pre>
<pre class='cython code score-66 '>          <span class='trace'>__Pyx_TraceLine</span>(154,0,__PYX_ERR(0, 154, __pyx_L1_error))
          __pyx_t_25 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_active_in_subl); if (unlikely(__pyx_t_25 == -1)) __PYX_ERR(0, 154, __pyx_L1_error)
          __pyx_t_14 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_25); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 154, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 154, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_range, __pyx_t_11, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 154, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_14)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_14)) {
            __pyx_t_11 = __pyx_t_14; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_25 = 0;
            __pyx_t_26 = NULL;
          } else {
            __pyx_t_25 = -1; __pyx_t_11 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 154, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            __pyx_t_26 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 154, __pyx_L1_error)
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          for (;;) {
            if (likely(!__pyx_t_26)) {
              if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
                if (__pyx_t_25 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_11)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_14 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_11, __pyx_t_25); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
                #else
                __pyx_t_14 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 154, __pyx_L1_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
                #endif
              } else {
                if (__pyx_t_25 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_11)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_14 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_11, __pyx_t_25); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
                #else
                __pyx_t_14 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 154, __pyx_L1_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
                #endif
              }
            } else {
              __pyx_t_14 = __pyx_t_26(__pyx_t_11);
              if (unlikely(!__pyx_t_14)) {
                PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                  else __PYX_ERR(0, 154, __pyx_L1_error)
                }
                break;
              }
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            }
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_ais, __pyx_t_14);
            __pyx_t_14 = 0;
/* … */
            <span class='trace'>__Pyx_TraceLine</span>(154,0,__PYX_ERR(0, 154, __pyx_L1_error))
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-49" onclick='toggleDiv(this)'>+<span class="">155</span>:                         <span class="n">site_fracs</span><span class="p">[</span><span class="n">var_idx</span> <span class="o">+</span> <span class="n">ais</span><span class="p">]</span> <span class="o">=</span> <span class="n">site_fracs</span><span class="p">[</span><span class="n">var_idx</span> <span class="o">+</span> <span class="n">ais</span><span class="p">]</span> <span class="o">/</span> <span class="nb">sum</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">[</span><span class="n">var_idx</span><span class="p">:</span><span class="n">var_idx</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">active_in_subl</span><span class="p">)])</span></pre>
<pre class='cython code score-49 '>            <span class='trace'>__Pyx_TraceLine</span>(155,0,__PYX_ERR(0, 155, __pyx_L1_error))
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_var_idx); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            __pyx_t_4 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_14, __pyx_v_ais); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = <span class='py_c_api'>PyObject_GetItem</span>(((PyObject *)__pyx_v_site_fracs), __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_27 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_active_in_subl); if (unlikely(__pyx_t_27 == -1)) __PYX_ERR(0, 155, __pyx_L1_error)
            __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(((PyObject *)__pyx_v_site_fracs), __pyx_v_var_idx, (__pyx_v_var_idx + __pyx_t_27), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyNumber_Divide</span>(__pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_var_idx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            __pyx_t_14 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_4, __pyx_v_ais); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(((PyObject *)__pyx_v_site_fracs), __pyx_t_14, __pyx_t_3) < 0)) __PYX_ERR(0, 155, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">156</span>:                     <span class="n">var_idx</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">active_in_subl</span><span class="p">)</span></pre>
<pre class='cython code score-5 '>          <span class='trace'>__Pyx_TraceLine</span>(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
          __pyx_t_25 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_active_in_subl); if (unlikely(__pyx_t_25 == -1)) __PYX_ERR(0, 156, __pyx_L1_error)
          __pyx_v_var_idx = (__pyx_v_var_idx + __pyx_t_25);
        }
</pre><pre class="cython line score-43" onclick='toggleDiv(this)'>+<span class="">157</span>:             <span class="n">l_constraints</span><span class="p">,</span> <span class="n">constraint_jac</span><span class="p">,</span> <span class="n">constraint_hess</span>  <span class="o">=</span> \</pre>
<pre class='cython code score-43 '>      <span class='trace'>__Pyx_TraceLine</span>(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 157, __pyx_L1_error)
      if (!(likely(((__pyx_t_11) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 157, __pyx_L1_error)
      __pyx_t_28 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_constraints.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_constraints.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_constraints.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_constraints, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_l_constraints.diminfo[0].strides = __pyx_pybuffernd_l_constraints.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l_constraints.diminfo[0].shape = __pyx_pybuffernd_l_constraints.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
      }
      __pyx_t_28 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_l_constraints, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_11);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer, (PyObject*)__pyx_v_constraint_jac, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_constraint_jac.diminfo[0].strides = __pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_constraint_jac.diminfo[0].shape = __pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_constraint_jac.diminfo[1].strides = __pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_constraint_jac.diminfo[1].shape = __pyx_pybuffernd_constraint_jac.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_constraint_jac, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_constraint_hess, __pyx_t_7);
      __pyx_t_7 = 0;
</pre><pre class="cython line score-87" onclick='toggleDiv(this)'>+<span class="">158</span>:                 <span class="n">_compute_constraints</span><span class="p">(</span><span class="n">dbf</span><span class="p">,</span> <span class="n">comps</span><span class="p">,</span> <span class="n">phases</span><span class="p">,</span> <span class="n">cur_conds</span><span class="p">,</span> <span class="n">site_fracs</span><span class="p">,</span> <span class="n">phase_fracs</span><span class="p">,</span> <span class="n">phase_records</span><span class="p">,</span> <span class="n">mole_fractions</span><span class="o">=</span><span class="n">mole_fractions</span><span class="p">)</span></pre>
<pre class='cython code score-87 '>      <span class='trace'>__Pyx_TraceLine</span>(158,0,__PYX_ERR(0, 158, __pyx_L1_error))
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_compute_constraints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 158, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_dbf);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_dbf);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_v_dbf);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comps);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comps);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1, __pyx_v_comps);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phases);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phases);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 2, __pyx_v_phases);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 3, __pyx_v_cur_conds);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_site_fracs));
      <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_site_fracs));
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 4, ((PyObject *)__pyx_v_site_fracs));
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_phase_fracs));
      <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_phase_fracs));
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 5, ((PyObject *)__pyx_v_phase_fracs));
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phase_records);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phase_records);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 6, __pyx_v_phase_records);
      __pyx_t_3 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_3, __pyx_n_s_mole_fractions, __pyx_v_mole_fractions) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 158, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_14))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_14))) {
        PyObject* sequence = __pyx_t_14;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(3);
          else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
          __PYX_ERR(0, 157, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
          __pyx_t_3 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
          __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
          __pyx_t_7 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 2);
        } else {
          __pyx_t_3 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
          __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
          __pyx_t_7 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 2);
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
        #else
        __pyx_t_3 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_7 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        #endif
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L52_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_4); if (unlikely(!__pyx_t_11)) goto __pyx_L52_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        index = 2; __pyx_t_7 = __pyx_t_13(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L52_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_4), 3) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
        __pyx_t_13 = NULL;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L53_unpacking_done;
        __pyx_L52_unpacking_failed:;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = NULL;
        if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
        __PYX_ERR(0, 157, __pyx_L1_error)
        __pyx_L53_unpacking_done:;
      }
</pre><pre class="cython line score-0"> <span class="">159</span>:             <span class="c"># Reset Lagrange multipliers if active set of phases change</span></pre>
<pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">160</span>:             <span class="k">if</span> <span class="n">cur_iter</span> <span class="o">==</span> <span class="mf">0</span> <span class="ow">or</span> <span class="p">(</span><span class="n">old_phase_length</span> <span class="o">!=</span> <span class="n">new_phase_length</span><span class="p">)</span> <span class="ow">or</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">l_multipliers</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>      <span class='trace'>__Pyx_TraceLine</span>(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
      __pyx_t_6 = ((__pyx_v_cur_iter == 0) != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L55_bool_binop_done;
      }
      __pyx_t_6 = ((__pyx_v_old_phase_length != __pyx_v_new_phase_length) != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L55_bool_binop_done;
      }
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_any); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 160, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_4))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_4, ((PyObject *)__pyx_v_l_multipliers)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_multipliers)};
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_multipliers)};
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_l_multipliers));
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_4 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_4)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L55_bool_binop_done:;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-67" onclick='toggleDiv(this)'>+<span class="">161</span>:                 <span class="n">l_multipliers</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="n">l_constraints</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">])</span></pre>
<pre class='cython code score-67 '>        <span class='trace'>__Pyx_TraceLine</span>(161,0,__PYX_ERR(0, 161, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyInt_From_Py_intptr_t</span>((__pyx_v_l_constraints->dimensions[0])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
          __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_11};
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_11};
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          } else
          #endif
          {
            __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0+1, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(((__pyx_t_14) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 161, __pyx_L1_error)
        __pyx_t_20 = ((PyArrayObject *)__pyx_t_14);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer);
          __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_17 < 0)) {
            <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
            if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_multipliers, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
              <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
            } else {
              <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
            }
          }
          __pyx_pybuffernd_l_multipliers.diminfo[0].strides = __pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l_multipliers.diminfo[0].shape = __pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 161, __pyx_L1_error)
        }
        __pyx_t_20 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_l_multipliers, ((PyArrayObject *)__pyx_t_14));
        __pyx_t_14 = 0;
</pre><pre class="cython line score-120" onclick='toggleDiv(this)'>+<span class="">162</span>:             <span class="n">qmat</span><span class="p">,</span> <span class="n">rmat</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">qr</span><span class="p">(</span><span class="n">constraint_jac</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s">'complete'</span><span class="p">)</span></pre>
<pre class='cython code score-120 '>      <span class='trace'>__Pyx_TraceLine</span>(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_linalg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_qr); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(((PyObject *)__pyx_v_constraint_jac), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_2, __pyx_n_s_mode, __pyx_n_u_complete) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_11))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
        PyObject* sequence = __pyx_t_11;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(2);
          else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
          __PYX_ERR(0, 162, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
          __pyx_t_2 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
          __pyx_t_4 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
        } else {
          __pyx_t_2 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
          __pyx_t_4 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
        #else
        __pyx_t_2 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_4 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        #endif
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 162, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L58_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_14); if (unlikely(!__pyx_t_4)) goto __pyx_L58_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_14), 2) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
        __pyx_t_13 = NULL;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L59_unpacking_done;
        __pyx_L58_unpacking_failed:;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = NULL;
        if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
        __PYX_ERR(0, 162, __pyx_L1_error)
        __pyx_L59_unpacking_done:;
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 162, __pyx_L1_error)
      if (!(likely(((__pyx_t_4) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 162, __pyx_L1_error)
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_qmat.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_qmat.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_qmat.rcbuffer->pybuffer, (PyObject*)__pyx_v_qmat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_qmat.diminfo[0].strides = __pyx_pybuffernd_qmat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_qmat.diminfo[0].shape = __pyx_pybuffernd_qmat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_qmat.diminfo[1].strides = __pyx_pybuffernd_qmat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_qmat.diminfo[1].shape = __pyx_pybuffernd_qmat.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_qmat, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_rmat.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_rmat.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_rmat.rcbuffer->pybuffer, (PyObject*)__pyx_v_rmat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_rmat.diminfo[0].strides = __pyx_pybuffernd_rmat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rmat.diminfo[0].shape = __pyx_pybuffernd_rmat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rmat.diminfo[1].strides = __pyx_pybuffernd_rmat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rmat.diminfo[1].shape = __pyx_pybuffernd_rmat.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_rmat, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">163</span>:             <span class="n">m</span> <span class="o">=</span> <span class="n">rmat</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">1</span><span class="p">]</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
      __pyx_v_m = (__pyx_v_rmat->dimensions[1]);
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">164</span>:             <span class="n">n</span> <span class="o">=</span> <span class="n">qmat</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(164,0,__PYX_ERR(0, 164, __pyx_L1_error))
      __pyx_v_n = (__pyx_v_qmat->dimensions[0]);
</pre><pre class="cython line score-0"> <span class="">165</span>:             <span class="c"># Construct orthonormal basis for the constraints</span></pre>
<pre class="cython line score-48" onclick='toggleDiv(this)'>+<span class="">166</span>:             <span class="n">ymat</span> <span class="o">=</span> <span class="n">qmat</span><span class="p">[:,</span> <span class="p">:</span><span class="n">m</span><span class="p">]</span></pre>
<pre class='cython code score-48 '>      <span class='trace'>__Pyx_TraceLine</span>(166,0,__PYX_ERR(0, 166, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_m); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 166, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_4 = <span class='py_c_api'>PySlice_New</span>(Py_None, __pyx_t_11, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 166, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_slice__12);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__12);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_slice__12);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = <span class='py_c_api'>PyObject_GetItem</span>(((PyObject *)__pyx_v_qmat), __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 166, __pyx_L1_error)
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_ymat.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_ymat.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_ymat.rcbuffer->pybuffer, (PyObject*)__pyx_v_ymat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_ymat.diminfo[0].strides = __pyx_pybuffernd_ymat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ymat.diminfo[0].shape = __pyx_pybuffernd_ymat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ymat.diminfo[1].strides = __pyx_pybuffernd_ymat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ymat.diminfo[1].shape = __pyx_pybuffernd_ymat.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_ymat, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
/* … */
  __pyx_slice__12 = <span class='py_c_api'>PySlice_New</span>(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 166, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__12);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__12);
</pre><pre class="cython line score-48" onclick='toggleDiv(this)'>+<span class="">167</span>:             <span class="n">zmat</span> <span class="o">=</span> <span class="n">qmat</span><span class="p">[:,</span> <span class="n">m</span><span class="p">:]</span></pre>
<pre class='cython code score-48 '>      <span class='trace'>__Pyx_TraceLine</span>(167,0,__PYX_ERR(0, 167, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_11 = <span class='py_c_api'>PySlice_New</span>(__pyx_t_4, Py_None, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_slice__13);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__13);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_slice__13);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 1, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyObject_GetItem</span>(((PyObject *)__pyx_v_qmat), __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_11) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 167, __pyx_L1_error)
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_11);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_zmat.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_zmat.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_zmat.rcbuffer->pybuffer, (PyObject*)__pyx_v_zmat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_zmat.diminfo[0].strides = __pyx_pybuffernd_zmat.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_zmat.diminfo[0].shape = __pyx_pybuffernd_zmat.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_zmat.diminfo[1].strides = __pyx_pybuffernd_zmat.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_zmat.diminfo[1].shape = __pyx_pybuffernd_zmat.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_zmat, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;
/* … */
  __pyx_slice__13 = <span class='py_c_api'>PySlice_New</span>(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 167, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__13);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__13);
</pre><pre class="cython line score-0"> <span class="">168</span>:             <span class="c"># Equation 18.14a in Nocedal and Wright</span></pre>
<pre class="cython line score-115" onclick='toggleDiv(this)'>+<span class="">169</span>:             <span class="n">p_y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">solve</span><span class="p">(</span><span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">constraint_jac</span><span class="p">,</span> <span class="n">ymat</span><span class="p">),</span> <span class="n">l_constraints</span><span class="p">)</span></pre>
<pre class='cython code score-115 '>      <span class='trace'>__Pyx_TraceLine</span>(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_linalg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_solve); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_7))) {
        __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_7);
        if (likely(__pyx_t_14)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_7, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_14, ((PyObject *)__pyx_v_constraint_jac), ((PyObject *)__pyx_v_ymat)};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_14, ((PyObject *)__pyx_v_constraint_jac), ((PyObject *)__pyx_v_ymat)};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (__pyx_t_14) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_14); __pyx_t_14 = NULL;
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+__pyx_t_17, ((PyObject *)__pyx_v_constraint_jac));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_ymat));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_ymat));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 1+__pyx_t_17, ((PyObject *)__pyx_v_ymat));
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = <span class='py_c_api'>PyNumber_Negative</span>(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_4))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_4, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_v_l_constraints)};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_v_l_constraints)};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (__pyx_t_2) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+__pyx_t_17, __pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_constraints));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_constraints));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 1+__pyx_t_17, ((PyObject *)__pyx_v_l_constraints));
        __pyx_t_7 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_11) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 169, __pyx_L1_error)
      __pyx_t_28 = ((PyArrayObject *)__pyx_t_11);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_p_y.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_p_y.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_p_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_p_y.diminfo[0].strides = __pyx_pybuffernd_p_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_y.diminfo[0].shape = __pyx_pybuffernd_p_y.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
      }
      __pyx_t_28 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_p_y, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">170</span>:             <span class="n">num_vars</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">)</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>      <span class='trace'>__Pyx_TraceLine</span>(170,0,__PYX_ERR(0, 170, __pyx_L1_error))
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(((PyObject *)__pyx_v_site_fracs)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 170, __pyx_L1_error)
      __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 170, __pyx_L1_error)
      __pyx_v_num_vars = (__pyx_t_8 + __pyx_t_15);
</pre><pre class="cython line score-44" onclick='toggleDiv(this)'>+<span class="">171</span>:             <span class="n">l_hessian</span><span class="p">,</span> <span class="n">gradient_term</span> <span class="o">=</span> <span class="n">_build_multiphase_system</span><span class="p">(</span><span class="n">dbf</span><span class="p">,</span> <span class="n">comps</span><span class="p">,</span> <span class="n">phases</span><span class="p">,</span> <span class="n">cur_conds</span><span class="p">,</span> <span class="n">site_fracs</span><span class="p">,</span> <span class="n">phase_fracs</span><span class="p">,</span></pre>
<pre class='cython code score-44 '>      <span class='trace'>__Pyx_TraceLine</span>(171,0,__PYX_ERR(0, 171, __pyx_L1_error))
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_build_multiphase_system); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(171,0,__PYX_ERR(0, 171, __pyx_L1_error))
      if (!(likely(((__pyx_t_4) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 171, __pyx_L1_error)
      if (!(likely(((__pyx_t_7) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 171, __pyx_L1_error)
      __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_hessian.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_hessian.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_hessian.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_hessian, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_l_hessian.diminfo[0].strides = __pyx_pybuffernd_l_hessian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l_hessian.diminfo[0].shape = __pyx_pybuffernd_l_hessian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l_hessian.diminfo[1].strides = __pyx_pybuffernd_l_hessian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l_hessian.diminfo[1].shape = __pyx_pybuffernd_l_hessian.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
      }
      __pyx_t_29 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_l_hessian, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_28 = ((PyArrayObject *)__pyx_t_7);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_gradient_term.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_gradient_term.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_gradient_term.rcbuffer->pybuffer, (PyObject*)__pyx_v_gradient_term, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_gradient_term.diminfo[0].strides = __pyx_pybuffernd_gradient_term.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gradient_term.diminfo[0].shape = __pyx_pybuffernd_gradient_term.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
      }
      __pyx_t_28 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_gradient_term, ((PyArrayObject *)__pyx_t_7));
      __pyx_t_7 = 0;
</pre><pre class="cython line score-0"> <span class="">172</span>:                                                                 <span class="n">l_constraints</span><span class="p">,</span> <span class="n">constraint_jac</span><span class="p">,</span> <span class="n">constraint_hess</span><span class="p">,</span></pre>
<pre class="cython line score-104" onclick='toggleDiv(this)'>+<span class="">173</span>:                                                                 <span class="n">l_multipliers</span><span class="p">,</span> <span class="n">callable_dict</span><span class="p">,</span> <span class="n">phase_records</span><span class="p">)</span></pre>
<pre class='cython code score-104 '>      <span class='trace'>__Pyx_TraceLine</span>(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
      __pyx_t_3 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_4))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_4, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
        PyObject *__pyx_temp[13] = {__pyx_t_3, __pyx_v_dbf, __pyx_v_comps, __pyx_v_phases, __pyx_v_cur_conds, ((PyObject *)__pyx_v_site_fracs), ((PyObject *)__pyx_v_phase_fracs), ((PyObject *)__pyx_v_l_constraints), ((PyObject *)__pyx_v_constraint_jac), __pyx_v_constraint_hess, ((PyObject *)__pyx_v_l_multipliers), __pyx_v_callable_dict, __pyx_v_phase_records};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 12+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
        PyObject *__pyx_temp[13] = {__pyx_t_3, __pyx_v_dbf, __pyx_v_comps, __pyx_v_phases, __pyx_v_cur_conds, ((PyObject *)__pyx_v_site_fracs), ((PyObject *)__pyx_v_phase_fracs), ((PyObject *)__pyx_v_l_constraints), ((PyObject *)__pyx_v_constraint_jac), __pyx_v_constraint_hess, ((PyObject *)__pyx_v_l_multipliers), __pyx_v_callable_dict, __pyx_v_phase_records};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 12+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else
      #endif
      {
        __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(12+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        if (__pyx_t_3) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_dbf);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_dbf);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0+__pyx_t_17, __pyx_v_dbf);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comps);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comps);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 1+__pyx_t_17, __pyx_v_comps);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phases);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phases);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 2+__pyx_t_17, __pyx_v_phases);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 3+__pyx_t_17, __pyx_v_cur_conds);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_site_fracs));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_site_fracs));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 4+__pyx_t_17, ((PyObject *)__pyx_v_site_fracs));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_phase_fracs));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_phase_fracs));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 5+__pyx_t_17, ((PyObject *)__pyx_v_phase_fracs));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_constraints));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_constraints));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 6+__pyx_t_17, ((PyObject *)__pyx_v_l_constraints));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 7+__pyx_t_17, ((PyObject *)__pyx_v_constraint_jac));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_constraint_hess);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_constraint_hess);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 8+__pyx_t_17, __pyx_v_constraint_hess);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 9+__pyx_t_17, ((PyObject *)__pyx_v_l_multipliers));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_callable_dict);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_callable_dict);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 10+__pyx_t_17, __pyx_v_callable_dict);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phase_records);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phase_records);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 11+__pyx_t_17, __pyx_v_phase_records);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_11))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
        PyObject* sequence = __pyx_t_11;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(2);
          else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
          __PYX_ERR(0, 171, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
          __pyx_t_4 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
          __pyx_t_7 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
        } else {
          __pyx_t_4 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
          __pyx_t_7 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
        #else
        __pyx_t_4 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        __pyx_t_7 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        #endif
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_3 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_3)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L60_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        index = 1; __pyx_t_7 = __pyx_t_13(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L60_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_3), 2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
        __pyx_t_13 = NULL;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L61_unpacking_done;
        __pyx_L60_unpacking_failed:;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_13 = NULL;
        if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
        __PYX_ERR(0, 171, __pyx_L1_error)
        __pyx_L61_unpacking_done:;
      }
</pre><pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">174</span>:             <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">l_hessian</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>      <span class='trace'>__Pyx_TraceLine</span>(174,0,__PYX_ERR(0, 174, __pyx_L1_error))
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, ((PyObject *)__pyx_v_l_hessian)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_hessian)};
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_hessian)};
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_14 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0, __pyx_t_3); __pyx_t_3 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_hessian));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_hessian));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0+1, ((PyObject *)__pyx_v_l_hessian));
          __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_4))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 174, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_14 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_14, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 174, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">175</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Invalid l_hessian'</span><span class="p">)</span></pre>
<pre class='cython code score-8 '>        <span class='trace'>__Pyx_TraceLine</span>(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 175, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
/* … */
  __pyx_tuple__14 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Invalid_l_hessian); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 175, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__14);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__14);
</pre><pre class="cython line score-67" onclick='toggleDiv(this)'>+<span class="">176</span>:                 <span class="n">l_hessian</span><span class="p">[:,:]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">eye</span><span class="p">(</span><span class="n">l_hessian</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">])</span></pre>
<pre class='cython code score-67 '>        <span class='trace'>__Pyx_TraceLine</span>(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_eye); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 176, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyInt_From_Py_intptr_t</span>((__pyx_v_l_hessian->dimensions[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
          __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
          if (likely(__pyx_t_7)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_14)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
/* … */
  __pyx_slice__15 = <span class='py_c_api'>PySlice_New</span>(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 176, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__15);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__15);
  __pyx_slice__16 = <span class='py_c_api'>PySlice_New</span>(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 176, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__16);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__16);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(((PyObject *)__pyx_v_l_hessian), __pyx_tuple__17, __pyx_t_11) < 0)) __PYX_ERR(0, 176, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_tuple__17 = <span class='py_c_api'>PyTuple_Pack</span>(2, __pyx_slice__15, __pyx_slice__16); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 176, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__17);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__17);
</pre><pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">177</span>:             <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">gradient_term</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>      <span class='trace'>__Pyx_TraceLine</span>(177,0,__PYX_ERR(0, 177, __pyx_L1_error))
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 177, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_4 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_7))) {
        __pyx_t_4 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_7, ((PyObject *)__pyx_v_gradient_term)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 177, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_gradient_term)};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_gradient_term)};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        } else
        #endif
        {
          __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_gradient_term));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_gradient_term));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_gradient_term));
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
        __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 177, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_14};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_14};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        } else
        #endif
        {
          __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+1, __pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 177, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 177, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">178</span>:                 <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">'Invalid gradient_term'</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>        <span class='trace'>__Pyx_TraceLine</span>(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_11, 0, 0, 0);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 178, __pyx_L1_error)
/* … */
  __pyx_tuple__18 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Invalid_gradient_term); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 178, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__18);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__18);
</pre><pre class="cython line score-0"> <span class="">179</span>:             <span class="c"># Equation 18.18 in Nocedal and Wright</span></pre>
<pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">180</span>:             <span class="k">if</span> <span class="n">m</span> <span class="o">!=</span> <span class="n">n</span><span class="p">:</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(180,0,__PYX_ERR(0, 180, __pyx_L1_error))
      __pyx_t_5 = ((__pyx_v_m != __pyx_v_n) != 0);
      if (__pyx_t_5) {
/* … */
        goto __pyx_L64;
      }
</pre><pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">181</span>:                 <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">zmat</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>        <span class='trace'>__Pyx_TraceLine</span>(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 181, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_isnan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_7))) {
          __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_7);
          if (likely(__pyx_t_14)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_7);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_7, ((PyObject *)__pyx_v_zmat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, ((PyObject *)__pyx_v_zmat)};
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_14, ((PyObject *)__pyx_v_zmat)};
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_t_14); __pyx_t_14 = NULL;
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_zmat));
            <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_zmat));
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_zmat));
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
          __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          } else
          #endif
          {
            __pyx_t_4 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_4, 0+1, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_5) {
/* … */
        }
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">182</span>:                     <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">'Invalid zmat'</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>          <span class='trace'>__Pyx_TraceLine</span>(182,0,__PYX_ERR(0, 182, __pyx_L1_error))
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_11, 0, 0, 0);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __PYX_ERR(0, 182, __pyx_L1_error)
/* … */
  __pyx_tuple__19 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Invalid_zmat); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 182, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__19);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__19);
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">183</span>:                 <span class="k">try</span><span class="p">:</span></pre>
<pre class='cython code score-19 '>        <span class='trace'>__Pyx_TraceLine</span>(183,0,__PYX_ERR(0, 183, __pyx_L66_error))
        {
          /*try:*/ {
/* … */
          }
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_23); __pyx_t_23 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_22); __pyx_t_22 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_21); __pyx_t_21 = 0;
          goto __pyx_L73_try_end;
          __pyx_L66_error:;
          __Pyx_PyThreadState_assign
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_31); __pyx_t_31 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
/* … */
          __Pyx_PyThreadState_assign
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_23);
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_22);
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_21);
          <span class='pyx_c_api'>__Pyx_ExceptionReset</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          goto __pyx_L1_error;
          __pyx_L67_exception_handled:;
          __Pyx_PyThreadState_assign
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_23);
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_22);
          <span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_t_21);
          <span class='pyx_c_api'>__Pyx_ExceptionReset</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __pyx_L73_try_end:;
        }
</pre><pre class="cython line score-96" onclick='toggleDiv(this)'>+<span class="">184</span>:                     <span class="n">p_z</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">solve</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">zmat</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">l_hessian</span><span class="p">),</span> <span class="n">zmat</span><span class="p">),</span></pre>
<pre class='cython code score-96 '>            <span class='trace'>__Pyx_TraceLine</span>(184,0,__PYX_ERR(0, 184, __pyx_L66_error))
            __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(((PyObject *)__pyx_v_zmat), __pyx_n_s_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 184, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            __pyx_t_10 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_1))) {
              __pyx_t_10 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_1);
              if (likely(__pyx_t_10)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_1);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_10);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_1, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_14, ((PyObject *)__pyx_v_l_hessian)};
              __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_14, ((PyObject *)__pyx_v_l_hessian)};
              __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            } else
            #endif
            {
              __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              if (__pyx_t_10) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+__pyx_t_17, __pyx_t_14);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_hessian));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_hessian));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 1+__pyx_t_17, ((PyObject *)__pyx_v_l_hessian));
              __pyx_t_14 = 0;
              __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_7))) {
              __pyx_t_1 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_7);
              if (likely(__pyx_t_1)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_7);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_1);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_7, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_7)) {
              PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_v_zmat)};
              __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_7)) {
              PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_v_zmat)};
              __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_7, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            } else
            #endif
            {
              __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              if (__pyx_t_1) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+__pyx_t_17, __pyx_t_2);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_zmat));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_zmat));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 1+__pyx_t_17, ((PyObject *)__pyx_v_zmat));
              __pyx_t_2 = 0;
              __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-229" onclick='toggleDiv(this)'>+<span class="">185</span>:                                           <span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">zmat</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">l_hessian</span><span class="p">),</span> <span class="n">ymat</span><span class="p">),</span> <span class="n">p_y</span><span class="p">)</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">zmat</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">gradient_term</span><span class="p">))</span></pre>
<pre class='cython code score-229 '>            <span class='trace'>__Pyx_TraceLine</span>(185,0,__PYX_ERR(0, 185, __pyx_L66_error))
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_1 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
            __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_10 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
            __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(((PyObject *)__pyx_v_zmat), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
            __pyx_t_31 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_30))) {
              __pyx_t_31 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_30);
              if (likely(__pyx_t_31)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_30);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_31);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_30, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_30)) {
              PyObject *__pyx_temp[3] = {__pyx_t_31, __pyx_t_10, ((PyObject *)__pyx_v_l_hessian)};
              __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_31); __pyx_t_31 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_30)) {
              PyObject *__pyx_temp[3] = {__pyx_t_31, __pyx_t_10, ((PyObject *)__pyx_v_l_hessian)};
              __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_31); __pyx_t_31 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
              if (__pyx_t_31) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_31); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_31); __pyx_t_31 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+__pyx_t_17, __pyx_t_10);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_hessian));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_hessian));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 1+__pyx_t_17, ((PyObject *)__pyx_v_l_hessian));
              __pyx_t_10 = 0;
              __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_30, __pyx_t_32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
            __pyx_t_30 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
              __pyx_t_30 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
              if (likely(__pyx_t_30)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_30);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_14)) {
              PyObject *__pyx_temp[3] = {__pyx_t_30, __pyx_t_1, ((PyObject *)__pyx_v_ymat)};
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_14)) {
              PyObject *__pyx_temp[3] = {__pyx_t_30, __pyx_t_1, ((PyObject *)__pyx_v_ymat)};
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            } else
            #endif
            {
              __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
              if (__pyx_t_30) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_30); __pyx_t_30 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+__pyx_t_17, __pyx_t_1);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_ymat));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_ymat));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 1+__pyx_t_17, ((PyObject *)__pyx_v_ymat));
              __pyx_t_1 = 0;
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_32, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
              __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
              if (likely(__pyx_t_14)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, ((PyObject *)__pyx_v_p_y)};
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, ((PyObject *)__pyx_v_p_y)};
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            {
              __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
              if (__pyx_t_14) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_14); __pyx_t_14 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+__pyx_t_17, __pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_p_y));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_p_y));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 1+__pyx_t_17, ((PyObject *)__pyx_v_p_y));
              __pyx_t_12 = 0;
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_32, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = <span class='py_c_api'>PyNumber_Negative</span>(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(((PyObject *)__pyx_v_zmat), __pyx_n_s_T); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
            __pyx_t_14 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
              __pyx_t_14 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
              if (likely(__pyx_t_14)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_14);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_32, ((PyObject *)__pyx_v_gradient_term)};
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
              PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_32, ((PyObject *)__pyx_v_gradient_term)};
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            } else
            #endif
            {
              __pyx_t_1 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
              if (__pyx_t_14) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_1, 0, __pyx_t_14); __pyx_t_14 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_1, 0+__pyx_t_17, __pyx_t_32);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_gradient_term));
              <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_gradient_term));
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_1, 1+__pyx_t_17, ((PyObject *)__pyx_v_gradient_term));
              __pyx_t_32 = 0;
              __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L66_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            __pyx_t_17 = 0;
            if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
              __pyx_t_7 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
              if (likely(__pyx_t_7)) {
                PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_7);
                <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
                <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
                __pyx_t_17 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_12};
              __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_12};
              __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            } else
            #endif
            {
              __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              if (__pyx_t_7) {
                <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
              }
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+__pyx_t_17, __pyx_t_4);
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 1+__pyx_t_17, __pyx_t_12);
              __pyx_t_4 = 0;
              __pyx_t_12 = 0;
              __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 184, __pyx_L66_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            }
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_p_z, __pyx_t_11);
            __pyx_t_11 = 0;
</pre><pre class="cython line score-15" onclick='toggleDiv(this)'>+<span class="">186</span>:                 <span class="k">except</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">LinAlgError</span><span class="p">:</span></pre>
<pre class='cython code score-15 '>          <span class='trace'>__Pyx_TraceLine</span>(186,0,__PYX_ERR(0, 186, __pyx_L68_except_error))
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L68_except_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_linalg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L68_except_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_LinAlgError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L68_except_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = <span class='pyx_c_api'>__Pyx_PyErr_ExceptionMatches</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_17) {
            <span class='pyx_c_api'>__Pyx_AddTraceback</span>("_cython_magic_179ec25e50428c13c53b0ba863f4b74e._solve_eq_at_conditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (<span class='pyx_c_api'>__Pyx_GetException</span>(&__pyx_t_11, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
</pre><pre class="cython line score-38" onclick='toggleDiv(this)'>+<span class="">187</span>:                     <span class="n">p_z</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="n">zmat</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">1</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float</span><span class="p">)</span></pre>
<pre class='cython code score-38 '>            <span class='trace'>__Pyx_TraceLine</span>(187,0,__PYX_ERR(0, 187, __pyx_L68_except_error))
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyInt_From_Py_intptr_t</span>((__pyx_v_zmat->dimensions[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_1 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
            __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
            if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_32) < 0) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 187, __pyx_L68_except_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_p_z, __pyx_t_32);
            __pyx_t_32 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L67_exception_handled;
          }
          goto __pyx_L68_except_error;
          __pyx_L68_except_error:;
</pre><pre class="cython line score-112" onclick='toggleDiv(this)'>+<span class="">188</span>:                 <span class="n">step</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">ymat</span><span class="p">,</span> <span class="n">p_y</span><span class="p">)</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">zmat</span><span class="p">,</span> <span class="n">p_z</span><span class="p">)</span></pre>
<pre class='cython code score-112 '>        <span class='trace'>__Pyx_TraceLine</span>(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
          __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
          if (likely(__pyx_t_3)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_ymat), ((PyObject *)__pyx_v_p_y)};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_ymat), ((PyObject *)__pyx_v_p_y)};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          if (__pyx_t_3) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_3); __pyx_t_3 = NULL;
          }
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_ymat));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_ymat));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+__pyx_t_17, ((PyObject *)__pyx_v_ymat));
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_p_y));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_p_y));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 1+__pyx_t_17, ((PyObject *)__pyx_v_p_y));
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 188, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        __pyx_t_32 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
          __pyx_t_32 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
          if (likely(__pyx_t_32)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_32, ((PyObject *)__pyx_v_zmat), __pyx_v_p_z};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_32, ((PyObject *)__pyx_v_zmat), __pyx_v_p_z};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        {
          __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          if (__pyx_t_32) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_32); __pyx_t_32 = NULL;
          }
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_zmat));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_zmat));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+__pyx_t_17, ((PyObject *)__pyx_v_zmat));
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_p_z);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_p_z);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 1+__pyx_t_17, __pyx_v_p_z);
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 188, __pyx_L1_error)
        __pyx_t_28 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer);
          __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_17 < 0)) {
            <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer, (PyObject*)__pyx_v_step, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
              <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
            } else {
              <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            }
          }
          __pyx_pybuffernd_step.diminfo[0].strides = __pyx_pybuffernd_step.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_step.diminfo[0].shape = __pyx_pybuffernd_step.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
        }
        __pyx_t_28 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_step, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;
</pre><pre class="cython line score-0"> <span class="">189</span>:             <span class="k">else</span><span class="p">:</span></pre>
<pre class="cython line score-63" onclick='toggleDiv(this)'>+<span class="">190</span>:                 <span class="n">step</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">ymat</span><span class="p">,</span> <span class="n">p_y</span><span class="p">)</span></pre>
<pre class='cython code score-63 '>      <span class='trace'>__Pyx_TraceLine</span>(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
      /*else*/ {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 190, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
          __pyx_t_11 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
          if (likely(__pyx_t_11)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_ymat), ((PyObject *)__pyx_v_p_y)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_ymat), ((PyObject *)__pyx_v_p_y)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 190, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          if (__pyx_t_11) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
          }
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_ymat));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_ymat));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+__pyx_t_17, ((PyObject *)__pyx_v_ymat));
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_p_y));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_p_y));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 1+__pyx_t_17, ((PyObject *)__pyx_v_p_y));
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 190, __pyx_L1_error)
        __pyx_t_28 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer);
          __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_17 < 0)) {
            <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
            if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_step.rcbuffer->pybuffer, (PyObject*)__pyx_v_step, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
              <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
            } else {
              <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
            }
          }
          __pyx_pybuffernd_step.diminfo[0].strides = __pyx_pybuffernd_step.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_step.diminfo[0].shape = __pyx_pybuffernd_step.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
        }
        __pyx_t_28 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_step, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;
      }
      __pyx_L64:;
</pre><pre class="cython line score-53" onclick='toggleDiv(this)'>+<span class="">191</span>:             <span class="n">old_energy</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">])</span></pre>
<pre class='cython code score-53 '>      <span class='trace'>__Pyx_TraceLine</span>(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_11 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_GM_values, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_11};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        {
          __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 191, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_2); __pyx_t_2 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+1, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_old_energy, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-53" onclick='toggleDiv(this)'>+<span class="">192</span>:             <span class="n">old_chem_pots</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">])</span></pre>
<pre class='cython code score-53 '>      <span class='trace'>__Pyx_TraceLine</span>(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_copy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 192, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      __pyx_t_11 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_MU_values, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_32))) {
        __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_32);
        if (likely(__pyx_t_12)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_32, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_32, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_32)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_32)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_12); __pyx_t_12 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_32, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_old_chem_pots, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-63" onclick='toggleDiv(this)'>+<span class="">193</span>:             <span class="n">candidate_site_fracs</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">empty_like</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">)</span></pre>
<pre class='cython code score-63 '>      <span class='trace'>__Pyx_TraceLine</span>(193,0,__PYX_ERR(0, 193, __pyx_L1_error))
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 193, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
        __pyx_t_32 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
        if (likely(__pyx_t_32)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_32) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, ((PyObject *)__pyx_v_site_fracs)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, ((PyObject *)__pyx_v_site_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, ((PyObject *)__pyx_v_site_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 193, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_32); __pyx_t_32 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_site_fracs));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_site_fracs));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0+1, ((PyObject *)__pyx_v_site_fracs));
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 193, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_v_candidate_site_fracs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_candidate_site_fracs.diminfo[0].strides = __pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_candidate_site_fracs.diminfo[0].shape = __pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 193, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_site_fracs, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-63" onclick='toggleDiv(this)'>+<span class="">194</span>:             <span class="n">candidate_phase_fracs</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">empty_like</span><span class="p">(</span><span class="n">phase_fracs</span><span class="p">)</span></pre>
<pre class='cython code score-63 '>      <span class='trace'>__Pyx_TraceLine</span>(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, ((PyObject *)__pyx_v_phase_fracs)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_phase_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_phase_fracs)};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 194, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_2); __pyx_t_2 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_phase_fracs));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_phase_fracs));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+1, ((PyObject *)__pyx_v_phase_fracs));
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 194, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer, (PyObject*)__pyx_v_candidate_phase_fracs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          }
        }
        __pyx_pybuffernd_candidate_phase_fracs.diminfo[0].strides = __pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_candidate_phase_fracs.diminfo[0].shape = __pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_phase_fracs, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">195</span>:             <span class="k">for</span> <span class="n">sfidx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">candidate_site_fracs</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">]):</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
      __pyx_t_33 = (__pyx_v_candidate_site_fracs->dimensions[0]);
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_33; __pyx_t_17+=1) {
        __pyx_v_sfidx = __pyx_t_17;
</pre><pre class="cython line score-57" onclick='toggleDiv(this)'>+<span class="">196</span>:                 <span class="n">candidate_site_fracs</span><span class="p">[</span><span class="n">sfidx</span><span class="p">]</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">site_fracs</span><span class="p">[</span><span class="n">sfidx</span><span class="p">]</span> <span class="o">+</span> <span class="n">step</span><span class="p">[</span><span class="n">sfidx</span><span class="p">],</span> <span class="n">MIN_SITE_FRACTION</span><span class="p">),</span> <span class="mf">1</span><span class="p">)</span></pre>
<pre class='cython code score-57 '>        <span class='trace'>__Pyx_TraceLine</span>(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
        __pyx_t_34 = 1;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SITE_FRACTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_35 = __pyx_v_sfidx;
        __pyx_t_36 = -1;
        if (__pyx_t_35 < 0) {
          __pyx_t_35 += __pyx_pybuffernd_site_fracs.diminfo[0].shape;
          if (unlikely(__pyx_t_35 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_site_fracs.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 196, __pyx_L1_error)
        }
        __pyx_t_37 = __pyx_v_sfidx;
        __pyx_t_36 = -1;
        if (__pyx_t_37 < 0) {
          __pyx_t_37 += __pyx_pybuffernd_step.diminfo[0].shape;
          if (unlikely(__pyx_t_37 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_step.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 196, __pyx_L1_error)
        }
        __pyx_t_38 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_site_fracs.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_site_fracs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_step.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_step.diminfo[0].strides)));
        __pyx_t_32 = <span class='py_c_api'>PyFloat_FromDouble</span>(__pyx_t_38); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        __pyx_t_2 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_3, __pyx_t_32, Py_GT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_5) {
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          __pyx_t_11 = __pyx_t_3;
        } else {
          __pyx_t_2 = <span class='py_c_api'>PyFloat_FromDouble</span>(__pyx_t_38); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          __pyx_t_11 = __pyx_t_2;
          __pyx_t_2 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
        __pyx_t_3 = __pyx_t_11;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_long</span>(__pyx_t_34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_32 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_2, __pyx_t_3, Py_LT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_32); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_32); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        if (__pyx_t_5) {
          __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyInt_From_long</span>(__pyx_t_34); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 196, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          __pyx_t_11 = __pyx_t_32;
          __pyx_t_32 = 0;
        } else {
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          __pyx_t_11 = __pyx_t_3;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_38 = __pyx_<span class='py_c_api'>PyFloat_AsDouble</span>(__pyx_t_11); if (unlikely((__pyx_t_38 == ((npy_float64)-1)) && <span class='py_c_api'>PyErr_Occurred</span>())) __PYX_ERR(0, 196, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_39 = __pyx_v_sfidx;
        __pyx_t_36 = -1;
        if (__pyx_t_39 < 0) {
          __pyx_t_39 += __pyx_pybuffernd_candidate_site_fracs.diminfo[0].shape;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_candidate_site_fracs.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 196, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_candidate_site_fracs.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_candidate_site_fracs.diminfo[0].strides) = __pyx_t_38;
      }
</pre><pre class="cython line score-0"> <span class="">197</span>: </pre>
<pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">198</span>:             <span class="k">for</span> <span class="n">pfidx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">candidate_phase_fracs</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">]):</span></pre>
<pre class='cython code score-0 '>      <span class='trace'>__Pyx_TraceLine</span>(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
      __pyx_t_33 = (__pyx_v_candidate_phase_fracs->dimensions[0]);
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_33; __pyx_t_17+=1) {
        __pyx_v_pfidx = __pyx_t_17;
</pre><pre class="cython line score-6" onclick='toggleDiv(this)'>+<span class="">199</span>:                 <span class="n">candidate_phase_fracs</span><span class="p">[</span><span class="n">pfidx</span><span class="p">]</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">phase_fracs</span><span class="p">[</span><span class="n">pfidx</span><span class="p">]</span> <span class="o">+</span> <span class="n">step</span><span class="p">[</span><span class="n">candidate_site_fracs</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">pfidx</span><span class="p">],</span> <span class="mf">0</span><span class="p">),</span> <span class="mf">1</span><span class="p">)</span></pre>
<pre class='cython code score-6 '>        <span class='trace'>__Pyx_TraceLine</span>(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
        __pyx_t_34 = 1;
        __pyx_t_40 = 0;
        __pyx_t_41 = __pyx_v_pfidx;
        __pyx_t_36 = -1;
        if (__pyx_t_41 < 0) {
          __pyx_t_41 += __pyx_pybuffernd_phase_fracs.diminfo[0].shape;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_phase_fracs.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 199, __pyx_L1_error)
        }
        __pyx_t_42 = ((__pyx_v_candidate_site_fracs->dimensions[0]) + __pyx_v_pfidx);
        __pyx_t_36 = -1;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_pybuffernd_step.diminfo[0].shape;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_step.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 199, __pyx_L1_error)
        }
        __pyx_t_38 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_phase_fracs.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_phase_fracs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_step.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_step.diminfo[0].strides)));
        if (((__pyx_t_40 > __pyx_t_38) != 0)) {
          __pyx_t_43 = __pyx_t_40;
        } else {
          __pyx_t_43 = __pyx_t_38;
        }
        __pyx_t_38 = __pyx_t_43;
        if (((__pyx_t_34 < __pyx_t_38) != 0)) {
          __pyx_t_43 = __pyx_t_34;
        } else {
          __pyx_t_43 = __pyx_t_38;
        }
        __pyx_t_44 = __pyx_v_pfidx;
        __pyx_t_36 = -1;
        if (__pyx_t_44 < 0) {
          __pyx_t_44 += __pyx_pybuffernd_candidate_phase_fracs.diminfo[0].shape;
          if (unlikely(__pyx_t_44 < 0)) __pyx_t_36 = 0;
        } else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_candidate_phase_fracs.diminfo[0].shape)) __pyx_t_36 = 0;
        if (unlikely(__pyx_t_36 != -1)) {
          <span class='pyx_c_api'>__Pyx_RaiseBufferIndexError</span>(__pyx_t_36);
          __PYX_ERR(0, 199, __pyx_L1_error)
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_candidate_phase_fracs.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_candidate_phase_fracs.diminfo[0].strides) = __pyx_t_43;
      }
</pre><pre class="cython line score-3" onclick='toggleDiv(this)'>+<span class="">200</span>:             <span class="n">candidate_l_constraints</span><span class="p">,</span> <span class="n">candidate_constraint_jac</span><span class="p">,</span> <span class="n">candidate_constraint_hess</span> <span class="o">=</span> \</pre>
<pre class='cython code score-3 '>      <span class='trace'>__Pyx_TraceLine</span>(200,0,__PYX_ERR(0, 200, __pyx_L1_error))
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_l_constraints, __pyx_t_32);
      __pyx_t_32 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_constraint_jac, __pyx_t_3);
      __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_constraint_hess, __pyx_t_11);
      __pyx_t_11 = 0;
</pre><pre class="cython line score-77" onclick='toggleDiv(this)'>+<span class="">201</span>:                 <span class="n">_compute_constraints</span><span class="p">(</span><span class="n">dbf</span><span class="p">,</span> <span class="n">comps</span><span class="p">,</span> <span class="n">phases</span><span class="p">,</span> <span class="n">cur_conds</span><span class="p">,</span></pre>
<pre class='cython code score-77 '>      <span class='trace'>__Pyx_TraceLine</span>(201,0,__PYX_ERR(0, 201, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_compute_constraints); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 201, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(202,0,__PYX_ERR(0, 202, __pyx_L1_error))
      __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_dbf);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_dbf);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_v_dbf);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comps);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comps);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 1, __pyx_v_comps);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phases);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phases);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 2, __pyx_v_phases);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 3, __pyx_v_cur_conds);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_candidate_site_fracs));
      <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_candidate_site_fracs));
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 4, ((PyObject *)__pyx_v_candidate_site_fracs));
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_candidate_phase_fracs));
      <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_candidate_phase_fracs));
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 5, ((PyObject *)__pyx_v_candidate_phase_fracs));
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phase_records);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phase_records);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 6, __pyx_v_phase_records);
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(201,0,__PYX_ERR(0, 201, __pyx_L1_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_3, __pyx_t_32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_2))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(3);
          else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
          __PYX_ERR(0, 200, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
          __pyx_t_32 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
          __pyx_t_3 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
          __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 2);
        } else {
          __pyx_t_32 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
          __pyx_t_3 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
          __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 2);
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
        #else
        __pyx_t_32 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 200, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        __pyx_t_3 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        #endif
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_32 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_32)) goto __pyx_L80_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L80_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L80_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
        __pyx_t_13 = NULL;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L81_unpacking_done;
        __pyx_L80_unpacking_failed:;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
        if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
        __PYX_ERR(0, 200, __pyx_L1_error)
        __pyx_L81_unpacking_done:;
      }
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">202</span>:                                      <span class="n">candidate_site_fracs</span><span class="p">,</span> <span class="n">candidate_phase_fracs</span><span class="p">,</span> <span class="n">phase_records</span><span class="p">,</span> <span class="n">mole_fractions</span><span class="o">=</span><span class="n">mole_fractions</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>      __pyx_t_32 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 202, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_32, __pyx_n_s_mole_fractions, __pyx_v_mole_fractions) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">203</span>:             <span class="n">candidate_energy</span><span class="p">,</span> <span class="n">candidate_gradient_term</span> <span class="o">=</span> \</pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_energy, __pyx_t_11);
      __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_candidate_gradient_term, __pyx_t_32);
      __pyx_t_32 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">204</span>:                 <span class="n">_build_multiphase_gradient</span><span class="p">(</span><span class="n">dbf</span><span class="p">,</span> <span class="n">comps</span><span class="p">,</span> <span class="n">phases</span><span class="p">,</span> <span class="n">cur_conds</span><span class="p">,</span> <span class="n">candidate_site_fracs</span><span class="p">,</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_build_multiphase_gradient); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
</pre><pre class="cython line score-0"> <span class="">205</span>:                                            <span class="n">candidate_phase_fracs</span><span class="p">,</span> <span class="n">candidate_l_constraints</span><span class="p">,</span></pre>
<pre class="cython line score-0"> <span class="">206</span>:                                            <span class="n">candidate_constraint_jac</span><span class="p">,</span> <span class="n">l_multipliers</span><span class="p">,</span></pre>
<pre class="cython line score-102" onclick='toggleDiv(this)'>+<span class="">207</span>:                                            <span class="n">callable_dict</span><span class="p">,</span> <span class="n">phase_records</span><span class="p">)</span></pre>
<pre class='cython code score-102 '>      <span class='trace'>__Pyx_TraceLine</span>(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
      __pyx_t_3 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
        PyObject *__pyx_temp[12] = {__pyx_t_3, __pyx_v_dbf, __pyx_v_comps, __pyx_v_phases, __pyx_v_cur_conds, ((PyObject *)__pyx_v_candidate_site_fracs), ((PyObject *)__pyx_v_candidate_phase_fracs), __pyx_v_candidate_l_constraints, __pyx_v_candidate_constraint_jac, ((PyObject *)__pyx_v_l_multipliers), __pyx_v_callable_dict, __pyx_v_phase_records};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-__pyx_t_17, 11+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
        PyObject *__pyx_temp[12] = {__pyx_t_3, __pyx_v_dbf, __pyx_v_comps, __pyx_v_phases, __pyx_v_cur_conds, ((PyObject *)__pyx_v_candidate_site_fracs), ((PyObject *)__pyx_v_candidate_phase_fracs), __pyx_v_candidate_l_constraints, __pyx_v_candidate_constraint_jac, ((PyObject *)__pyx_v_l_multipliers), __pyx_v_callable_dict, __pyx_v_phase_records};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-__pyx_t_17, 11+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(11+__pyx_t_17); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 204, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        if (__pyx_t_3) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_dbf);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_dbf);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+__pyx_t_17, __pyx_v_dbf);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comps);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comps);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 1+__pyx_t_17, __pyx_v_comps);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phases);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phases);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 2+__pyx_t_17, __pyx_v_phases);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 3+__pyx_t_17, __pyx_v_cur_conds);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_candidate_site_fracs));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_candidate_site_fracs));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 4+__pyx_t_17, ((PyObject *)__pyx_v_candidate_site_fracs));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_candidate_phase_fracs));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_candidate_phase_fracs));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 5+__pyx_t_17, ((PyObject *)__pyx_v_candidate_phase_fracs));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_candidate_l_constraints);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_candidate_l_constraints);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 6+__pyx_t_17, __pyx_v_candidate_l_constraints);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_candidate_constraint_jac);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_candidate_constraint_jac);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 7+__pyx_t_17, __pyx_v_candidate_constraint_jac);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 8+__pyx_t_17, ((PyObject *)__pyx_v_l_multipliers));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_callable_dict);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_callable_dict);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 9+__pyx_t_17, __pyx_v_callable_dict);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_phase_records);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_phase_records);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 10+__pyx_t_17, __pyx_v_phase_records);
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if ((likely(<span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_t_2))) || (<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = <span class='py_c_api'>PySequence_Size</span>(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) <span class='pyx_c_api'>__Pyx_RaiseTooManyValuesError</span>(2);
          else if (size >= 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(size);
          __PYX_ERR(0, 203, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(<span class='py_c_api'>PyTuple_CheckExact</span>(sequence))) {
          __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 0);
          __pyx_t_32 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(sequence, 1);
        } else {
          __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 0);
          __pyx_t_32 = <span class='py_macro_api'>PyList_GET_ITEM</span>(sequence, 1);
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
        #else
        __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_32 = <span class='py_macro_api'>PySequence_ITEM</span>(sequence, 1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 203, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        #endif
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_3 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_3)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_3); if (unlikely(!__pyx_t_11)) goto __pyx_L82_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        index = 1; __pyx_t_32 = __pyx_t_13(__pyx_t_3); if (unlikely(!__pyx_t_32)) goto __pyx_L82_unpacking_failed;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        if (<span class='pyx_c_api'>__Pyx_IternextUnpackEndCheck</span>(__pyx_t_13(__pyx_t_3), 2) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
        __pyx_t_13 = NULL;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L83_unpacking_done;
        __pyx_L82_unpacking_failed:;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_13 = NULL;
        if (<span class='pyx_c_api'>__Pyx_IterFinish</span>() == 0) <span class='pyx_c_api'>__Pyx_RaiseNeedMoreValuesError</span>(index);
        __PYX_ERR(0, 203, __pyx_L1_error)
        __pyx_L83_unpacking_done:;
      }
</pre><pre class="cython line score-0"> <span class="">208</span>:             <span class="c"># We updated degrees of freedom this iteration</span></pre>
<pre class="cython line score-74" onclick='toggleDiv(this)'>+<span class="">209</span>:             <span class="n">new_l_multipliers</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">solve</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">constraint_jac</span><span class="p">,</span> <span class="n">ymat</span><span class="p">)</span><span class="o">.</span><span class="n">T</span><span class="p">,</span></pre>
<pre class='cython code score-74 '>      <span class='trace'>__Pyx_TraceLine</span>(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_linalg); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_solve); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_constraint_jac), ((PyObject *)__pyx_v_ymat)};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_constraint_jac), ((PyObject *)__pyx_v_ymat)};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else
      #endif
      {
        __pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        if (__pyx_t_3) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_constraint_jac));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0+__pyx_t_17, ((PyObject *)__pyx_v_constraint_jac));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_ymat));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_ymat));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 1+__pyx_t_17, ((PyObject *)__pyx_v_ymat));
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 209, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
      if (!(likely(((__pyx_t_2) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 209, __pyx_L1_error)
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_l_multipliers, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_new_l_multipliers.diminfo[0].strides = __pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_l_multipliers.diminfo[0].shape = __pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
      }
      __pyx_t_20 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_new_l_multipliers, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;
</pre><pre class="cython line score-133" onclick='toggleDiv(this)'>+<span class="">210</span>:                                                 <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">ymat</span><span class="o">.</span><span class="n">T</span><span class="p">,</span> <span class="n">gradient_term</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">l_hessian</span><span class="p">,</span> <span class="n">step</span><span class="p">)))</span></pre>
<pre class='cython code score-133 '>      <span class='trace'>__Pyx_TraceLine</span>(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(((PyObject *)__pyx_v_ymat), __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
      __pyx_t_1 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
      __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_14))) {
        __pyx_t_1 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_14);
        if (likely(__pyx_t_1)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_1);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_14, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_l_hessian), ((PyObject *)__pyx_v_step)};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_l_hessian), ((PyObject *)__pyx_v_step)};
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_14, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (__pyx_t_1) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_hessian));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_hessian));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0+__pyx_t_17, ((PyObject *)__pyx_v_l_hessian));
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_step));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_step));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1+__pyx_t_17, ((PyObject *)__pyx_v_step));
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_14, __pyx_t_30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = <span class='py_c_api'>PyNumber_Add</span>(((PyObject *)__pyx_v_gradient_term), __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 210, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
        __pyx_t_4 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_14};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_14};
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
      } else
      #endif
      {
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (__pyx_t_4) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0+__pyx_t_17, __pyx_t_7);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1+__pyx_t_17, __pyx_t_14);
        __pyx_t_7 = 0;
        __pyx_t_14 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_30, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_32))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_32);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_32, function);
          __pyx_t_17 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_32)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_12, __pyx_t_11};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_32)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_12, __pyx_t_11};
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      {
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (__pyx_t_3) {
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0+__pyx_t_17, __pyx_t_12);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1+__pyx_t_17, __pyx_t_11);
        __pyx_t_12 = 0;
        __pyx_t_11 = 0;
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_32, __pyx_t_30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
</pre><pre class="cython line score-30" onclick='toggleDiv(this)'>+<span class="">211</span>:             <span class="n">np</span><span class="o">.</span><span class="n">clip</span><span class="p">(</span><span class="n">new_l_multipliers</span><span class="p">,</span> <span class="o">-</span><span class="n">MAX_ABS_LAGRANGE_MULTIPLIER</span><span class="p">,</span> <span class="n">MAX_ABS_LAGRANGE_MULTIPLIER</span><span class="p">,</span></pre>
<pre class='cython code score-30 '>      <span class='trace'>__Pyx_TraceLine</span>(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_clip); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_ABS_LAGRANGE_MULTIPLIER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_30 = <span class='py_c_api'>PyNumber_Negative</span>(__pyx_t_2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_ABS_LAGRANGE_MULTIPLIER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
      <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, ((PyObject *)__pyx_v_new_l_multipliers));
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1, __pyx_t_30);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 2, __pyx_t_2);
      __pyx_t_30 = 0;
      __pyx_t_2 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_32, __pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 211, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">212</span>:                     <span class="n">out</span><span class="o">=</span><span class="n">new_l_multipliers</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>      <span class='trace'>__Pyx_TraceLine</span>(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
      __pyx_t_2 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_2, __pyx_n_s_out, ((PyObject *)__pyx_v_new_l_multipliers)) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
</pre><pre class="cython line score-0"> <span class="">213</span>:             <span class="c"># XXX: Should fix underlying numerical problem at edges of composition space instead of working around</span></pre>
<pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">214</span>:             <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">new_l_multipliers</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>      <span class='trace'>__Pyx_TraceLine</span>(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
      __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 214, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 214, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_isnan); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 214, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
        __pyx_t_32 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
        if (likely(__pyx_t_32)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_32) {
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_12, ((PyObject *)__pyx_v_new_l_multipliers)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, ((PyObject *)__pyx_v_new_l_multipliers)};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, ((PyObject *)__pyx_v_new_l_multipliers)};
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_32); __pyx_t_32 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_new_l_multipliers));
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_12)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 214, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_2};
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_2};
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_12); __pyx_t_12 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_3, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 214, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_30); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 214, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-13" onclick='toggleDiv(this)'>+<span class="">215</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'WARNING: Unstable Lagrange multipliers: '</span><span class="p">,</span> <span class="n">new_l_multipliers</span><span class="p">)</span></pre>
<pre class='cython code score-13 '>        <span class='trace'>__Pyx_TraceLine</span>(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 215, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_WARNING_Unstable_Lagrange_multip);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_WARNING_Unstable_Lagrange_multip);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_kp_u_WARNING_Unstable_Lagrange_multip);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1, ((PyObject *)__pyx_v_new_l_multipliers));
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_30, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 215, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-0"> <span class="">216</span>:                 <span class="c"># Equation 18.16 in Nocedal and Wright</span></pre>
<pre class="cython line score-0"> <span class="">217</span>:                 <span class="c"># This method is less accurate but more stable</span></pre>
<pre class="cython line score-44" onclick='toggleDiv(this)'>+<span class="">218</span>:                 <span class="n">new_l_multipliers</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">inv</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">candidate_constraint_jac</span><span class="p">,</span></pre>
<pre class='cython code score-44 '>        <span class='trace'>__Pyx_TraceLine</span>(218,0,__PYX_ERR(0, 218, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_30, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_linalg); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
        __pyx_t_32 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_14, __pyx_n_s_inv); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(218,0,__PYX_ERR(0, 218, __pyx_L1_error))
        if (!(likely(((__pyx_t_11) == Py_None) || likely(<span class='pyx_c_api'>__Pyx_TypeTest</span>(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error)
        __pyx_t_20 = ((PyArrayObject *)__pyx_t_11);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer);
          __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_17 < 0)) {
            <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
            if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_l_multipliers, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21);
              <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
            } else {
              <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_23, __pyx_t_22, __pyx_t_21);
            }
          }
          __pyx_pybuffernd_new_l_multipliers.diminfo[0].strides = __pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_l_multipliers.diminfo[0].shape = __pyx_pybuffernd_new_l_multipliers.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 218, __pyx_L1_error)
        }
        __pyx_t_20 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_new_l_multipliers, ((PyArrayObject *)__pyx_t_11));
        __pyx_t_11 = 0;
</pre><pre class="cython line score-79" onclick='toggleDiv(this)'>+<span class="">219</span>:                                                                        <span class="n">candidate_constraint_jac</span><span class="o">.</span><span class="n">T</span><span class="p">)),</span></pre>
<pre class='cython code score-79 '>        <span class='trace'>__Pyx_TraceLine</span>(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
        __pyx_t_7 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_candidate_constraint_jac, __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
        __pyx_t_1 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_4))) {
          __pyx_t_1 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_4);
          if (likely(__pyx_t_1)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_1);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_4, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_candidate_constraint_jac, __pyx_t_7};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_candidate_constraint_jac, __pyx_t_7};
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_10 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          if (__pyx_t_1) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          }
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_candidate_constraint_jac);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_candidate_constraint_jac);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0+__pyx_t_17, __pyx_v_candidate_constraint_jac);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 1+__pyx_t_17, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_14 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_14);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_32))) {
          __pyx_t_4 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_32);
          if (likely(__pyx_t_4)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_32);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_4);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_32, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_32, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_32)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14};
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_32)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_14};
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_32, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_14); __pyx_t_14 = 0;
          } else
          #endif
          {
            __pyx_t_10 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_4); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_14);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0+1, __pyx_t_14);
            __pyx_t_14 = 0;
            __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_32, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
</pre><pre class="cython line score-76" onclick='toggleDiv(this)'>+<span class="">220</span>:                                            <span class="n">candidate_constraint_jac</span><span class="p">),</span> <span class="n">candidate_gradient_term</span><span class="p">)</span></pre>
<pre class='cython code score-76 '>        <span class='trace'>__Pyx_TraceLine</span>(220,0,__PYX_ERR(0, 220, __pyx_L1_error))
        __pyx_t_32 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
          __pyx_t_32 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
          if (likely(__pyx_t_32)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_32, __pyx_t_2, __pyx_v_candidate_constraint_jac};
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_32, __pyx_t_2, __pyx_v_candidate_constraint_jac};
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_10 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          if (__pyx_t_32) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0, __pyx_t_32); __pyx_t_32 = NULL;
          }
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0+__pyx_t_17, __pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_candidate_constraint_jac);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_candidate_constraint_jac);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 1+__pyx_t_17, __pyx_v_candidate_constraint_jac);
          __pyx_t_2 = 0;
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
          __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
          if (likely(__pyx_t_12)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
            __pyx_t_17 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_30, __pyx_v_candidate_gradient_term};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_30, __pyx_v_candidate_gradient_term};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        } else
        #endif
        {
          __pyx_t_10 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_17); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          if (__pyx_t_12) {
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL;
          }
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0+__pyx_t_17, __pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_candidate_gradient_term);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_candidate_gradient_term);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 1+__pyx_t_17, __pyx_v_candidate_gradient_term);
          __pyx_t_30 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-30" onclick='toggleDiv(this)'>+<span class="">221</span>:                 <span class="n">np</span><span class="o">.</span><span class="n">clip</span><span class="p">(</span><span class="n">new_l_multipliers</span><span class="p">,</span> <span class="o">-</span><span class="n">MAX_ABS_LAGRANGE_MULTIPLIER</span><span class="p">,</span> <span class="n">MAX_ABS_LAGRANGE_MULTIPLIER</span><span class="p">,</span></pre>
<pre class='cython code score-30 '>        <span class='trace'>__Pyx_TraceLine</span>(221,0,__PYX_ERR(0, 221, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_ABS_LAGRANGE_MULTIPLIER); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_10 = <span class='py_c_api'>PyNumber_Negative</span>(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_ABS_LAGRANGE_MULTIPLIER); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, ((PyObject *)__pyx_v_new_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1, __pyx_t_10);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 2, __pyx_t_11);
        __pyx_t_10 = 0;
        __pyx_t_11 = 0;
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(221,0,__PYX_ERR(0, 221, __pyx_L1_error))
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_30, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
</pre><pre class="cython line score-10" onclick='toggleDiv(this)'>+<span class="">222</span>:                     <span class="n">out</span><span class="o">=</span><span class="n">new_l_multipliers</span><span class="p">)</span></pre>
<pre class='cython code score-10 '>        <span class='trace'>__Pyx_TraceLine</span>(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
        __pyx_t_11 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 222, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_11, __pyx_n_s_out, ((PyObject *)__pyx_v_new_l_multipliers)) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
</pre><pre class="cython line score-20" onclick='toggleDiv(this)'>+<span class="">223</span>:             <span class="n">l_multipliers</span> <span class="o">=</span> <span class="n">new_l_multipliers</span></pre>
<pre class='cython code score-20 '>      <span class='trace'>__Pyx_TraceLine</span>(223,0,__PYX_ERR(0, 223, __pyx_L1_error))
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        <span class='pyx_c_api'>__Pyx_SafeReleaseBuffer</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer);
        __pyx_t_17 = <span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_l_multipliers, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_17 < 0)) {
          <span class='py_c_api'>PyErr_Fetch</span>(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if (unlikely(<span class='pyx_c_api'>__Pyx_GetBufferAndValidate</span>(&__pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer, (PyObject*)__pyx_v_l_multipliers, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23);
            <span class='pyx_c_api'>__Pyx_RaiseBufferFallbackError</span>();
          } else {
            <span class='py_c_api'>PyErr_Restore</span>(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
        }
        __pyx_pybuffernd_l_multipliers.diminfo[0].strides = __pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l_multipliers.diminfo[0].shape = __pyx_pybuffernd_l_multipliers.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_17 < 0)) __PYX_ERR(0, 223, __pyx_L1_error)
      }
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_new_l_multipliers));
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_l_multipliers, __pyx_v_new_l_multipliers);
</pre><pre class="cython line score-89" onclick='toggleDiv(this)'>+<span class="">224</span>:             <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">l_multipliers</span><span class="p">)):</span></pre>
<pre class='cython code score-89 '>      <span class='trace'>__Pyx_TraceLine</span>(224,0,__PYX_ERR(0, 224, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 224, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_any); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 224, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_isnan); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 224, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_12))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_12, ((PyObject *)__pyx_v_l_multipliers)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 224, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_multipliers)};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_l_multipliers)};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
          <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_l_multipliers));
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_30))) {
        __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_30);
        if (likely(__pyx_t_12)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_30, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_30, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_30)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11};
          __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_30)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11};
          __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_12); __pyx_t_12 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_30, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 224, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-13" onclick='toggleDiv(this)'>+<span class="">225</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Invalid l_multipliers after recalculation'</span><span class="p">,</span> <span class="n">l_multipliers</span><span class="p">)</span></pre>
<pre class='cython code score-13 '>        <span class='trace'>__Pyx_TraceLine</span>(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
        __pyx_t_10 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 225, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_Invalid_l_multipliers_after_reca);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_Invalid_l_multipliers_after_reca);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 0, __pyx_kp_u_Invalid_l_multipliers_after_reca);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_10, 1, ((PyObject *)__pyx_v_l_multipliers));
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_10, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 225, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-7" onclick='toggleDiv(this)'>+<span class="">226</span>:                 <span class="n">l_multipliers</span><span class="p">[:]</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-7 '>        <span class='trace'>__Pyx_TraceLine</span>(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
        if (<span class='pyx_c_api'>__Pyx_PyObject_SetSlice</span>(((PyObject *)__pyx_v_l_multipliers), __pyx_int_0, 0, 0, NULL, NULL, &__pyx_slice__20, 0, 0, 1) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
/* … */
  __pyx_slice__20 = <span class='py_c_api'>PySlice_New</span>(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 226, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_slice__20);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_slice__20);
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">227</span>:             <span class="k">if</span> <span class="n">verbose</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(227,0,__PYX_ERR(0, 227, __pyx_L1_error))
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_verbose); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 227, __pyx_L1_error)
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-13" onclick='toggleDiv(this)'>+<span class="">228</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'NEW_L_MULTIPLIERS'</span><span class="p">,</span> <span class="n">l_multipliers</span><span class="p">)</span></pre>
<pre class='cython code score-13 '>        <span class='trace'>__Pyx_TraceLine</span>(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 228, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_u_NEW_L_MULTIPLIERS);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_u_NEW_L_MULTIPLIERS);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_n_u_NEW_L_MULTIPLIERS);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='refnanny'>__Pyx_GIVEREF</span>(((PyObject *)__pyx_v_l_multipliers));
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1, ((PyObject *)__pyx_v_l_multipliers));
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_30, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
</pre><pre class="cython line score-38" onclick='toggleDiv(this)'>+<span class="">229</span>:             <span class="n">num_mass_bals</span> <span class="o">=</span> <span class="nb">len</span><span class="p">([</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">cur_conds</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="k">if</span> <span class="n">i</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">'X_'</span><span class="p">)])</span> <span class="o">+</span> <span class="mf">1</span></pre>
<pre class='cython code score-38 '>      <span class='trace'>__Pyx_TraceLine</span>(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
      { /* enter inner scope */
        PyObject *__pyx_8genexpr4__pyx_v_i = NULL;
        __pyx_t_10 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L89_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        __pyx_t_15 = 0;
        if (unlikely(__pyx_v_cur_conds == Py_None)) {
          <span class='py_c_api'>PyErr_Format</span>(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
          __PYX_ERR(0, 229, __pyx_L89_error)
        }
        __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_cur_conds, 0, __pyx_n_s_keys, (&__pyx_t_8), (&__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L89_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30);
        __pyx_t_30 = __pyx_t_2;
        __pyx_t_2 = 0;
        while (1) {
          __pyx_t_36 = __Pyx_dict_iter_next(__pyx_t_30, __pyx_t_8, &__pyx_t_15, &__pyx_t_2, NULL, NULL, __pyx_t_17);
          if (unlikely(__pyx_t_36 == 0)) break;
          if (unlikely(__pyx_t_36 == -1)) __PYX_ERR(0, 229, __pyx_L89_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr4__pyx_v_i, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_8genexpr4__pyx_v_i, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L89_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L89_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 229, __pyx_L89_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_5) {
            if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_10, (PyObject*)__pyx_8genexpr4__pyx_v_i))) __PYX_ERR(0, 229, __pyx_L89_error)
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr4__pyx_v_i);
        goto __pyx_L93_exit_scope;
        __pyx_L89_error:;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr4__pyx_v_i);
        goto __pyx_L1_error;
        __pyx_L93_exit_scope:;
      } /* exit inner scope */
      __pyx_t_8 = <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_10); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 229, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = <span class='py_c_api'>PyInt_FromSsize_t</span>((__pyx_t_8 + 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_num_mass_bals, __pyx_t_10);
      __pyx_t_10 = 0;
/* … */
  __pyx_tuple__21 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_u_X_2); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 229, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__21);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__21);
</pre><pre class="cython line score-92" onclick='toggleDiv(this)'>+<span class="">230</span>:             <span class="n">chemical_potentials</span> <span class="o">=</span> <span class="n">l_multipliers</span><span class="p">[</span><span class="nb">sum</span><span class="p">([</span><span class="nb">len</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">sublattices</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">]):</span></pre>
<pre class='cython code score-92 '>      <span class='trace'>__Pyx_TraceLine</span>(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
      { /* enter inner scope */
        PyObject *__pyx_8genexpr5__pyx_v_i = NULL;
        __pyx_t_10 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L96_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
          __pyx_t_30 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_30); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_30 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          __pyx_t_9 = Py_TYPE(__pyx_t_30)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 230, __pyx_L96_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_30))) {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_30)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_30, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 230, __pyx_L96_error)
              #else
              __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_30, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L96_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
              #endif
            } else {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_30)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_30, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 230, __pyx_L96_error)
              #else
              __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_30, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L96_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_9(__pyx_t_30);
            if (unlikely(!__pyx_t_11)) {
              PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                else __PYX_ERR(0, 230, __pyx_L96_error)
              }
              break;
            }
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          }
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr5__pyx_v_i, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_11, __pyx_8genexpr5__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_sublattices); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_11); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_15); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_10, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 230, __pyx_L96_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr5__pyx_v_i);
        goto __pyx_L99_exit_scope;
        __pyx_L96_error:;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr5__pyx_v_i);
        goto __pyx_L1_error;
        __pyx_L99_exit_scope:;
      } /* exit inner scope */
      __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 230, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_sum, __pyx_t_30, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(((PyObject *)__pyx_v_l_multipliers), 0, 0, &__pyx_t_10, &__pyx_t_11, NULL, 0, 0, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 230, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_chemical_potentials, __pyx_t_30);
      __pyx_t_30 = 0;
</pre><pre class="cython line score-93" onclick='toggleDiv(this)'>+<span class="">231</span>:                                                 <span class="nb">sum</span><span class="p">([</span><span class="nb">len</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">sublattices</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">])</span> <span class="o">+</span> <span class="n">num_mass_bals</span><span class="p">]</span></pre>
<pre class='cython code score-93 '>      <span class='trace'>__Pyx_TraceLine</span>(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
      { /* enter inner scope */
        PyObject *__pyx_8genexpr6__pyx_v_i = NULL;
        __pyx_t_30 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 231, __pyx_L102_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
          __pyx_t_11 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_11 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_9 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L102_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_11, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 231, __pyx_L102_error)
              #else
              __pyx_t_2 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L102_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              #endif
            } else {
              if (__pyx_t_8 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_11, __pyx_t_8); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 231, __pyx_L102_error)
              #else
              __pyx_t_2 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L102_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
              #endif
            }
          } else {
            __pyx_t_2 = __pyx_t_9(__pyx_t_11);
            if (unlikely(!__pyx_t_2)) {
              PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                else __PYX_ERR(0, 231, __pyx_L102_error)
              }
              break;
            }
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          }
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr6__pyx_v_i, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          __pyx_t_12 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_2, __pyx_8genexpr6__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_sublattices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_15 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_2); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_30, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 231, __pyx_L102_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr6__pyx_v_i);
        goto __pyx_L105_exit_scope;
        __pyx_L102_error:;
        <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr6__pyx_v_i);
        goto __pyx_L1_error;
        __pyx_L105_exit_scope:;
      } /* exit inner scope */
      __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_30);
      __pyx_t_30 = 0;
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_sum, __pyx_t_11, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 231, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_30, __pyx_v_num_mass_bals); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">232</span>:             <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">chemical_potentials</span></pre>
<pre class='cython code score-8 '>      <span class='trace'>__Pyx_TraceLine</span>(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 232, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_30, __pyx_v_chemical_potentials) < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-28" onclick='toggleDiv(this)'>+<span class="">233</span>:             <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span> <span class="o">=</span> <span class="n">candidate_phase_fracs</span></pre>
<pre class='cython code score-28 '>      <span class='trace'>__Pyx_TraceLine</span>(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 233, __pyx_L1_error)
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_10, 0, __pyx_t_8, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_30, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_NP_values, __pyx_t_10, ((PyObject *)__pyx_v_candidate_phase_fracs)) < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
</pre><pre class="cython line score-28" onclick='toggleDiv(this)'>+<span class="">234</span>:             <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[:</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)]]</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-28 '>      <span class='trace'>__Pyx_TraceLine</span>(234,0,__PYX_ERR(0, 234, __pyx_L1_error))
      __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 234, __pyx_L1_error)
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(__pyx_t_30, 0, __pyx_t_8, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_X_values, __pyx_t_30, __pyx_int_0) < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">235</span>:             <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">candidate_energy</span></pre>
<pre class='cython code score-8 '>      <span class='trace'>__Pyx_TraceLine</span>(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 235, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_GM_values, __pyx_t_30, __pyx_v_candidate_energy) < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">236</span>:             <span class="n">var_offset</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_int_0);
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_var_offset, __pyx_int_0);
</pre><pre class="cython line score-5" onclick='toggleDiv(this)'>+<span class="">237</span>:             <span class="k">for</span> <span class="n">phase_idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">phases</span><span class="p">)):</span></pre>
<pre class='cython code score-5 '>      <span class='trace'>__Pyx_TraceLine</span>(237,0,__PYX_ERR(0, 237, __pyx_L1_error))
      __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_v_phases); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 237, __pyx_L1_error)
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_8; __pyx_t_15+=1) {
        __pyx_v_phase_idx = __pyx_t_15;
</pre><pre class="cython line score-48" onclick='toggleDiv(this)'>+<span class="">238</span>:                 <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">,</span> <span class="p">:</span><span class="n">phase_dof</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">]]]</span> <span class="o">=</span> \</pre>
<pre class='cython code score-48 '>        <span class='trace'>__Pyx_TraceLine</span>(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_10 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_10, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_v_phase_idx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
        __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetItemInt_List</span>(__pyx_v_phase_dof, __pyx_v_phase_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        __pyx_t_3 = <span class='py_c_api'>PySlice_New</span>(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_10);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 1, __pyx_t_3);
        __pyx_t_10 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Y_values, __pyx_t_12, __pyx_t_30) < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-11" onclick='toggleDiv(this)'>+<span class="">239</span>:                     <span class="n">candidate_site_fracs</span><span class="p">[</span><span class="n">var_offset</span><span class="p">:</span><span class="n">var_offset</span> <span class="o">+</span> <span class="n">phase_dof</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">]]</span></pre>
<pre class='cython code score-11 '>        <span class='trace'>__Pyx_TraceLine</span>(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetItemInt_List</span>(__pyx_v_phase_dof, __pyx_v_phase_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 239, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_11 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_v_var_offset, __pyx_t_30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 239, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(((PyObject *)__pyx_v_candidate_site_fracs), 0, 0, &__pyx_v_var_offset, &__pyx_t_11, NULL, 0, 0, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 239, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-72" onclick='toggleDiv(this)'>+<span class="">240</span>:                 <span class="k">for</span> <span class="n">comp_idx</span><span class="p">,</span> <span class="n">comp</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">([</span><span class="n">c</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">comps</span> <span class="k">if</span> <span class="n">c</span> <span class="o">!=</span> <span class="s">'VA'</span><span class="p">]):</span></pre>
<pre class='cython code score-72 '>        <span class='trace'>__Pyx_TraceLine</span>(240,0,__PYX_ERR(0, 240, __pyx_L1_error))
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_int_0);
        __pyx_t_30 = __pyx_int_0;
        { /* enter inner scope */
          PyObject *__pyx_8genexpr7__pyx_v_c = NULL;
          __pyx_t_12 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L112_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_comps)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_comps)) {
            __pyx_t_3 = __pyx_v_comps; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3); __pyx_t_24 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_24 = -1; __pyx_t_3 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_comps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L112_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
            __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L112_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_3))) {
                if (__pyx_t_24 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_3, __pyx_t_24); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_24++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L112_error)
                #else
                __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_3, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L112_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
                #endif
              } else {
                if (__pyx_t_24 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_3, __pyx_t_24); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_24++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L112_error)
                #else
                __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_3, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L112_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
                #endif
              }
            } else {
              __pyx_t_11 = __pyx_t_9(__pyx_t_3);
              if (unlikely(!__pyx_t_11)) {
                PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                  else __PYX_ERR(0, 240, __pyx_L112_error)
                }
                break;
              }
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            }
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr7__pyx_v_c, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_5 = (<span class='pyx_c_api'>__Pyx_PyUnicode_Equals</span>(__pyx_8genexpr7__pyx_v_c, __pyx_n_u_VA, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 240, __pyx_L112_error)
            if (__pyx_t_5) {
              if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_12, (PyObject*)__pyx_8genexpr7__pyx_v_c))) __PYX_ERR(0, 240, __pyx_L112_error)
            }
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr7__pyx_v_c);
          goto __pyx_L116_exit_scope;
          __pyx_L112_error:;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr7__pyx_v_c);
          goto __pyx_L1_error;
          __pyx_L116_exit_scope:;
        } /* exit inner scope */
        __pyx_t_3 = __pyx_t_12; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3); __pyx_t_24 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        for (;;) {
          if (__pyx_t_24 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_3, __pyx_t_24); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12); __pyx_t_24++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
          #else
          __pyx_t_12 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_3, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          #endif
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_comp, __pyx_t_12);
          __pyx_t_12 = 0;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_comp_idx, __pyx_t_30);
          __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyInt_AddObjC</span>(__pyx_t_30, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30);
          __pyx_t_30 = __pyx_t_12;
          __pyx_t_12 = 0;
/* … */
          <span class='trace'>__Pyx_TraceLine</span>(240,0,__PYX_ERR(0, 240, __pyx_L1_error))
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-41" onclick='toggleDiv(this)'>+<span class="">241</span>:                     <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">index_exp</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">,</span> <span class="n">comp_idx</span><span class="p">]]</span> <span class="o">=</span> \</pre>
<pre class='cython code score-41 '>          <span class='trace'>__Pyx_TraceLine</span>(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          __pyx_t_32 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          __pyx_t_10 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_32, __pyx_n_s_index_exp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          __pyx_t_32 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_v_phase_idx); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comp_idx);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comp_idx);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1, __pyx_v_comp_idx);
          __pyx_t_32 = 0;
          __pyx_t_32 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_2, __pyx_t_32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_X_values, __pyx_t_11, __pyx_t_12) < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
</pre><pre class="cython line score-16" onclick='toggleDiv(this)'>+<span class="">242</span>:                         <span class="n">mole_fractions</span><span class="p">[(</span><span class="n">phases</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">],</span> <span class="n">comp</span><span class="p">)][</span><span class="mf">0</span><span class="p">](</span></pre>
<pre class='cython code score-16 '>          <span class='trace'>__Pyx_TraceLine</span>(242,0,__PYX_ERR(0, 242, __pyx_L1_error))
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetItemInt</span>(__pyx_v_phases, __pyx_v_phase_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_comp);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_comp);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 1, __pyx_v_comp);
          __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyDict_GetItem</span>(__pyx_v_mole_fractions, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = <span class='pyx_c_api'>__Pyx_GetItemInt</span>(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-56" onclick='toggleDiv(this)'>+<span class="">243</span>:                             <span class="p">[</span><span class="n">candidate_site_fracs</span><span class="p">[</span><span class="n">var_offset</span><span class="p">:</span><span class="n">var_offset</span> <span class="o">+</span> <span class="n">phase_dof</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">]]])</span></pre>
<pre class='cython code score-56 '>          <span class='trace'>__Pyx_TraceLine</span>(243,0,__PYX_ERR(0, 243, __pyx_L1_error))
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetItemInt_List</span>(__pyx_v_phase_dof, __pyx_v_phase_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 243, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          __pyx_t_10 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_v_var_offset, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(((PyObject *)__pyx_v_candidate_site_fracs), 0, 0, &__pyx_v_var_offset, &__pyx_t_10, NULL, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 243, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = <span class='py_c_api'>PyList_New</span>(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_10);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
          <span class='py_macro_api'>PyList_SET_ITEM</span>(__pyx_t_10, 0, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_2))) {
            __pyx_t_11 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_2);
            if (likely(__pyx_t_11)) {
              PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_2);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
              <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
              <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          } else {
            #if CYTHON_FAST_PYCALL
            if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
              PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10};
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error)
              <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_32 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 242, __pyx_L1_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0, __pyx_t_11); __pyx_t_11 = NULL;
              <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_10);
              <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_32, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_32, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error)
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
              <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
            }
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
</pre><pre class="cython line score-9" onclick='toggleDiv(this)'>+<span class="">244</span>:                 <span class="n">var_offset</span> <span class="o">+=</span> <span class="n">phase_dof</span><span class="p">[</span><span class="n">phase_idx</span><span class="p">]</span></pre>
<pre class='cython code score-9 '>        <span class='trace'>__Pyx_TraceLine</span>(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetItemInt_List</span>(__pyx_v_phase_dof, __pyx_v_phase_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 244, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_3 = <span class='py_c_api'>PyNumber_InPlaceAdd</span>(__pyx_v_var_offset, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_var_offset, __pyx_t_3);
        __pyx_t_3 = 0;
      }
</pre><pre class="cython line score-0"> <span class="">245</span>: </pre>
<pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">246</span>:             <span class="n">properties</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s">'solve_iterations'</span><span class="p">]</span> <span class="o">+=</span> <span class="mf">1</span></pre>
<pre class='cython code score-19 '>      <span class='trace'>__Pyx_TraceLine</span>(246,0,__PYX_ERR(0, 246, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_properties, __pyx_n_s_attrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_u_solve_iterations);
      __pyx_t_45 = __pyx_n_u_solve_iterations;
      __pyx_t_30 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_3, __pyx_t_45); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 246, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyInt_AddObjC</span>(__pyx_t_30, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 246, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_t_3, __pyx_t_45, __pyx_t_12) < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_45); __pyx_t_45 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-52" onclick='toggleDiv(this)'>+<span class="">247</span>:             <span class="n">total_comp</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nansum</span><span class="p">(</span><span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">][</span><span class="o">...</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">newaxis</span><span class="p">]</span> <span class="o">*</span> \</pre>
<pre class='cython code score-52 '>      <span class='trace'>__Pyx_TraceLine</span>(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nansum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_30 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_NP_values, __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_INCREF</span>(Py_Ellipsis);
      <span class='refnanny'>__Pyx_GIVEREF</span>(Py_Ellipsis);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, Py_Ellipsis);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 1, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_30, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
      __pyx_t_3 = <span class='py_c_api'>PyNumber_Multiply</span>(__pyx_t_11, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3);
      <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_3);
      __pyx_t_3 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_t_30, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 247, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_total_comp, __pyx_t_11);
      __pyx_t_11 = 0;
</pre><pre class="cython line score-18" onclick='toggleDiv(this)'>+<span class="">248</span>:                                    <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">],</span> <span class="n">axis</span><span class="o">=-</span><span class="mf">2</span><span class="p">)</span></pre>
<pre class='cython code score-18 '>      <span class='trace'>__Pyx_TraceLine</span>(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_30 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_X_values, __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 248, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
      __pyx_t_3 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_3, __pyx_n_s_axis, __pyx_int_neg_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
</pre><pre class="cython line score-39" onclick='toggleDiv(this)'>+<span class="">249</span>:             <span class="n">driving_force</span> <span class="o">=</span> <span class="p">(</span><span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">*</span> <span class="n">total_comp</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">axis</span><span class="o">=-</span><span class="mf">1</span><span class="p">)</span> <span class="o">-</span> \</pre>
<pre class='cython code score-39 '>      <span class='trace'>__Pyx_TraceLine</span>(249,0,__PYX_ERR(0, 249, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_MU_values, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyNumber_Multiply</span>(__pyx_t_3, __pyx_v_total_comp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyDict_New</span>(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_t_11, __pyx_n_s_axis, __pyx_int_neg_1) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
/* … */
      <span class='trace'>__Pyx_TraceLine</span>(249,0,__PYX_ERR(0, 249, __pyx_L1_error))
      __pyx_t_11 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_30, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_driving_force, __pyx_t_11);
      __pyx_t_11 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">250</span>:                              <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span></pre>
<pre class='cython code score-8 '>      <span class='trace'>__Pyx_TraceLine</span>(250,0,__PYX_ERR(0, 250, __pyx_L1_error))
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_3 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_GM_values, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-43" onclick='toggleDiv(this)'>+<span class="">251</span>:             <span class="n">driving_force</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">squeeze</span><span class="p">(</span><span class="n">driving_force</span><span class="p">)</span></pre>
<pre class='cython code score-43 '>      <span class='trace'>__Pyx_TraceLine</span>(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 251, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_30))) {
        __pyx_t_3 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_30);
        if (likely(__pyx_t_3)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_30);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_30, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_30, __pyx_v_driving_force); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_30)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_driving_force};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_30)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_driving_force};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_30, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        {
          __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_3); __pyx_t_3 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_driving_force);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_driving_force);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+1, __pyx_v_driving_force);
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_30, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_driving_force, __pyx_t_11);
      __pyx_t_11 = 0;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">252</span>:             <span class="k">if</span> <span class="n">verbose</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_verbose); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-26" onclick='toggleDiv(this)'>+<span class="">253</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Chem pot progress'</span><span class="p">,</span> <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">-</span> <span class="n">old_chem_pots</span><span class="p">)</span></pre>
<pre class='cython code score-26 '>        <span class='trace'>__Pyx_TraceLine</span>(253,0,__PYX_ERR(0, 253, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_30 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_MU_values, __pyx_t_11); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 253, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_30, __pyx_v_old_chem_pots); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 253, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_Chem_pot_progress);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_Chem_pot_progress);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_kp_u_Chem_pot_progress);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_30, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-26" onclick='toggleDiv(this)'>+<span class="">254</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Energy progress'</span><span class="p">,</span> <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">-</span> <span class="n">old_energy</span><span class="p">)</span></pre>
<pre class='cython code score-26 '>        <span class='trace'>__Pyx_TraceLine</span>(254,0,__PYX_ERR(0, 254, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_30 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_GM_values, __pyx_t_11); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 254, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_30, __pyx_v_old_energy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 254, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_Energy_progress);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_Energy_progress);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_kp_u_Energy_progress);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_30, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-13" onclick='toggleDiv(this)'>+<span class="">255</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Driving force'</span><span class="p">,</span> <span class="n">driving_force</span><span class="p">)</span></pre>
<pre class='cython code score-13 '>        <span class='trace'>__Pyx_TraceLine</span>(255,0,__PYX_ERR(0, 255, __pyx_L1_error))
        __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 255, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_Driving_force);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_Driving_force);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_kp_u_Driving_force);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_driving_force);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_driving_force);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 1, __pyx_v_driving_force);
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_11, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 255, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-84" onclick='toggleDiv(this)'>+<span class="">256</span>:             <span class="n">no_progress</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">-</span> <span class="n">old_chem_pots</span><span class="p">)</span><span class="o">.</span><span class="n">max</span><span class="p">()</span> <span class="o"><</span> <span class="mf">0.01</span></pre>
<pre class='cython code score-84 '>      <span class='trace'>__Pyx_TraceLine</span>(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_abs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      __pyx_t_32 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_MU_values, __pyx_t_12); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_32);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_32, __pyx_v_old_chem_pots); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
        __pyx_t_32 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
        if (likely(__pyx_t_32)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_32);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_32) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, __pyx_t_12};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_32, __pyx_t_12};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_32); __pyx_t_32 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_32); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0, __pyx_t_32); __pyx_t_32 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 0+1, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
        __pyx_t_11 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
        if (likely(__pyx_t_11)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
        }
      }
      if (__pyx_t_11) {
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 256, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      } else {
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_CallNoArg</span>(__pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 256, __pyx_L1_error)
      }
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_30, __pyx_float_0_01, Py_LT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_v_no_progress, __pyx_t_3);
      __pyx_t_3 = 0;
</pre><pre class="cython line score-74" onclick='toggleDiv(this)'>+<span class="">257</span>:             <span class="n">no_progress</span> <span class="o">&=</span> <span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">-</span> <span class="n">old_energy</span><span class="p">)</span> <span class="o"><</span> <span class="n">MIN_SOLVE_ENERGY_PROGRESS</span></pre>
<pre class='cython code score-74 '>      <span class='trace'>__Pyx_TraceLine</span>(257,0,__PYX_ERR(0, 257, __pyx_L1_error))
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_30, __pyx_n_s_abs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_v_prop_GM_values, __pyx_t_30); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = <span class='py_c_api'>PyNumber_Subtract</span>(__pyx_t_2, __pyx_v_old_energy); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
        __pyx_t_2 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
        if (likely(__pyx_t_2)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_2);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_30};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_30};
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        } else
        #endif
        {
          __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 257, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_2); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+1, __pyx_t_30);
          __pyx_t_30 = 0;
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MIN_SOLVE_ENERGY_PROGRESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_12 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_3, __pyx_t_11, Py_LT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyNumber_InPlaceAnd</span>(__pyx_v_no_progress, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_no_progress, __pyx_t_11);
      __pyx_t_11 = 0;
</pre><pre class="cython line score-56" onclick='toggleDiv(this)'>+<span class="">258</span>:             <span class="k">if</span> <span class="n">no_progress</span> <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">driving_force</span><span class="p">)</span> <span class="o">></span> <span class="n">MAX_SOLVE_DRIVING_FORCE</span><span class="p">:</span></pre>
<pre class='cython code score-56 '>      <span class='trace'>__Pyx_TraceLine</span>(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
      __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_no_progress); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
      if (__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L119_bool_binop_done;
      }
      __pyx_t_12 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 258, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_abs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
        __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
        if (likely(__pyx_t_12)) {
          PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
          <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_v_driving_force); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      } else {
        #if CYTHON_FAST_PYCALL
        if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_driving_force};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_driving_force};
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else
        #endif
        {
          __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 258, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_12); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_12); __pyx_t_12 = NULL;
          <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_driving_force);
          <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_driving_force);
          <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0+1, __pyx_v_driving_force);
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_30, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        }
      }
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_SOLVE_DRIVING_FORCE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      __pyx_t_30 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_11, __pyx_t_3, Py_GT); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_30); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 258, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_30); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L119_bool_binop_done:;
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-49" onclick='toggleDiv(this)'>+<span class="">259</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Driving force failed to converge: {}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cur_conds</span><span class="p">))</span></pre>
<pre class='cython code score-49 '>        <span class='trace'>__Pyx_TraceLine</span>(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_kp_u_Driving_force_failed_to_converge, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
          __pyx_t_11 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
          if (likely(__pyx_t_11)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_v_cur_conds); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 259, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_cur_conds};
            __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 259, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_cur_conds};
            __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 259, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          } else
          #endif
          {
            __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 259, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+1, __pyx_v_cur_conds);
            __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 259, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_30);
        __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 259, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">260</span>:                 <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(260,0,__PYX_ERR(0, 260, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 260, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_30, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 260, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_30, __pyx_t_3) < 0)) __PYX_ERR(0, 260, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">261</span>:                 <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(261,0,__PYX_ERR(0, 261, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 261, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_NP_values, __pyx_t_3, __pyx_t_30) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">262</span>:                 <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 262, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_30, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 262, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_X_values, __pyx_t_30, __pyx_t_3) < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">263</span>:                 <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(263,0,__PYX_ERR(0, 263, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 263, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Y_values, __pyx_t_3, __pyx_t_30) < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">264</span>:                 <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(264,0,__PYX_ERR(0, 264, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 264, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_30, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 264, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_GM_values, __pyx_t_30, __pyx_t_3) < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">265</span>:                 <span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="s">''</span></pre>
<pre class='cython code score-8 '>        <span class='trace'>__Pyx_TraceLine</span>(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_3, __pyx_kp_u__3) < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">266</span>:                 <span class="k">break</span></pre>
<pre class='cython code score-0 '>        <span class='trace'>__Pyx_TraceLine</span>(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
        goto __pyx_L31_break;
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">267</span>:             <span class="k">elif</span> <span class="n">no_progress</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>      <span class='trace'>__Pyx_TraceLine</span>(267,0,__PYX_ERR(0, 267, __pyx_L1_error))
      __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_no_progress); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 267, __pyx_L1_error)
      if (__pyx_t_5) {
/* … */
      }
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">268</span>:                 <span class="k">if</span> <span class="n">verbose</span><span class="p">:</span></pre>
<pre class='cython code score-2 '>        <span class='trace'>__Pyx_TraceLine</span>(268,0,__PYX_ERR(0, 268, __pyx_L1_error))
        __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_verbose); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
        if (__pyx_t_5) {
/* … */
        }
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">269</span>:                     <span class="k">print</span><span class="p">(</span><span class="s">'No progress'</span><span class="p">)</span></pre>
<pre class='cython code score-8 '>          <span class='trace'>__Pyx_TraceLine</span>(269,0,__PYX_ERR(0, 269, __pyx_L1_error))
          __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
/* … */
  __pyx_tuple__22 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_No_progress); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 269, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__22);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__22);
</pre><pre class="cython line score-38" onclick='toggleDiv(this)'>+<span class="">270</span>:                 <span class="n">num_mass_bals</span> <span class="o">=</span> <span class="nb">len</span><span class="p">([</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">cur_conds</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="k">if</span> <span class="n">i</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">'X_'</span><span class="p">)])</span> <span class="o">+</span> <span class="mf">1</span></pre>
<pre class='cython code score-38 '>        <span class='trace'>__Pyx_TraceLine</span>(270,0,__PYX_ERR(0, 270, __pyx_L1_error))
        { /* enter inner scope */
          PyObject *__pyx_8genexpr8__pyx_v_i = NULL;
          __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L124_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          __pyx_t_8 = 0;
          if (unlikely(__pyx_v_cur_conds == Py_None)) {
            <span class='py_c_api'>PyErr_Format</span>(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
            __PYX_ERR(0, 270, __pyx_L124_error)
          }
          __pyx_t_12 = __Pyx_dict_iterator(__pyx_v_cur_conds, 0, __pyx_n_s_keys, (&__pyx_t_15), (&__pyx_t_17)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 270, __pyx_L124_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30);
          __pyx_t_30 = __pyx_t_12;
          __pyx_t_12 = 0;
          while (1) {
            __pyx_t_36 = __Pyx_dict_iter_next(__pyx_t_30, __pyx_t_15, &__pyx_t_8, &__pyx_t_12, NULL, NULL, __pyx_t_17);
            if (unlikely(__pyx_t_36 == 0)) break;
            if (unlikely(__pyx_t_36 == -1)) __PYX_ERR(0, 270, __pyx_L124_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr8__pyx_v_i, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_8genexpr8__pyx_v_i, __pyx_n_s_startswith); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 270, __pyx_L124_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_12, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L124_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 270, __pyx_L124_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_5) {
              if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_i))) __PYX_ERR(0, 270, __pyx_L124_error)
            }
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr8__pyx_v_i);
          goto __pyx_L128_exit_scope;
          __pyx_L124_error:;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr8__pyx_v_i);
          goto __pyx_L1_error;
          __pyx_L128_exit_scope:;
        } /* exit inner scope */
        __pyx_t_15 = <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_3); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 270, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='py_c_api'>PyInt_FromSsize_t</span>((__pyx_t_15 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_num_mass_bals, __pyx_t_3);
        __pyx_t_3 = 0;
/* … */
  __pyx_tuple__23 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_u_X_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 270, __pyx_L1_error)
  <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__23);
  <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__23);
</pre><pre class="cython line score-92" onclick='toggleDiv(this)'>+<span class="">271</span>:                 <span class="n">chemical_potentials</span> <span class="o">=</span> <span class="n">l_multipliers</span><span class="p">[</span><span class="nb">sum</span><span class="p">([</span><span class="nb">len</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">sublattices</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">]):</span></pre>
<pre class='cython code score-92 '>        <span class='trace'>__Pyx_TraceLine</span>(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
        { /* enter inner scope */
          PyObject *__pyx_8genexpr9__pyx_v_i = NULL;
          __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L131_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
            __pyx_t_30 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_30); __pyx_t_15 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_30 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
            __pyx_t_9 = Py_TYPE(__pyx_t_30)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L131_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_30))) {
                if (__pyx_t_15 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_30)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_11 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_30, __pyx_t_15); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L131_error)
                #else
                __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_30, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L131_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
                #endif
              } else {
                if (__pyx_t_15 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_30)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_11 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_30, __pyx_t_15); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L131_error)
                #else
                __pyx_t_11 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_30, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L131_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
                #endif
              }
            } else {
              __pyx_t_11 = __pyx_t_9(__pyx_t_30);
              if (unlikely(!__pyx_t_11)) {
                PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                  else __PYX_ERR(0, 271, __pyx_L131_error)
                }
                break;
              }
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            }
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_8genexpr9__pyx_v_i, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            __pyx_t_12 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_11, __pyx_8genexpr9__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_12, __pyx_n_s_sublattices); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_11); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 271, __pyx_L131_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr9__pyx_v_i);
          goto __pyx_L134_exit_scope;
          __pyx_L131_error:;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_8genexpr9__pyx_v_i);
          goto __pyx_L1_error;
          __pyx_L134_exit_scope:;
        } /* exit inner scope */
        __pyx_t_30 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 271, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_3);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_30, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_sum, __pyx_t_30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
/* … */
        <span class='trace'>__Pyx_TraceLine</span>(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetSlice</span>(((PyObject *)__pyx_v_l_multipliers), 0, 0, &__pyx_t_3, &__pyx_t_11, NULL, 0, 0, 1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 271, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_v_chemical_potentials, __pyx_t_30);
        __pyx_t_30 = 0;
</pre><pre class="cython line score-93" onclick='toggleDiv(this)'>+<span class="">272</span>:                                                     <span class="nb">sum</span><span class="p">([</span><span class="nb">len</span><span class="p">(</span><span class="n">dbf</span><span class="o">.</span><span class="n">phases</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">sublattices</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">phases</span><span class="p">])</span> <span class="o">+</span> <span class="n">num_mass_bals</span><span class="p">]</span></pre>
<pre class='cython code score-93 '>        <span class='trace'>__Pyx_TraceLine</span>(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
        { /* enter inner scope */
          PyObject *__pyx_9genexpr10__pyx_v_i = NULL;
          __pyx_t_30 = <span class='py_c_api'>PyList_New</span>(0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 272, __pyx_L137_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
          if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_v_phases)) || <span class='py_c_api'>PyTuple_CheckExact</span>(__pyx_v_phases)) {
            __pyx_t_11 = __pyx_v_phases; <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_11); __pyx_t_15 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_11 = <span class='py_c_api'>PyObject_GetIter</span>(__pyx_v_phases); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            __pyx_t_9 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L137_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(<span class='py_c_api'>PyList_CheckExact</span>(__pyx_t_11))) {
                if (__pyx_t_15 >= <span class='py_macro_api'>PyList_GET_SIZE</span>(__pyx_t_11)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_12 = <span class='py_macro_api'>PyList_GET_ITEM</span>(__pyx_t_11, __pyx_t_15); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 272, __pyx_L137_error)
                #else
                __pyx_t_12 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L137_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
                #endif
              } else {
                if (__pyx_t_15 >= <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_t_11)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_12 = <span class='py_macro_api'>PyTuple_GET_ITEM</span>(__pyx_t_11, __pyx_t_15); <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 272, __pyx_L137_error)
                #else
                __pyx_t_12 = <span class='py_macro_api'>PySequence_ITEM</span>(__pyx_t_11, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L137_error)
                <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
                #endif
              }
            } else {
              __pyx_t_12 = __pyx_t_9(__pyx_t_11);
              if (unlikely(!__pyx_t_12)) {
                PyObject* exc_type = <span class='py_c_api'>PyErr_Occurred</span>();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || <span class='py_c_api'>PyErr_GivenExceptionMatches</span>(exc_type, PyExc_StopIteration))) <span class='py_c_api'>PyErr_Clear</span>();
                  else __PYX_ERR(0, 272, __pyx_L137_error)
                }
                break;
              }
              <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            }
            <span class='pyx_macro_api'>__Pyx_XDECREF_SET</span>(__pyx_9genexpr10__pyx_v_i, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_dbf, __pyx_n_s_phases); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            __pyx_t_2 = <span class='py_c_api'>PyObject_GetItem</span>(__pyx_t_12, __pyx_9genexpr10__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_2, __pyx_n_s_sublattices); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_8 = <span class='py_c_api'>PyObject_Length</span>(__pyx_t_12); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = <span class='py_c_api'>PyInt_FromSsize_t</span>(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            if (unlikely(<span class='pyx_c_api'>__Pyx_ListComp_Append</span>(__pyx_t_30, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 272, __pyx_L137_error)
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          }
          <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_9genexpr10__pyx_v_i);
          goto __pyx_L140_exit_scope;
          __pyx_L137_error:;
          <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_9genexpr10__pyx_v_i);
          goto __pyx_L1_error;
          __pyx_L140_exit_scope:;
        } /* exit inner scope */
        __pyx_t_11 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_11, 0, __pyx_t_30);
        __pyx_t_30 = 0;
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_sum, __pyx_t_11, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 272, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='py_c_api'>PyNumber_Add</span>(__pyx_t_30, __pyx_v_num_mass_bals); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">273</span>:                 <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">chemical_potentials</span></pre>
<pre class='cython code score-8 '>        <span class='trace'>__Pyx_TraceLine</span>(273,0,__PYX_ERR(0, 273, __pyx_L1_error))
        __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 273, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_30, __pyx_v_chemical_potentials) < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
</pre><pre class="cython line score-0" onclick='toggleDiv(this)'>+<span class="">274</span>:                 <span class="k">break</span></pre>
<pre class='cython code score-0 '>        <span class='trace'>__Pyx_TraceLine</span>(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
        goto __pyx_L31_break;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">275</span>:             <span class="k">elif</span> <span class="p">(</span><span class="ow">not</span> <span class="n">no_progress</span><span class="p">)</span> <span class="ow">and</span> <span class="n">cur_iter</span> <span class="o">==</span> <span class="n">MAX_SOLVE_ITERATIONS</span><span class="o">-</span><span class="mf">1</span><span class="p">:</span></pre>
<pre class='cython code score-19 '>      <span class='trace'>__Pyx_TraceLine</span>(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
      __pyx_t_6 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_no_progress); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
      __pyx_t_46 = ((!__pyx_t_6) != 0);
      if (__pyx_t_46) {
      } else {
        __pyx_t_5 = __pyx_t_46;
        goto __pyx_L141_bool_binop_done;
      }
      __pyx_t_30 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_cur_iter); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 275, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_30);
      __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_MAX_SOLVE_ITERATIONS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyInt_SubtractObjC</span>(__pyx_t_11, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
      <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_30, __pyx_t_3, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_46 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_11); if (unlikely(__pyx_t_46 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = __pyx_t_46;
      __pyx_L141_bool_binop_done:;
      if (__pyx_t_5) {
/* … */
      }
    }
    __pyx_L31_break:;
</pre><pre class="cython line score-49" onclick='toggleDiv(this)'>+<span class="">276</span>:                 <span class="k">print</span><span class="p">(</span><span class="s">'Failed to converge: {}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cur_conds</span><span class="p">))</span></pre>
<pre class='cython code score-49 '>        <span class='trace'>__Pyx_TraceLine</span>(276,0,__PYX_ERR(0, 276, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_kp_u_Failed_to_converge, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_30 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_3))) {
          __pyx_t_30 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_3);
          if (likely(__pyx_t_30)) {
            PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_3);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_30);
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
            <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_30) {
          __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_v_cur_conds); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error)
          <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        } else {
          #if CYTHON_FAST_PYCALL
          if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_30, __pyx_v_cur_conds};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_30, __pyx_v_cur_conds};
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error)
            <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_30); __pyx_t_30 = 0;
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
          } else
          #endif
          {
            __pyx_t_12 = <span class='py_c_api'>PyTuple_New</span>(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_12);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_30); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0, __pyx_t_30); __pyx_t_30 = NULL;
            <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cur_conds);
            <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_v_cur_conds);
            <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_12, 0+1, __pyx_v_cur_conds);
            __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error)
            <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
            <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
          }
        }
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='py_c_api'>PyTuple_New</span>(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_11);
        <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_3, 0, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">277</span>:                 <span class="n">prop_MU_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(277,0,__PYX_ERR(0, 277, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_MU_values, __pyx_t_11, __pyx_t_3) < 0)) __PYX_ERR(0, 277, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">278</span>:                 <span class="n">prop_NP_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_NP_values, __pyx_t_3, __pyx_t_11) < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">279</span>:                 <span class="n">prop_X_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_X_values, __pyx_t_11, __pyx_t_3) < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">280</span>:                 <span class="n">prop_Y_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Y_values, __pyx_t_3, __pyx_t_11) < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
</pre><pre class="cython line score-14" onclick='toggleDiv(this)'>+<span class="">281</span>:                 <span class="n">prop_GM_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span></pre>
<pre class='cython code score-14 '>        <span class='trace'>__Pyx_TraceLine</span>(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 281, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_11, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 281, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_GM_values, __pyx_t_11, __pyx_t_3) < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-8" onclick='toggleDiv(this)'>+<span class="">282</span>:                 <span class="n">prop_Phase_values</span><span class="p">[</span><span class="n">it</span><span class="o">.</span><span class="n">multi_index</span><span class="p">]</span> <span class="o">=</span> <span class="s">''</span></pre>
<pre class='cython code score-8 '>        <span class='trace'>__Pyx_TraceLine</span>(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
        __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_multi_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
        <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
        if (unlikely(<span class='py_c_api'>PyObject_SetItem</span>(__pyx_v_prop_Phase_values, __pyx_t_3, __pyx_kp_u__3) < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
        <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
</pre><pre class="cython line score-19" onclick='toggleDiv(this)'>+<span class="">283</span>:         <span class="n">it</span><span class="o">.</span><span class="n">iternext</span><span class="p">()</span></pre>
<pre class='cython code score-19 '>    <span class='trace'>__Pyx_TraceLine</span>(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
    __pyx_t_11 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_v_it, __pyx_n_s_iternext); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error)
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_11);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(<span class='py_c_api'>PyMethod_Check</span>(__pyx_t_11))) {
      __pyx_t_12 = <span class='py_macro_api'>PyMethod_GET_SELF</span>(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = <span class='py_macro_api'>PyMethod_GET_FUNCTION</span>(__pyx_t_11);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_12);
        <span class='pyx_macro_api'>__Pyx_INCREF</span>(function);
        <span class='pyx_macro_api'>__Pyx_DECREF_SET</span>(__pyx_t_11, function);
      }
    }
    if (__pyx_t_12) {
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
      <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_12); __pyx_t_12 = 0;
    } else {
      __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_CallNoArg</span>(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
    }
    <span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_11); __pyx_t_11 = 0;
    <span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_L3_continue:;
  }
</pre><pre class="cython line score-2" onclick='toggleDiv(this)'>+<span class="">284</span>:     <span class="k">return</span> <span class="n">properties</span></pre>
<pre class='cython code score-2 '>  <span class='trace'>__Pyx_TraceLine</span>(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
  <span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
  <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_properties);
  __pyx_r = __pyx_v_properties;
  goto __pyx_L0;
</pre></div></body></html>

```python
%lprun -f _solve_eq_at_conditions equilibrium(dbf, ['AL', 'FE', 'VA'], list(dbf.phases.keys()), {v.T: 700, v.X('AL'): (0,1,0.02), v.P: 101325}, model=models, solve_eq_at_conditions=_solve_eq_at_conditions)
```

```python

```