google-deepmind / google-deepmind/pysc2

Colors.py Error fix

Open
#356 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

The error:
TypeError: Random.shuffle() takes 2 positional arguments but 3 were given

In the code of Colors.py:
![image](https://github.com/google-deepmind/pysc2/assets/71838641/efd4f3b0-2dee-485b-971c-504f1e1cd50f)

was fixed by replacing it with:
def shuffled_hue(scale):
palette = list(smooth_hue_palette(scale))
random_keys = [random.random() for _ in palette]
palette = [x for _, x in sorted(zip(random_keys, palette))]
return numpy.array(palette)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.