diff --git a/anyway/scripts/accidents_around_location.py b/anyway/scripts/accidents_around_location.py index 8cdc42103..356be4c5a 100644 --- a/anyway/scripts/accidents_around_location.py +++ b/anyway/scripts/accidents_around_location.py @@ -5,6 +5,7 @@ python accidents_around_location.py [flags] """ + import argparse import io from datetime import datetime diff --git a/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py index d3332e649..f0b9d8803 100644 --- a/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -38,9 +38,9 @@ def filter_and_group_injured_count_per_age_group( cache_key = None # prevent pylint warning if request_params.resolution == BE_CONST.ResolutionCategories.STREET: - involve_yishuv_name = request_params.location_info["yishuv_name"] + accident_yishuv_name = request_params.location_info["yishuv_name"] street1_hebrew = request_params.location_info["street1_hebrew"] - cache_key = (involve_yishuv_name, street1_hebrew, start_time, end_time) + cache_key = (accident_yishuv_name, street1_hebrew, start_time, end_time) elif request_params.resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD: road_number = request_params.location_info["road1"] diff --git a/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py b/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py index b60f064c0..2766aeac5 100644 --- a/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py +++ b/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py @@ -39,7 +39,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.ELECTRIC_BIKE.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", @@ -55,7 +55,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.BIKE.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", @@ -71,7 +71,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.ELECTRIC_SCOOTER.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", diff --git a/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py b/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py index 38a6ac861..a4b951afc 100644 --- a/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py +++ b/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py @@ -37,7 +37,7 @@ def get_motor_stats(location_info, start_time, end_time, resolution): InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleCategory.BICYCLE_AND_SMALL_MOTOR.get_codes(), - "involve_yishuv_name": location_info, + "accident_yishuv_name": location_info, }, group_by="accident_year", count="accident_year", diff --git a/anyway/widgets/urban_widgets/urban_crosswalk_widget.py b/anyway/widgets/urban_widgets/urban_crosswalk_widget.py index c83e08747..69ddd532b 100644 --- a/anyway/widgets/urban_widgets/urban_crosswalk_widget.py +++ b/anyway/widgets/urban_widgets/urban_crosswalk_widget.py @@ -39,7 +39,7 @@ def get_crosswalk(yishuv, street, start_time, end_time, resolution) -> Dict[str, InjurySeverity.SEVERE_INJURED.value, ], "cross_location": CrossCategory.CROSSWALK.get_codes(), - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, "street1_hebrew": street, }, group_by="street1_hebrew", @@ -56,7 +56,7 @@ def get_crosswalk(yishuv, street, start_time, end_time, resolution) -> Dict[str, InjurySeverity.SEVERE_INJURED.value, ], "cross_location": CrossCategory.NONE.get_codes(), - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, "street1_hebrew": street, }, group_by="street1_hebrew", diff --git a/anyway/widgets/widget_utils.py b/anyway/widgets/widget_utils.py index 0d5046ebd..75a133689 100644 --- a/anyway/widgets/widget_utils.py +++ b/anyway/widgets/widget_utils.py @@ -201,7 +201,7 @@ def get_involved_marker_view_location_filters( ): filters = {} if resolution == BE_CONST.ResolutionCategories.STREET: - filters["involve_yishuv_name"] = location_info.get("yishuv_name") + filters["accident_yishuv_name"] = location_info.get("yishuv_name") filters["street1_hebrew"] = location_info.get("street1_hebrew") elif resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD: filters["road1"] = location_info.get("road1") diff --git a/requirements.txt b/requirements.txt index a991b37b3..2b63ecdcb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ Flask-Compress==1.5.0 Flask-Login==0.5.0 Flask-SQLAlchemy==2.4.1 flask-restx==0.5.1 -Jinja2==3.0.3 +Jinja2==3.1.4 SQLAlchemy==1.3.17 Werkzeug==2.0.3 alembic==1.4.2 @@ -27,7 +27,7 @@ google-cloud-storage==1.28.1 google-cloud-translate==2.0.1 googlemaps==4.4.0 graphene-sqlalchemy==2.2.2 -gunicorn==20.0.4 +gunicorn==22.0.0 newrelic==5.12.1.141 numpy==1.18.4 openpyxl==3.0.3 @@ -48,7 +48,7 @@ boto3==1.17.68 py3-validate-email==0.2.16 phonenumbers==8.12.21 flask-principal==0.4.0 -pydantic==1.8.2 +pydantic==1.10.13 swifter==1.3.4 telebot==0.0.5 selenium==4.11.2 diff --git a/test_requirements.txt b/test_requirements.txt index 80a38d01f..ec01ff92b 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,4 @@ -black==23.3.0 +black==24.3.0 pytest==7.4.1 pytest-cov==4.1.0 py==1.11.0