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

Remove display labels #166

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

iantei
Copy link
Contributor

@iantei iantei commented Oct 10, 2024

  • We have removed the auxillary_files/ *.csv files, and now we are dependent on the usage of label-options file, either provided by the program deployment or from the e-mission-common's default-label-options.
  • Removing the dependency on the Display labels.
  • Usage of internal labels for the creation of bars.

iantei added 12 commits October 9, 2024 13:05
…I(kWH), Replaced_mode_kg/lb_CO2 with mode_confirm_EI(kWH), mode_confirm_kg/lb_CO2, replaced_mode_EI(kWH) and replaced_mode_kg/lb_CO2 respectively.
…display labels like Mode_confirm column in expanded_ct dataframe.
…notebook. Deprecate the use of display labels like Mode_confirm column in expanded_ct dataframe.
… mode_distance_interest as we do not use Mode_confirm - in mode_specific_timeseries notebook.
…slations_replaced as an additional param to energy_impact and CO2_impact plot creation function in plots.py. Map values_to_translations to the respective replaced mode labels in plots.py for energy_impact and CO2_impact.
…ion from internal labels to en-translated version from label-options. 2. Change the filter to use internal label instead of Display labels. 3. Pass key of MODE's from label-option as the categorical list. 4. Remove unnecessary mapping.
…mpact(), CO2_impact() and timeseries_multi_plot() for translations from internal labels to en-version of translation. Set up the y_labels for energy_impact() and CO2_impact(). Set up labels for timeseries_multi_plot().
…ernal label). Pass values_to_translations as an extra argument in barplot_mode().
@iantei
Copy link
Contributor Author

iantei commented Oct 10, 2024

Testing Scenario:

Dataset used - cortezebikes | Program, with default labels

Detailed execution of notebooks:



(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:43:59.183448+00:00 with args Namespace(plot_notebook='generic_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:43:59.218951+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'json/demo-survey-v2.json', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'en': 'Answered', 'es': 'Contestada'}}}, 'trip-labels': 'MULTILABEL'})]
Running at 2024-10-10T19:44:08.934128+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'json/demo-survey-v2.json', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'en': 'Answered', 'es': 'Contestada'}}}, 'trip-labels': 'MULTILABEL'})]




(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics_sensed.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:46:40.185954+00:00 with args Namespace(plot_notebook='generic_metrics_sensed.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:46:40.221119+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('bluetooth_only', bool, value=False)]
Running at 2024-10-10T19:46:44.436239+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('bluetooth_only', bool, value=False)]
Running at 2024-10-10T19:46:47.789382+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=7), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('bluetooth_only', bool, value=False)]


(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_timeseries.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:48:06.193993+00:00 with args Namespace(plot_notebook='generic_timeseries.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:48:06.232414+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned')]
Running at 2024-10-10T19:48:35.219194+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned')]
Running at 2024-10-10T19:48:45.256467+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=7), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned')]




