Skip to content

Commit 254ef43

Browse files
committed
avoid using non-numpy random
1 parent 8d0790f commit 254ef43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/palantir/plot_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,10 @@ def color_generator(exclude):
278278
for clr in default_cycle:
279279
if clr not in exclude:
280280
yield clr
281+
hex_digits = np.array(list("0123456789ABCDEF"))
281282
# If default cycle is exhausted, generate random colors.
282283
while True:
283-
new_color = "#" + "".join(random.choice("0123456789ABCDEF") for _ in range(6))
284+
new_color = "#" + "".join(np.random.choice(hex_digits, size=6))
284285
if new_color not in exclude:
285286
yield new_color
286287

0 commit comments

Comments
 (0)