def roots(self, init_concs, varied_data, varied, x0=None,
              NumSys=NumSysLog, plot_kwargs=None,
              neqsys_type='chained_conditional', **kwargs):
        """
        Parameters
        ----------
        init_concs : array or dict
        varied_data : array
        varied_idx : int or str
        x0 : array
        NumSys : _NumSys subclass
            See :class:`NumSysLin`, :class:`NumSysLog`, etc.
        plot_kwargs : dict
            See py:meth:`pyneqsys.NeqSys.solve`. Two additional keys
            are intercepted here:
                latex_names: bool (default: False)
                conc_unit_str: str (default: 'M')
        neqsys_type : str
            what method to use for NeqSys construction (get_neqsys_*)
        \\*\\*kwargs :
            Keyword argumetns passed on to py:meth:`pyneqsys.NeqSys.solve_series`.

        """
        _plot = plot_kwargs is not None
        if _plot:
            latex_names = plot_kwargs.pop('latex_names', False)
            conc_unit_str = plot_kwargs.pop('conc_unit_str', 'M')
            if 'ax' not in plot_kwargs:
                plot_kwargs['ax'] = self._get_default_plot_ax()

        init_concs = self.as_per_substance_array(init_concs)
        neqsys = self.get_neqsys(
            neqsys_type, NumSys=NumSys,
            rref_equil=kwargs.pop('rref_equil', False),
            rref_preserv=kwargs.pop('rref_preserv', False),
            precipitates=kwargs.pop('precipitates', None))
        if x0 is None:
            x0 = init_concs

        if _plot:
            cb = neqsys.solve_and_plot_series
            if 'plot_kwargs' not in kwargs:
                kwargs['plot_kwargs'] = plot_kwargs
            if 'labels' not in kwargs['plot_kwargs']:
                kwargs['plot_kwargs']['labels'] = (
                    self.substance_labels(latex_names))
            if 'substances' in plot_kwargs:
                if 'indices' in plot_kwargs:
                    raise ValueError("Now I am confused..")
                kwargs['plot_kwargs']['indices'] = map(
                    self.as_substance_index, plot_kwargs.pop('substances'))
                print(kwargs['plot_kwargs']['indices'])
        else:
            cb = neqsys.solve_series

        params = np.concatenate((init_concs, self.eq_constants()))
        xvecs, info_dicts = cb(
            x0, params, varied_data, self.as_substance_index(varied),
            propagate=False, **kwargs)
        sanity = [self._result_is_sane(init_concs, x) for x in xvecs]

        if _plot:
            import matplotlib.pyplot as plt
            from pyneqsys.plotting import mpl_outside_legend
            mpl_outside_legend(plt.gca())
            varied_subst = self.substances[varied]
            xlbl = ('$[' + varied_subst.latex_name + ']_0$' if latex_names
                    else str(varied_subst))
            plt.gca().set_xlabel(xlbl + ' / ' + conc_unit_str)
            plt.gca().set_ylabel('Concentration / ' + conc_unit_str)

        return xvecs, info_dicts, sanity
def roots ( self , init_concs , varied_data , varied , x0 = None , NumSys = NumSysLog , plot_kwargs = None , neqsys_type = 'chained_conditional' , ** kwargs ) : _plot = plot_kwargs is not None if _plot : latex_names = plot_kwargs . pop ( 'latex_names' , False ) conc_unit_str = plot_kwargs . pop ( 'conc_unit_str' , 'M' ) if 'ax' not in plot_kwargs : plot_kwargs [ 'ax' ] = self . _get_default_plot_ax ( ) init_concs = self . as_per_substance_array ( init_concs ) neqsys = self . get_neqsys ( neqsys_type , NumSys = NumSys , rref_equil = kwargs . pop ( 'rref_equil' , False ) , rref_preserv = kwargs . pop ( 'rref_preserv' , False ) , precipitates = kwargs . pop ( 'precipitates' , None ) ) if x0 is None : x0 = init_concs if _plot : cb = neqsys . solve_and_plot_series if 'plot_kwargs' not in kwargs : kwargs [ 'plot_kwargs' ] = plot_kwargs if 'labels' not in kwargs [ 'plot_kwargs' ] : kwargs [ 'plot_kwargs' ] [ 'labels' ] = ( self . substance_labels ( latex_names ) ) if 'substances' in plot_kwargs : if 'indices' in plot_kwargs : raise ValueError ( "Now I am confused.." ) kwargs [ 'plot_kwargs' ] [ 'indices' ] = map ( self . as_substance_index , plot_kwargs . pop ( 'substances' ) ) print ( kwargs [ 'plot_kwargs' ] [ 'indices' ] ) else : cb = neqsys . solve_series params = np . concatenate ( ( init_concs , self . eq_constants ( ) ) ) xvecs , info_dicts = cb ( x0 , params , varied_data , self . as_substance_index ( varied ) , propagate = False , ** kwargs ) sanity = [ self . _result_is_sane ( init_concs , x ) for x in xvecs ] if _plot : import matplotlib . pyplot as plt from pyneqsys . plotting import mpl_outside_legend mpl_outside_legend ( plt . gca ( ) ) varied_subst = self . substances [ varied ] xlbl = ( '$[' + varied_subst . latex_name + ']_0$' if latex_names else str ( varied_subst ) ) plt . gca ( ) . set_xlabel ( xlbl + ' / ' + conc_unit_str ) plt . gca ( ) . set_ylabel ( 'Concentration / ' + conc_unit_str ) return xvecs , info_dicts , sanity
Parameters
        ----------
        init_concs : array or dict
        varied_data : array
        varied_idx : int or str
        x0 : array
        NumSys : _NumSys subclass
            See :class:`NumSysLin`, :class:`NumSysLog`, etc.
        plot_kwargs : dict
            See py:meth:`pyneqsys.NeqSys.solve`. Two additional keys
            are intercepted here:
                latex_names: bool (default: False)
                conc_unit_str: str (default: 'M')
        neqsys_type : str
            what method to use for NeqSys construction (get_neqsys_*)
        \\*\\*kwargs :
            Keyword argumetns passed on to py:meth:`pyneqsys.NeqSys.solve_series`.