Skip to content

Commit 34e1317

Browse files
committed
Used to_tuple for size
1 parent 7a3583a commit 34e1317

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymc3/distributions/simulator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from scipy.spatial import cKDTree
2020

21-
from pymc3.distributions.distribution import NoDistribution, draw_values
21+
from pymc3.distributions.distribution import NoDistribution, draw_values, to_tuple
2222

2323
__all__ = ["Simulator"]
2424

@@ -114,8 +114,9 @@ def random(self, point=None, size=None):
114114
-------
115115
array
116116
"""
117+
size = to_tuple(size)
117118
params = draw_values([*self.params], point=point, size=size)
118-
if (size is None) or (len(size) == 0):
119+
if len(size) == 0:
119120
return self.function(*params)
120121
else:
121122
return np.array([self.function(*params) for _ in range(size[0])])

0 commit comments

Comments
 (0)