(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py mode_specific_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:50:41.728996+00:00 with args Namespace(plot_notebook='mode_specific_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:50:41.764013+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]
Running at 2024-10-10T19:50:49.031803+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]


(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py mode_specific_timeseries.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:53:52.770637+00:00 with args Namespace(plot_notebook='mode_specific_timeseries.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:53:52.811140+00:00 with params [Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]
Running at 2024-10-10T19:54:02.062165+00:00 with params [Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]



(emission) root@cd8be09e56e3:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py energy_calculations.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
label_options is unavailable for the dynamic_config in cortezebikes
Running at 2024-10-10T19:55:01.933840+00:00 with args Namespace(plot_notebook='energy_calculations.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T19:55:01.968762+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('is_debug_mode', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]
Running at 2024-10-10T19:55:26.577181+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('is_debug_mode', bool, value=False), Parameter('dynamic_labels', dict, value={}), Parameter('use_imperial', bool, value=True)]

Results:

Charts of Cortezebikes
Screenshot 2024-10-10 at 12 59 11 PM
Screenshot 2024-10-10 at 2 00 51 PM
Screenshot 2024-10-10 at 2 02 07 PM

Generation of all charts look good

@iantei
Copy link
Contributor Author

iantei commented Oct 10, 2024

Testing Scenario:

Dataset used - usaid-laos-ev

Execution of notebooks:

(emission) root@894058462ee6:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/usaid-laos-ev.nrel-op.json
Successfully downloaded config with version 1 for USAID-NREL Support for Electric Vehicle Readiness and data collection URL https://USAID-laos-EV-openpath.nrel.gov/api/
Dynamic labels download was successful for nrel-openpath-deploy-configs: usaid-laos-ev
Running at 2024-10-10T21:21:58.036462+00:00 with args Namespace(plot_notebook='generic_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-05-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T21:21:58.081315+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='study'), Parameter('include_test_users', bool, value=True), Parameter('dynamic_labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING', 'baseMode': 'WALKING', 'met_equivalent': 'WALKING', 'kgCo2PerKm': 0}, {'value': 'e-auto_rickshaw', 'base_mode': 'MOPED', 'icon': 'rickshaw-electric', 'footprint': {'electric': {'wh_per_km': 341.82}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.085416859}, {'value': 'auto_rickshaw', 'base_mode': 'MOPED', 'icon': 'rickshaw', 'footprint': {'gasoline': {'wh_per_km': 970}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.231943784}, {'value': 'motorcycle', 'base_mode': 'MOPED', 'footprint': {'gasoline': {'wh_per_km': 473.17}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.113143309}, {'value': 'e-bike', 'base_mode': 'E_BIKE', 'baseMode': 'E_BIKE', 'met': {'ALL': {'range': [0, -1], 'mets': 4.9}}, 'kgCo2PerKm': 0.00728}, {'value': 'bike', 'base_mode': 'BICYCLING', 'baseMode': 'BICYCLING', 'met_equivalent': 'BICYCLING', 'kgCo2PerKm': 0}, {'value': 'drove_alone', 'base_mode': 'CAR', 'baseMode': 'CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.22031}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2, 'baseMode': 'CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.11015}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'baseMode': 'E_CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.08216}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2, 'baseMode': 'E_CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.04108}, {'value': 'taxi', 'base_mode': 'TAXI', 'baseMode': 'TAXI', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.30741}, {'value': 'bus', 'base_mode': 'BUS', 'baseMode': 'BUS', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.20727}, {'value': 'train', 'base_mode': 'TRAIN', 'baseMode': 'TRAIN', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.12256}, {'value': 'free_shuttle', 'base_mode': 'BUS', 'baseMode': 'BUS', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.20727}, {'value': 'air', 'base_mode': 'AIR', 'baseMode': 'AIR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.09975}, {'value': 'not_a_trip', 'base_mode': 'NONE', 'baseMode': 'UNKNOWN', 'met_equivalent': 'UNKNOWN', 'kgCo2PerKm': 0}, {'value': 'other', 'base_mode': 'OTHER', 'baseMode': 'OTHER', 'met_equivalent': 'UNKNOWN', 'kgCo2PerKm': 0}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-auto_rickshaw': 'E-tuk tuk', 'auto_rickshaw': 'Tuk Tuk', 'motorcycle': 'Motorcycle', 'e-bike': 'E-bike', 'bike': 'Bicycle', 'drove_alone': 'Car Drove Alone', 'shared_ride': 'Car Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi/Loca/inDrive', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Airplane', 'not_a_trip': 'Not a trip', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up/ Drop off Person', 'pick_drop_item': 'Pick-up/ Drop off Item', 'personal_med': 'Personal/ Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation/ Exercise', 'entertainment': 'Entertainment/ Social', 'religious': 'Religious', 'other': 'Other'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-auto_rickshaw': 'ລົດ 3 ລໍ້ໄຟຟ້າ ຫລື ຕຸກຕຸກໄຟຟ້າ', 'auto_rickshaw': 'ເດີນທາດ້ວຍ ລົດຕຸກຕຸກ ຫລື ລົດສາມລໍ້', 'motorcycle': 'ລົດຈັກ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=False), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/survey_resources/usaid-laos-ev/usaid-laos-ev-demo-survey-v4.xml', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'lo': 'ຕອບ', 'en': 'Answered'}}}, 'trip-labels': 'MULTILABEL'})]


