Skip to content

Commit c35ceea

Browse files
committed
Fix expanded states
1 parent cbff4fc commit c35ceea

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

panel/simdec_app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def palette_(states: list[list[str]], colors_picked: list[list[float]]):
188188
cmaps = [single_color_to_colormap(color_picked) for color_picked in colors_picked]
189189
# Reverse order as in figures high values take the first colors
190190
states = [len(states_) for states_ in states]
191-
return sd.palette(states[::-1], cmaps=cmaps[::-1])
191+
return sd.palette(states, cmaps=cmaps[::-1])
192192

193193

194194
@pn.cache

src/simdec/decomposition.py

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def states_expansion(states: list[int], inputs: pd.DataFrame) -> list[list[str]]
2222
expanded_states.append(["low", "high"])
2323
elif state == 3:
2424
expanded_states.append(["low", "medium", "high"])
25+
else:
26+
expanded_states.append([i for i in range(state)])
2527
else:
2628
expanded_states.append(state)
2729

0 commit comments

Comments
 (0)