@classmethod
def from_rv_discrete(cls, ssrv, prng=None):
    """
        Create a ScalarDistribution from a scipy.states.rv_discrete instance.

        Parameters
        ----------
        ssrv : scipy.stats.rv_discrete
            The random variable to convert to a dit.ScalarDistribution.
        prng : RandomState
            A pseudo-random number generator with a `rand` method which can
            generate random numbers. For now, this is assumed to be something
            with an API compatibile to NumPy's RandomState class. If `None`,
            then we initialize to dit.math.prng.

        Returns
        -------
        d : ScalarDistribution
            A ScalarDistribution representation of `ssrv`.
        """
    outcomes = ssrv.xk
    pmf = ssrv.pk
    prng = prng if prng is not None else ssrv.random_state
    return cls(outcomes, pmf, prng=prng)
