Skip to content

Commit 6494149

Browse files
committed
use warnings
1 parent 6387ff4 commit 6494149

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

preliz/ppls/agnostic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
try:
3131
from pymc import sample_prior_predictive
3232
except ImportError:
33-
pass
33+
warnings.warn("PyMC not installed. PyMC related functions will not work.")
3434

3535

3636
def posterior_to_prior(model, idata, new_families=None, engine="auto"):

preliz/ppls/pymc_io.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Methods to communicate with PyMC."""
22

3+
import warnings
34
from copy import copy
45
from sys import modules
56

@@ -11,8 +12,8 @@
1112
from pytensor import function
1213
from pytensor.graph.traversal import ancestors
1314
from pytensor.tensor import TensorConstant, matrix
14-
except ModuleNotFoundError:
15-
pass
15+
except ImportError:
16+
warnings.warn("PyMC not installed. PyMC related functions will not work.")
1617

1718
from preliz.distributions import Gamma, HalfNormal, Normal
1819
from preliz.internal.distribution_helper import get_distributions

0 commit comments

Comments
 (0)