Skip to content

Commit 2027dfb

Browse files
author
David Butterworth
committed
Simplify chain() call in VanDerCorputSequence()
1 parent e9521c9 commit 2027dfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/prpy/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def VanDerCorputSequence(lower=0.0, upper=1.0, include_endpoints=True):
10051005
if include_endpoints == True:
10061006
endpoints = (0.0, 1.0)
10071007
else:
1008-
endpoints = None
1008+
endpoints = []
10091009

10101010
# Get a sequence of reversed binary numbers:
10111011
# '1', '01', '11', '001', '101', '011', '111', '0001', ....
@@ -1023,7 +1023,7 @@ def VanDerCorputSequence(lower=0.0, upper=1.0, include_endpoints=True):
10231023
# Scale the Van der Corput sequence across the desired range
10241024
# and optionally add the end-points.
10251025
scale = float(upper - lower)
1026-
return (scale * val + lower for val in chain(endpoints or [], raw_seq))
1026+
return (scale * val + lower for val in chain(endpoints, raw_seq))
10271027

10281028

10291029
def SampleTimeGenerator(start, end, step=1):

0 commit comments

Comments
 (0)