'Check that for every state, reward is finite for some action,
and for the case sa_pair is True, that for every state, there is
some action available.'

def _check_action_feasibility(self):

    R_max = self.s_wise_max(self.R)
    if (R_max == (- np.inf)).any():
        s = np.where((R_max == (- np.inf)))[0][0]
        raise ValueError('for    every    state    the    reward    must    be    finite    for    some    action:    violated    for    state    {s}'.format(s=s))
    if self._sa_pair:
        diff = np.diff(self.a_indptr)
        if (diff == 0).any():
            s = np.where((diff == 0))[0][0]
            raise ValueError('for    every    state    at    least    one    action    must    be    available:    violated    for    state    {s}'.format(s=s))
