(self)
Update the induced cut points.
Update the induced cut points.
Update the induced cut points .
def _update_points(self):
        """
        Update the induced cut points.
        """
        if self.data is None:
            return

        def induce_cuts(method, data, var):
            dvar = _dispatch[type(method)](method, data, var)
            if dvar is None:
                # removed
                return [], None
            elif dvar is var:
                # no transformation took place
                return None, var
            elif is_discretized(dvar):
                return dvar.compute_value.points, dvar
            raise ValueError

        for i, var in enumerate(self.varmodel):
            state = self.var_state[i]
            if state.points is None and state.disc_var is None:
                points, dvar = induce_cuts(state.method, self.data, var)
                new_state = state._replace(points=points, disc_var=dvar)
                self._set_var_state(i, new_state)
def _update_points ( self ) : if self . data is None : return def induce_cuts ( method , data , var ) : dvar = _dispatch [ type ( method ) ] ( method , data , var ) if dvar is None : # removed return [ ] , None elif dvar is var : # no transformation took place return None , var elif is_discretized ( dvar ) : return dvar . compute_value . points , dvar raise ValueError for i , var in enumerate ( self . varmodel ) : state = self . var_state [ i ] if state . points is None and state . disc_var is None : points , dvar = induce_cuts ( state . method , self . data , var ) new_state = state . _replace ( points = points , disc_var = dvar ) self . _set_var_state ( i , new_state )