Skip to content

Commit 67dea17

Browse files
authored
try fix citi bike hello world dashboard (#555)
* Update citi_bike_dashboard.py remove missed keys in option candidates * Update dashboard_helper.py use a copy of attribute_option_candidates in functions
1 parent f559634 commit 67dea17

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

maro/cli/inspector/citi_bike_dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def render_inter_view(source_path: str, epoch_num: int):
6666
# Get epoch sample number.
6767
down_pooling_range = helper._get_sampled_epoch_range(epoch_num, sample_ratio)
6868
attribute_option_candidates = (
69-
CITIBIKEItemOption.quick_info + CITIBIKEItemOption.requirement_info + CITIBIKEItemOption.station_info
69+
CITIBIKEItemOption.quick_info + CITIBIKEItemOption.requirement_info + ["bikes", "capacity"]
7070
)
7171
# Generate data.
7272
data_summary = helper.read_detail_csv(

maro/cli/inspector/dashboard_helper.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4+
import copy
45
import math
56
from typing import List
67

@@ -206,10 +207,10 @@ def _get_attribute_option(
206207
if scenario == GlobalScenarios.CITI_BIKE:
207208
for item in attribute_option:
208209
if item == "All":
209-
attribute_option_candidates.remove("All")
210-
attribute_option_candidates.remove("Requirement Info")
211-
attribute_option_candidates.remove("Station Info")
212-
attribute_option_res = attribute_option_candidates
210+
attribute_option_res = copy.deepcopy(attribute_option_candidates)
211+
attribute_option_res.remove("All")
212+
attribute_option_res.remove("Requirement Info")
213+
attribute_option_res.remove("Station Info")
213214
break
214215
elif item == "Requirement Info":
215216
attribute_option_res = attribute_option_res + CITIBIKEItemOption.requirement_info
@@ -222,10 +223,10 @@ def _get_attribute_option(
222223
if scenario == GlobalScenarios.CIM:
223224
for item in attribute_option:
224225
if item == "All":
225-
attribute_option_candidates.remove("All")
226-
attribute_option_candidates.remove("Booking Info")
227-
attribute_option_candidates.remove("Port Info")
228-
attribute_option_res = attribute_option_candidates
226+
attribute_option_res = copy.deepcopy(attribute_option_candidates)
227+
attribute_option_res.remove("All")
228+
attribute_option_res.remove("Booking Info")
229+
attribute_option_res.remove("Port Info")
229230
break
230231
elif item == "Booking Info":
231232
attribute_option_res = attribute_option_res + CIMItemOption.booking_info

0 commit comments

Comments
 (0)