Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: for labeled and labeled & inferred bars generation broken for ca-ebike #155

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions viz_scripts/scaffolding.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ async def mapping_color_labels(dynamic_labels = {}, unique_keys = []):
purpose_values = [mode["value"] for mode in labels["PURPOSE"]] if "PURPOSE" in labels else []
replaced_values = [mode["value"] for mode in labels["REPLACED_MODE"]] if "REPLACED_MODE" in labels else []

# Append 'other' to the list if not present
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, so what makes this different than assigning the labels not in the list as "other" on line 203 of this file. Why does this come up specifically for ca-ebike?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 203, we are binning the internal labels which are not available on the label-options to 'other'. This is being called from load_viz_notebook_data(), while the above case is added for color mapping which is created before the call to load_viz_notebook_data().
This comes specifically for ca-ebike because we do not have 'other' in ca-ebike label-options json file.

for values in [mode_values, purpose_values, replaced_values]:
if "other" not in values:
values.append("other")

# Mapping between mode values and base_mode OR baseMode (backwards compatibility)
value_to_basemode = {mode["value"]: mode.get("base_mode", mode.get("baseMode", "UNKNOWN")) for mode in labels["MODE"]}
# Assign colors to mode, replaced, purpose, and sensed values
Expand Down