def setup(self, dist, c): self.urng = np.random.default_rng(0xfaad7df1c89e050200dbe258636b3265) with np.testing.suppress_warnings() as sup: sup.filter(RuntimeWarning) try: self.rng = stats.TransformedDensityRejection( dist, c=c, random_state=self.urng) except stats.UNURANError: # contdist3 is not T-concave for c=0. So, skip such test-cases raise NotImplementedError(f"{dist} not T-concave for c={c}")
def time_tdr_setup(self, dist, c): with np.testing.suppress_warnings() as sup: sup.filter(RuntimeWarning) stats.TransformedDensityRejection( dist, c=c, random_state=self.urng )