Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeshA committed Nov 29, 2023
1 parent 748a922 commit 41cf86b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stisim/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ def sample(self, distribution, size=None, **kwargs):
elif size.dtype == bool:
n_samples = len(size)
elif size.dtype == int:
v = size.__array__() # TODO - check if this works without calling __array__()?
# This could use `max_slot = np.max(self.slots[size])` as a simplification
# However, the creation of an intermediate FusedArray means it's around 10% slower
v = size.__array__()
max_slot = self.slots[v].__array__().max()
if max_slot == ss.INT_NAN:
raise Exception('Attempted to sample from an INT_NAN slot')
Expand Down

0 comments on commit 41cf86b

Please sign in to comment.