(emission) root@894058462ee6:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics_sensed.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/usaid-laos-ev.nrel-op.json
Successfully downloaded config with version 1 for USAID-NREL Support for Electric Vehicle Readiness and data collection URL https://USAID-laos-EV-openpath.nrel.gov/api/
Dynamic labels download was successful for nrel-openpath-deploy-configs: usaid-laos-ev
Running at 2024-10-10T21:36:11.931469+00:00 with args Namespace(plot_notebook='generic_metrics_sensed.ipynb', program='default', date=None) for range (<Arrow [2023-05-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T21:36:11.973267+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='study'), Parameter('include_test_users', bool, value=True), Parameter('use_imperial', bool, value=False), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('bluetooth_only', bool, value=False)]


(emission) root@894058462ee6:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_timeseries.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:30: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/usaid-laos-ev.nrel-op.json
Successfully downloaded config with version 1 for USAID-NREL Support for Electric Vehicle Readiness and data collection URL https://USAID-laos-EV-openpath.nrel.gov/api/
Dynamic labels download was successful for nrel-openpath-deploy-configs: usaid-laos-ev
Running at 2024-10-10T21:56:40.896695+00:00 with args Namespace(plot_notebook='generic_timeseries.ipynb', program='default', date=None) for range (<Arrow [2023-05-01T00:00:00+00:00]>, <Arrow [2024-10-01T00:00:00+00:00]>)
Running at 2024-10-10T21:56:40.935622+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='study'), Parameter('include_test_users', bool, value=True), Parameter('dynamic_labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING', 'baseMode': 'WALKING', 'met_equivalent': 'WALKING', 'kgCo2PerKm': 0}, {'value': 'e-auto_rickshaw', 'base_mode': 'MOPED', 'icon': 'rickshaw-electric', 'footprint': {'electric': {'wh_per_km': 341.82}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.085416859}, {'value': 'auto_rickshaw', 'base_mode': 'MOPED', 'icon': 'rickshaw', 'footprint': {'gasoline': {'wh_per_km': 970}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.231943784}, {'value': 'motorcycle', 'base_mode': 'MOPED', 'footprint': {'gasoline': {'wh_per_km': 473.17}}, 'baseMode': 'MOPED', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.113143309}, {'value': 'e-bike', 'base_mode': 'E_BIKE', 'baseMode': 'E_BIKE', 'met': {'ALL': {'range': [0, -1], 'mets': 4.9}}, 'kgCo2PerKm': 0.00728}, {'value': 'bike', 'base_mode': 'BICYCLING', 'baseMode': 'BICYCLING', 'met_equivalent': 'BICYCLING', 'kgCo2PerKm': 0}, {'value': 'drove_alone', 'base_mode': 'CAR', 'baseMode': 'CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.22031}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2, 'baseMode': 'CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.11015}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'baseMode': 'E_CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.08216}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2, 'baseMode': 'E_CAR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.04108}, {'value': 'taxi', 'base_mode': 'TAXI', 'baseMode': 'TAXI', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.30741}, {'value': 'bus', 'base_mode': 'BUS', 'baseMode': 'BUS', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.20727}, {'value': 'train', 'base_mode': 'TRAIN', 'baseMode': 'TRAIN', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.12256}, {'value': 'free_shuttle', 'base_mode': 'BUS', 'baseMode': 'BUS', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.20727}, {'value': 'air', 'base_mode': 'AIR', 'baseMode': 'AIR', 'met_equivalent': 'IN_VEHICLE', 'kgCo2PerKm': 0.09975}, {'value': 'not_a_trip', 'base_mode': 'NONE', 'baseMode': 'UNKNOWN', 'met_equivalent': 'UNKNOWN', 'kgCo2PerKm': 0}, {'value': 'other', 'base_mode': 'OTHER', 'baseMode': 'OTHER', 'met_equivalent': 'UNKNOWN', 'kgCo2PerKm': 0}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-auto_rickshaw': 'E-tuk tuk', 'auto_rickshaw': 'Tuk Tuk', 'motorcycle': 'Motorcycle', 'e-bike': 'E-bike', 'bike': 'Bicycle', 'drove_alone': 'Car Drove Alone', 'shared_ride': 'Car Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi/Loca/inDrive', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Airplane', 'not_a_trip': 'Not a trip', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up/ Drop off Person', 'pick_drop_item': 'Pick-up/ Drop off Item', 'personal_med': 'Personal/ Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation/ Exercise', 'entertainment': 'Entertainment/ Social', 'religious': 'Religious', 'other': 'Other'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-auto_rickshaw': 'ລົດ 3 ລໍ້ໄຟຟ້າ ຫລື ຕຸກຕຸກໄຟຟ້າ', 'auto_rickshaw': 'ເດີນທາດ້ວຍ ລົດຕຸກຕຸກ ຫລື ລົດສາມລໍ້', 'motorcycle': 'ລົດຈັກ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=False), Parameter('sensed_algo_prefix', str, value='cleaned')]

Results:

Charts for usaid-laos-ev
Screenshot 2024-10-10 at 3 37 11 PM
Screenshot 2024-10-10 at 3 38 22 PM

All the charts loaded properly.

@iantei
Copy link
Contributor Author

iantei commented Oct 10, 2024

Cortezebikes

Changes in the X-axis labels to show proper labels.

@iantei iantei marked this pull request as ready for review October 10, 2024 23:45
@iantei
Copy link
Contributor Author

iantei commented Jan 8, 2025

Testing Scenario:

Dataset used: cortezebikes

Detailed execution of notebook scripts using `generate_plots.py`:

root@214d7730b831:/usr/src/app# source setup/activate.sh && cd saved-notebooks
(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-07T23:58:22.267575+00:00 with args Namespace(plot_notebook='generic_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-07T23:58:22.303287+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'json/demo-survey-v2.json', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'en': 'Answered', 'es': 'Contestada'}}}, 'trip-labels': 'MULTILABEL'})]
Running at 2025-01-07T23:59:14.037977+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=6), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'json/demo-survey-v2.json', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'en': 'Answered', 'es': 'Contestada'}}}, 'trip-labels': 'MULTILABEL'})]

