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

merge dev into master #2660

Merged
merged 10 commits into from
Jun 5, 2024
1 change: 1 addition & 0 deletions anyway/scripts/accidents_around_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
python accidents_around_location.py <input_file> [flags]

"""

import argparse
import io
from datetime import datetime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions anyway/widgets/urban_widgets/urban_crosswalk_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading