File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def __call__(self, i):
47
47
return self .line ,
48
48
49
49
# Choose success based on exceed a threshold with a uniform pick
50
- if np .random .rand (1 , ) < self .prob :
50
+ if np .random .rand () < self .prob :
51
51
self .success += 1
52
52
y = beta_pdf (self .x , self .success + 1 , (i - self .success ) + 1 )
53
53
self .line .set_data (self .x , y )
Original file line number Diff line number Diff line change @@ -37,19 +37,19 @@ def update(self, y):
37
37
t = self .tdata [0 ] + len (self .tdata ) * self .dt
38
38
39
39
self .tdata .append (t )
40
- self .ydata .append (float ( y ) )
40
+ self .ydata .append (y )
41
41
self .line .set_data (self .tdata , self .ydata )
42
42
return self .line ,
43
43
44
44
45
45
def emitter (p = 0.1 ):
46
46
"""Return a random value in [0, 1) with probability p, else 0."""
47
47
while True :
48
- v = np .random .rand (1 )
48
+ v = np .random .rand ()
49
49
if v > p :
50
50
yield 0.
51
51
else :
52
- yield np .random .rand (1 )
52
+ yield np .random .rand ()
53
53
54
54
55
55
# Fixing random state for reproducibility
You can’t perform that action at this time.
0 commit comments