(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics_sensed.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T00:02:47.734529+00:00 with args Namespace(plot_notebook='generic_metrics_sensed.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T00:02:47.769298+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('include_test_users', bool, value=False), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('bluetooth_only', bool, value=False)]


(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_timeseries.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T00:04:22.572584+00:00 with args Namespace(plot_notebook='generic_timeseries.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T00:04:22.605650+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned')]



(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py mode_specific_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T00:07:26.502671+00:00 with args Namespace(plot_notebook='mode_specific_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T00:07:26.539844+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True)]


(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py mode_specific_timeseries.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T00:09:35.283800+00:00 with args Namespace(plot_notebook='mode_specific_timeseries.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T00:09:35.315780+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True)]

(emission) root@214d7730b831:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py energy_calculations.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T00:11:42.830965+00:00 with args Namespace(plot_notebook='energy_calculations.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T00:11:42.868088+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('is_debug_mode', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True)]

Public dashboard charts for cortezebikes
Cortez_ebikes2025

Looks good!

Copy link
Contributor

@JGreenlee JGreenlee left a comment

Choose a reason for hiding this comment

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

LGTM! Screenshots look great, nice to see all the changes over the last year come together nicely. I have a couple minor comments/ points of clarification

Comment on lines +277 to +282
if values_to_translations:
x_ticks = ax.get_xticklabels()
translated_labels = [values_to_translations.get(label.get_text(), label.get_text()) for label in x_ticks]
ax.set_xticklabels(translated_labels)

ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right')
Copy link
Contributor

@JGreenlee JGreenlee Jan 8, 2025

Choose a reason for hiding this comment

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

I see, the translations are only applied here, during the creation of the plot.
Meaning that everywhere else it is internally using the value, which is good :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I was initially thrown off by

values_to_translations.get(label.get_text(), label.get_text()

but I understand now.

label.get_text() is the "value" and we are searching values_to_translations for a mapping. But if that mapping doesn't exist (like with 'other' or a custom mode or something) then it defaults to the raw value

color = color.map({True: 'green', False: 'red'})
objects = ('Energy Savings', 'Energy Loss')

y_labels = y
y_labels = y.map(values_to_translations)
Copy link
Contributor

Choose a reason for hiding this comment

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

I was confused by y.map until I realized y is a Series

Copy link
Contributor

Choose a reason for hiding this comment

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

follow-up question: What happens if one of the translations is missing? Is there potential for that to happen here or other places we do the mapping like this?
If so, could do y.map(lambda x: values_to_translations.get(x, x))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good catch!
I have incorporated the fall back in other places where we do mapping like this, where we fall back to pick up the raw value whenever translations is unavailable.
E.g. values_to_translations.get(label, label)
I have incorporated this change for both energy_impact and CO2_impact plots.

iantei added 2 commits January 8, 2025 16:35
…exist for mapping to y in CO2_impact and energy_impact plot creation in plots.py.
@iantei
Copy link
Contributor Author

iantei commented Jan 9, 2025

Testing Scenario:

Dataset used: cortezebikes

Detailed execution of generic_metrics notebook and energy_calculations notebook (Since only these two notebooks were changed after the resolution of merge conflict and last commit 7ebc129 ):

(emission) root@a7b610a4a1fa:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py generic_metrics.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T23:47:29.623088+00:00 with args Namespace(plot_notebook='generic_metrics.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T23:47:29.655419+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('include_test_users', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True), Parameter('sensed_algo_prefix', str, value='cleaned'), Parameter('survey_info', dict, value={'surveys': {'UserProfileSurvey': {'formPath': 'json/demo-survey-v2.json', 'version': 1, 'compatibleWith': 1, 'dataKey': 'manual/demographic_survey', 'labelTemplate': {'en': 'Answered', 'es': 'Contestada'}}}, 'trip-labels': 'MULTILABEL'})]

(emission) root@a7b610a4a1fa:/usr/src/app/saved-notebooks# PYTHONPATH=.. python bin/generate_plots.py energy_calculations.ipynb default
/usr/src/app/saved-notebooks/bin/generate_plots.py:31: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if r.status_code is not 200:
About to download config from https://raw.githubusercontent.com/e-mission/nrel-openpath-deploy-configs/main/configs/cortezebikes.nrel-op.json
Successfully downloaded config with version 1 for Cortez 55+ eBike Program and data collection URL https://cortezebikes-openpath.nrel.gov/api/
Labels loading was successful for nrel-openpath-deploy-configs: cortezebikes
Running at 2025-01-08T23:51:36.051002+00:00 with args Namespace(plot_notebook='energy_calculations.ipynb', program='default', date=None) for range (<Arrow [2023-06-01T00:00:00+00:00]>, <Arrow [2025-01-01T00:00:00+00:00]>)
Running at 2025-01-08T23:51:36.085086+00:00 with params [Parameter('year', int), Parameter('month', int), Parameter('program', str, value='default'), Parameter('study_type', str, value='program'), Parameter('mode_of_interest', str, value='e-bike'), Parameter('include_test_users', bool, value=False), Parameter('is_debug_mode', bool, value=False), Parameter('labels', dict, value={'MODE': [{'value': 'walk', 'base_mode': 'WALKING'}, {'value': 'e-bike', 'base_mode': 'E_BIKE'}, {'value': 'bike', 'base_mode': 'BICYCLING'}, {'value': 'bikeshare', 'base_mode': 'BICYCLING'}, {'value': 'scootershare', 'base_mode': 'E_SCOOTER'}, {'value': 'drove_alone', 'base_mode': 'CAR', 'passengers': 1}, {'value': 'shared_ride', 'base_mode': 'CAR', 'passengers': 2}, {'value': 'hybrid_drove_alone', 'base_mode': 'PHEV_CAR', 'passengers': 1}, {'value': 'hybrid_shared_ride', 'base_mode': 'PHEV_CAR', 'passengers': 2}, {'value': 'e_car_drove_alone', 'base_mode': 'E_CAR', 'passengers': 1}, {'value': 'e_car_shared_ride', 'base_mode': 'E_CAR', 'passengers': 2}, {'value': 'taxi', 'base_mode': 'TAXI'}, {'value': 'bus', 'base_mode': 'BUS'}, {'value': 'train', 'base_mode': 'TRAIN'}, {'value': 'free_shuttle', 'base_mode': 'BUS'}, {'value': 'air', 'base_mode': 'AIR'}, {'value': 'not_a_trip', 'base_mode': 'UNKNOWN'}, {'value': 'other', 'base_mode': 'OTHER'}], 'PURPOSE': [{'value': 'home'}, {'value': 'work'}, {'value': 'at_work'}, {'value': 'school'}, {'value': 'transit_transfer'}, {'value': 'shopping'}, {'value': 'meal'}, {'value': 'pick_drop_person'}, {'value': 'pick_drop_item'}, {'value': 'personal_med'}, {'value': 'access_recreation'}, {'value': 'exercise'}, {'value': 'entertainment'}, {'value': 'religious'}, {'value': 'other'}], 'REPLACED_MODE': [{'value': 'no_travel'}, {'value': 'walk'}, {'value': 'bike'}, {'value': 'bikeshare'}, {'value': 'scootershare'}, {'value': 'drove_alone'}, {'value': 'shared_ride'}, {'value': 'hybrid_drove_alone'}, {'value': 'hybrid_shared_ride'}, {'value': 'e_car_drove_alone'}, {'value': 'e_car_shared_ride'}, {'value': 'taxi'}, {'value': 'bus'}, {'value': 'train'}, {'value': 'free_shuttle'}, {'value': 'other'}], 'translations': {'en': {'walk': 'Walk', 'e-bike': 'E-bike', 'bike': 'Regular Bike', 'bikeshare': 'Bikeshare', 'scootershare': 'Scooter share', 'drove_alone': 'Gas Car Drove Alone', 'shared_ride': 'Gas Car Shared Ride', 'hybrid_drove_alone': 'Hybrid Drove Alone', 'hybrid_shared_ride': 'Hybrid Shared Ride', 'e_car_drove_alone': 'E-Car Drove Alone', 'e_car_shared_ride': 'E-Car Shared Ride', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Bus', 'train': 'Train', 'free_shuttle': 'Free Shuttle', 'air': 'Air', 'not_a_trip': 'Not a trip', 'no_travel': 'No travel', 'home': 'Home', 'work': 'To Work', 'at_work': 'At Work', 'school': 'School', 'transit_transfer': 'Transit transfer', 'shopping': 'Shopping', 'meal': 'Meal', 'pick_drop_person': 'Pick-up / Drop off Person', 'pick_drop_item': 'Pick-up / Drop off Item', 'personal_med': 'Personal / Medical', 'access_recreation': 'Access Recreation', 'exercise': 'Recreation / Exercise', 'entertainment': 'Entertainment / Social', 'religious': 'Religious', 'other': 'Other'}, 'es': {'walk': 'Caminando', 'e-bike': 'e-bicicleta', 'bike': 'Bicicleta', 'bikeshare': 'Bicicleta compartida', 'scootershare': 'Motoneta compartida', 'drove_alone': 'Coche de Gas, Condujo solo', 'shared_ride': 'Coche de Gas, Condujo con otros', 'hybrid_drove_alone': 'Coche Híbrido, Condujo solo', 'hybrid_shared_ride': 'Coche Híbrido, Condujo con otros', 'e_car_drove_alone': 'e-coche, Condujo solo', 'e_car_shared_ride': 'e-coche, Condujo con otros', 'taxi': 'Taxi / Uber / Lyft', 'bus': 'Autobús', 'train': 'Tren', 'free_shuttle': 'Colectivo gratuito', 'air': 'Avión', 'not_a_trip': 'No es un viaje', 'no_travel': 'No viajar', 'home': 'Casa', 'work': 'Trabajo', 'at_work': 'En el trabajo', 'school': 'Escuela', 'transit_transfer': 'Transbordo', 'shopping': 'Compras', 'meal': 'Comida', 'pick_drop_person': 'Recoger / Entregar Individuo', 'pick_drop_item': 'Recoger / Entregar Objeto', 'personal_med': 'Personal / Médico', 'access_recreation': 'Acceder a Recreación', 'exercise': 'Recreación / Ejercicio', 'entertainment': 'Entretenimiento / Social', 'religious': 'Religioso', 'other': 'Otros'}, 'lo': {'walk': 'ດ້ວຍການຍ່າງ', 'e-bike': 'ວຍລົດຈັກໄຟຟ້າ', 'bike': 'ລົດຖີບ', 'bikeshare': 'ດ້ວຍລົດຖີບທີ່ໃຫ້ເຊົ່າ', 'scootershare': 'ດ້ວຍລົດຈັກສະກູດເຕີ້ໃຫ້ເຊົ່າ ', 'drove_alone': 'ເດີນທາງ ດ້ວຍລົດໃຫ່ຍ ເຊີ່ງເປັນລົດທີ່ຂັບເອງ', 'shared_ride': 'ເດີນທາງດ້ວຍລົດໃຫ່ຍ ຮ່ວມກັບລົດຄົນອຶ່ນ', 'hybrid_drove_alone': 'ລົດປະສົມຂັບຄົນດຽວ', 'hybrid_shared_ride': 'ລົດປະສົມທີ່ໃຊ້ຮ່ວມກັນ', 'e_car_drove_alone': 'ດ້ວຍການຂັບລົດໄຟຟ້າໄປເອງ', 'e_car_shared_ride': 'ດ້ວຍການຈ້າງລົດໄຟຟ້າໄປ', 'taxi': 'ແທັກຊີ', 'bus': 'ລົດເມ', 'train': 'ລົດໄຟ', 'free_shuttle': 'ລົດຮັບສົ່ງຟຣີ', 'air': 'ຍົນ', 'not_a_trip': 'ບໍ່ແມ່ນການເດີນທາງ', 'no_travel': 'ບໍ່ມີການເດີນທາງ', 'home': 'ບ້ານ', 'work': 'ໄປເຮັດວຽກ', 'at_work': 'ຢູ່ບ່ອນເຮັດວຽກ', 'school': 'ໄປໂຮງຮຽນ', 'transit_transfer': 'ການຖ່າຍໂອນການເດີນທາງ', 'shopping': 'ຊອບປິ້ງ', 'meal': 'ອາຫານ', 'pick_drop_person': 'ໄປຮັບ ຫລື ສົນ ຄົນ', 'pick_drop_item': 'ໄປຮັບ ຫລື ສົ່ງສິນຄ້າ', 'personal_med': 'ໄປຫາໝໍ', 'access_recreation': 'ເຂົ້າເຖິງການພັກຜ່ອນ', 'exercise': 'ພັກຜ່ອນ/ອອກກຳລັງກາຍ', 'entertainment': 'ບັນເທີງ/ສັງຄົມ', 'religious': 'ຈຸດປະສົງທາງສາດສະໜາ', 'other': 'ອື່ນໆ'}}}), Parameter('use_imperial', bool, value=True)]

Result:

Cortezebikes Public Dashboard
Cortezebikes_subset

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PRs for review by peers
Development

Successfully merging this pull request may close these issues.

2 participants