Skip to content

Commit 3e7e987

Browse files
committed
Remove workaround for HyperGeometric logcdf failure related to aesara/issues/461
1 parent 225b474 commit 3e7e987

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

pymc3/tests/test_distributions.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,6 @@ def check_logp(
596596
n_samples=100,
597597
extra_args=None,
598598
scipy_args=None,
599-
skip_params_fn=lambda x: False,
600599
):
601600
"""
602601
Generic test for PyMC3 logp methods
@@ -628,9 +627,6 @@ def check_logp(
628627
the pymc3 distribution logp is calculated
629628
scipy_args : Dictionary with extra arguments needed to call scipy logp method
630629
Usually the same as extra_args
631-
skip_params_fn: Callable
632-
A function that takes a ``dict`` of the test points and returns a
633-
boolean indicating whether or not to perform the test.
634630
"""
635631
if decimal is None:
636632
decimal = select_by_precision(float64=6, float32=3)
@@ -652,8 +648,6 @@ def logp_reference(args):
652648
domains["value"] = domain
653649
for pt in product(domains, n_samples=n_samples):
654650
pt = dict(pt)
655-
if skip_params_fn(pt):
656-
continue
657651
pt_d = self._model_input_dict(model, param_vars, pt)
658652
pt_logp = Point(pt_d, model=model)
659653
pt_ref = Point(pt, filter_model_vars=False, model=model)
@@ -698,7 +692,6 @@ def check_logcdf(
698692
n_samples=100,
699693
skip_paramdomain_inside_edge_test=False,
700694
skip_paramdomain_outside_edge_test=False,
701-
skip_params_fn=lambda x: False,
702695
):
703696
"""
704697
Generic test for PyMC3 logcdf methods
@@ -739,9 +732,6 @@ def check_logcdf(
739732
skip_paramdomain_outside_edge_test : Bool
740733
Whether to run test 2., which checks that pymc3 distribution logcdf
741734
returns -inf for invalid parameter values outside the supported domain edge
742-
skip_params_fn: Callable
743-
A function that takes a ``dict`` of the test points and returns a
744-
boolean indicating whether or not to perform the test.
745735
746736
Returns
747737
-------
@@ -761,9 +751,6 @@ def check_logcdf(
761751

762752
for pt in product(domains, n_samples=n_samples):
763753
params = dict(pt)
764-
if skip_params_fn(params):
765-
continue
766-
767754
scipy_eval = scipy_logcdf(**params)
768755

769756
value = params.pop("value")
@@ -853,7 +840,6 @@ def check_selfconsistency_discrete_logcdf(
853840
paramdomains,
854841
decimal=None,
855842
n_samples=100,
856-
skip_params_fn=lambda x: False,
857843
):
858844
"""
859845
Check that logcdf of discrete distributions matches sum of logps up to value
@@ -872,8 +858,6 @@ def check_selfconsistency_discrete_logcdf(
872858

873859
for pt in product(domains, n_samples=n_samples):
874860
params = dict(pt)
875-
if skip_params_fn(params):
876-
continue
877861
value = params.pop("value")
878862
values = np.arange(domain.lower, value + 1)
879863

@@ -1256,20 +1240,17 @@ def modified_scipy_hypergeom_logcdf(value, N, k, n):
12561240
Nat,
12571241
{"N": NatSmall, "k": NatSmall, "n": NatSmall},
12581242
modified_scipy_hypergeom_logpmf,
1259-
skip_params_fn=lambda x: x["N"] < x["n"] or x["N"] < x["k"],
12601243
)
12611244
self.check_logcdf(
12621245
HyperGeometric,
12631246
Nat,
12641247
{"N": NatSmall, "k": NatSmall, "n": NatSmall},
12651248
modified_scipy_hypergeom_logcdf,
1266-
skip_params_fn=lambda x: x["N"] < x["n"] or x["N"] < x["k"],
12671249
)
12681250
self.check_selfconsistency_discrete_logcdf(
12691251
HyperGeometric,
12701252
Nat,
12711253
{"N": NatSmall, "k": NatSmall, "n": NatSmall},
1272-
skip_params_fn=lambda x: x["N"] < x["n"] or x["N"] < x["k"],
12731254
)
12741255

12751256
def test_negative_binomial(self):

0 commit comments

Comments
 (0)