diff --git a/pymc3_hmm/utils.py b/pymc3_hmm/utils.py index 99f1b8b..8f2047d 100644 --- a/pymc3_hmm/utils.py +++ b/pymc3_hmm/utils.py @@ -1,7 +1,5 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, Union -import datashader as ds -import datashader.transfer_functions as tf import matplotlib.pyplot as plt import numpy as np import pandas as pd @@ -21,6 +19,12 @@ from theano.tensor.extra_ops import broadcast_to as at_broadcast_to from theano.tensor.var import TensorVariable +try: # pragma: no cover + import datashader as ds + import datashader.transfer_functions as tf +except ImportError: # pragma: no cover + pass + vsearchsorted = np.vectorize(np.searchsorted, otypes=[int], signature="(n),()->()")