e-mission / em-public-dashboard

A simple and stupid public dashboard prototype.
BSD 3-Clause "New" or "Revised" License
0 stars 23 forks source link

Refactor footprint changes #167

Open iantei opened 1 month ago

iantei commented 1 month ago

Handle Future cleanups mentioned in #152 Changes:

  1. Introduce better exception logging

    future fix: I would suggest logging what the exception was (ideally using logging.exception) so that we can check and fix as needed. We may also want to add an entry into the client stats of how many trips were affected. This will allow us to check on why the builds are failing
  2. Type fixed from relecant to relevant.

  3. Refactor extract_co2 and extract_kwh to a single consolidated parameterized function extract_footprint()

    future fix: it seems like this should be combinable into a single parameterized function
  4. Changed the labels for Stacked Bar Chart's Inferred label from "Labeled and Inferred by OpenPATH" to "Inferred from prior labels"

    future fix: I think I flagged this somewhere else, but it would be good to change this to "inferred from prior labels" here because there are multiple inference algorithms in OpenPATH
iantei commented 1 month ago

Testing Scenario:

Dataset used: cortezebikes

Execution of notebooks- generic_metrics, mode_specific_metrics - to lookup for inferred label changes energy_calculations - to lookup for footprint calculation changes

Detailed Execution of notebooks using generate_plots.py script

``` (emission) root@31c91ddf8794:/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-11T20:12:14.132517+00:00 with args Namespace(plot_notebook='generic_metrics.ipynb', program='default', date=None) for range (, ) Running at 2024-10-11T20:12:14.172297+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-11T20:12:24.509729+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'})] Running at 2024-10-11T20:12:31.283995+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'), 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-11T20:12:38.615102+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=8), 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-11T20:12:45.967215+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=9), 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-11T20:12:53.272719+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=10), 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-11T20:13:00.616589+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=11), 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-11T20:13:07.474202+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=12), 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-11T20:13:14.436243+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=1), 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-11T20:13:20.742465+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=2), 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-11T20:13:27.058960+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=3), 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-11T20:13:32.466903+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=4), 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-11T20:13:37.850492+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=5), 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-11T20:13:43.130289+00:00 with params [Parameter('year', int, value=2024), 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'})] Running at 2024-10-11T20:13:48.653394+00:00 with params [Parameter('year', int, value=2024), 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'), 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-11T20:13:53.974055+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=8), 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-11T20:13:59.467121+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=9), 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-11T20:14:04.991671+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=10), 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@31c91ddf8794:/usr/src/app/saved-notebooks# (emission) root@31c91ddf8794:/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-11T20:14:43.716544+00:00 with args Namespace(plot_notebook='mode_specific_metrics.ipynb', program='default', date=None) for range (, ) Running at 2024-10-11T20:14:43.753000+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-11T20:14:50.994066+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)] Running at 2024-10-11T20:14:56.255125+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('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-11T20:15:01.821568+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=8), 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-11T20:15:07.079884+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=9), 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-11T20:15:12.496401+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=10), 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-11T20:15:17.846748+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=11), 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-11T20:15:22.654577+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=12), 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-11T20:15:26.979411+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=1), 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-11T20:15:31.839309+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=2), 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-11T20:15:36.648695+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=3), 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-11T20:15:40.951585+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=4), 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-11T20:15:45.208036+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=5), 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-11T20:15:49.401527+00:00 with params [Parameter('year', int, value=2024), 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)] Running at 2024-10-11T20:15:53.630460+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=7), 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-11T20:15:57.848482+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=8), 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-11T20:16:02.359828+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=9), 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-11T20:16:06.632476+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=10), 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@31c91ddf8794:/usr/src/app/saved-notebooks# (emission) root@31c91ddf8794:/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-11T20:21:21.321738+00:00 with args Namespace(plot_notebook='energy_calculations.ipynb', program='default', date=None) for range (, ) Running at 2024-10-11T20:21:21.361600+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-11T20:21:47.155261+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)] Running at 2024-10-11T20:21:55.382353+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('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-11T20:22:04.384330+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=8), 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-11T20:22:11.270368+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=9), 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-11T20:22:19.210182+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=10), 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-11T20:22:25.217748+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=11), 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-11T20:22:28.570007+00:00 with params [Parameter('year', int, value=2023), Parameter('month', int, value=12), 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-11T20:22:31.937802+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=1), 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-11T20:22:34.772511+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=2), 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-11T20:22:37.531869+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=3), 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-11T20:22:40.265116+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=4), 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-11T20:22:43.069850+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=5), 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-11T20:22:46.007959+00:00 with params [Parameter('year', int, value=2024), 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)] Running at 2024-10-11T20:22:48.782695+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=7), 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-11T20:22:51.506007+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=8), 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-11T20:22:54.223285+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=9), 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-11T20:22:56.942991+00:00 with params [Parameter('year', int, value=2024), Parameter('month', int, value=10), 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)] (emission) root@31c91ddf8794:/usr/src/app/saved-notebooks# ```

Results:

Charts for cortezebike:
Screenshot 2024-10-11 at 1 31 41 PM
Screenshot 2024-10-11 at 1 33 57 PM

Note: Everything looks good

iantei commented 1 month ago

Fix for the following:

https://github.com/e-mission/em-public-dashboard/issues/140

Use base_mode to filter out the AIR related trips.

Results:

Before (Using internal label) After (Using base mode)
internal label base_mode

Looks identical