Skip to content

Commit

Permalink
Fixing coloring out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
felixleopoldo committed Feb 7, 2024
1 parent b6c68cc commit 0ca0a60
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/cstrees/cstree.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,17 +806,13 @@ def sample_cstree(cards: list[int], max_cvars: int, prob_cvar: int,

# Color each stage in the optimal staging. Singletons are black.
# This should be done somewhere else probably.
colors = ['peru','blueviolet', 'orange', 'navy', 'rebeccapurple', 'darkseagreen',
'darkslategray', 'lightslategray', 'aquamarine',
'lightgoldenrodyellow', 'cornsilk', 'azure', 'chocolate',
'red', 'darkolivegreen']

colors = ['peru','blueviolet', 'orange', 'navy', 'rebeccapurple', 'darkseagreen', 'aquamarine', 'goldenrodyellow', 'cornsilk', 'azure', 'chocolate', 'red', 'darkolivegreen', 'chartreuse', 'turquoise', 'olive', 'crimson', 'goldenrod', 'orchid', 'firebrick', 'lawngreen', 'deeppink', 'wheat', 'teal', 'mediumseagreen', 'salmon', 'palegreen', 'navajowhite', 'yellowgreen', 'mediumaquamarine', 'darkcyan', 'dodgerblue', 'brown', 'powderblue', 'mistyrose', 'violet', 'darkslategrey', 'midnightblue', 'aliceblue', 'dimgrey', 'palegoldenrod', 'black', 'darkgrey', 'olivedrab', 'linen', 'lightblue', 'thistle', 'greenyellow', 'indianred', 'khaki', 'lightslategrey', 'slateblue', 'purple', 'deepskyblue', 'magenta', 'yellow', 'ivory', 'darkorchid', 'mediumpurple', 'snow', 'dimgray', 'palevioletred', 'darkslateblue', 'sandybrown', 'lightgray', 'lemonchiffon', 'gray', 'silver', 'aqua', 'tomato', 'lightyellow', 'seagreen', 'darkmagenta', 'beige', 'cornflowerblue', 'peachpuff', 'ghostwhite', 'cyan', 'lightcoral', 'hotpink', 'lightpink', 'lightskyblue', 'slategrey', 'tan', 'oldlace', 'steelblue', 'springgreen', 'fuchsia', 'lime', 'papayawhip', 'mediumblue', 'mediumspringgreen', 'darkorange', 'lightgreen', 'blue', 'slategray', 'white', 'saddlebrown', 'mediumturquoise', 'paleturquoise', 'darkblue', 'plum', 'lightseagreen', 'lightgrey', 'blanchedalmond', 'lavenderblush', 'darkkhaki', 'gainsboro', 'lightsalmon', 'darkturquoise', 'moccasin', 'darkgoldenrod', 'mediumorchid', 'honeydew', 'mediumslateblue', 'maroon', 'forestgreen', 'darkgray', 'floralwhite', 'darkgreen', 'lightcyan', 'darksalmon', 'pink', 'royalblue', 'sienna', 'green', 'orangered', 'bisque', 'antiquewhite', 'rosybrown', 'whitesmoke', 'darkred', 'burlywood', 'skyblue', 'mediumvioletred', 'mintcream', 'limegreen', 'lightsteelblue', 'grey', 'coral', 'indigo', 'gold', 'cadetblue']
for level, staging in stagings.items():
for i, stage in enumerate(staging):
if (level==-1) or ((level>0) and all([isinstance(i, int) for i in stage.list_repr])):
stage.color = "black"
else:
stage.color = colors[i]
stage.color = colors[i % len(colors)]

ct.update_stages(stagings)

Expand Down

0 comments on commit 0ca0a60

Please sign in to comment.