Skip to content

Commit

Permalink
Merge pull request #2477 from data-for-change/dev
Browse files Browse the repository at this point in the history
merge dev into master
  • Loading branch information
atalyaalon authored Sep 20, 2023
2 parents 6680276 + d749600 commit 3a6fc50
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from anyway.widgets.road_segment_widgets.road_segment_widget import RoadSegmentWidget
from anyway.widgets.widget import register


@register
class KilledInjuredCountPerAgeGroupWidget(RoadSegmentWidget):
name: str = "killed_and_injured_count_per_age_group"
Expand All @@ -32,7 +31,6 @@ def generate_items(self) -> None:
count_total += count

structured_data_list.append({BE.LKEY: age_group, BE.VAL: count_total})

self.items = structured_data_list

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from flask_sqlalchemy import BaseQuery
from sqlalchemy import func, asc
from flask_babel import _

from anyway.app_and_db import db
from anyway.backend_constants import BE_CONST, InjurySeverity
Expand Down Expand Up @@ -80,10 +81,10 @@ def defaultdict_int_factory() -> Callable:

if not found_age_range:
dict_grouped[UNKNOWN][injury_id] += count

# Rename the last key
dict_grouped[SIXTY_FIVE_PLUS] = dict_grouped[SIXTY_TWOHUNDRED]
del dict_grouped[SIXTY_TWOHUNDRED]
dict_grouped[_("unknown")] = dict_grouped.pop(UNKNOWN)
return dict_grouped, has_data

@staticmethod
Expand Down Expand Up @@ -121,4 +122,4 @@ def create_query_for_killed_and_injured_count_per_age_group(
)
.order_by(asc(InvolvedMarkerView.age_group))
)
return query
return query
2 changes: 1 addition & 1 deletion babel.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension
extensions=jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension
encoding = utf-8
silent=0

Expand Down
2 changes: 1 addition & 1 deletion docs/Architecture/ARCHITECTURE_BUILDING_BLOCKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ When working on all processes - Pay attention to

Additional Repositories
------------------------------------------------
ANYWAY ETL Flows](https://github.com/hasadna/anyway-etl)
ANYWAY ETL Flows](https://github.com/data-for-change/anyway-etl)
Note: ANYWAY ETL Flows uses current repository code - to update ANYWAY ETL with most updated anyway code, the change needs to be introduced in a release of anyway-etl.


Expand Down
45 changes: 26 additions & 19 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-06-22 13:32+0000\n"
"POT-Creation-Date: 2023-09-14 15:58+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
"Generated-By: Babel 2.12.1\n"

#: anyway/backend_constants.py:148
msgid "killed"
Expand All @@ -29,11 +29,11 @@ msgstr ""
msgid "light injured"
msgstr ""

#: anyway/flask_app.py:678 anyway/flask_app.py:782
#: anyway/flask_app.py:682 anyway/flask_app.py:786
msgid "Discussion not found:"
msgstr ""

#: anyway/flask_app.py:681
#: anyway/flask_app.py:685
msgid "Illegal Discussion"
msgstr ""

Expand Down Expand Up @@ -263,7 +263,21 @@ msgid "Number of accidents by severity"
msgstr ""

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123
msgid "road_segment_namenon_urban_intersection_hebrew"
#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57
#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145
#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31
#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33
#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54
#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56
#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50
#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73
msgid "road_segment_name"
msgstr ""

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124
msgid "non_urban_intersection_hebrew"
msgstr ""

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129
Expand Down Expand Up @@ -407,19 +421,6 @@ msgstr ""
msgid "Accidents in segment"
msgstr ""

#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57
#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145
#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31
#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33
#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54
#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56
#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42
#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73
msgid "road_segment_name"
msgstr ""

#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63
msgid ""
"Fatal, severe and light accidents count in the specified years, split by "
Expand Down Expand Up @@ -580,7 +581,13 @@ msgstr ""
msgid "Killed and injury stacked per age group"
msgstr ""

#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91
msgid "unknown"
msgstr ""

#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49
msgid "Injury per age group"
msgstr ""

Expand Down
Binary file modified translations/he/LC_MESSAGES/messages.mo
Binary file not shown.
53 changes: 30 additions & 23 deletions translations/he/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-06-22 13:32+0000\n"
"POT-Creation-Date: 2023-09-14 15:58+0300\n"
"PO-Revision-Date: 2020-10-16 15:42+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: he\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
"Generated-By: Babel 2.12.1\n"

#: anyway/backend_constants.py:148
msgid "killed"
Expand All @@ -30,11 +30,11 @@ msgstr "ืคืฆื•ืข/ื” ืงืฉื”"
msgid "light injured"
msgstr "ืคืฆื•ืข/ื” ืงืœ"

#: anyway/flask_app.py:678 anyway/flask_app.py:782
#: anyway/flask_app.py:682 anyway/flask_app.py:786
msgid "Discussion not found:"
msgstr ""

#: anyway/flask_app.py:681
#: anyway/flask_app.py:685
msgid "Illegal Discussion"
msgstr ""

Expand Down Expand Up @@ -249,12 +249,9 @@ msgstr "ืชืื•ื ื•ืช"

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:109
#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:170
msgid "out of them"
msgstr "ืžืชื•ื›ืŸ"

#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:121
msgid "out of them"
msgstr "ืžืชื•ื›ื"
msgstr "ืžืชื•ื›ืŸ"

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:113
#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:172
Expand All @@ -267,7 +264,21 @@ msgid "Number of accidents by severity"
msgstr "ืžืกืคืจ ืชืื•ื ื•ืช ืœืคื™ ื—ื•ืžืจื”"

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123
msgid "road_segment_namenon_urban_intersection_hebrew"
#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57
#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145
#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31
#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33
#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54
#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56
#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50
#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73
msgid "road_segment_name"
msgstr ""

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124
msgid "non_urban_intersection_hebrew"
msgstr ""

#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129
Expand Down Expand Up @@ -417,19 +428,6 @@ msgstr ""
msgid "Accidents in segment"
msgstr "ืชืื•ื ื•ืช ื‘ืžืงื˜ืข"

#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57
#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145
#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31
#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33
#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54
#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56
#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42
#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73
msgid "road_segment_name"
msgstr ""

#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63
msgid ""
"Fatal, severe and light accidents count in the specified years, split by "
Expand Down Expand Up @@ -599,7 +597,13 @@ msgstr "ืžืกืคืจ ืชืื•ื ื•ืช ืœืคื™ ื—ื•ืžืจื”"
msgid "Killed and injury stacked per age group"
msgstr "ื—ื•ืžืจืช ืคื’ื™ืขื” ืœืคื™ ืงื‘ื•ืฆืช ื’ื™ืœ"

#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87
#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91
msgid "unknown"
msgstr "ืœื ื™ื“ื•ืข"

#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49
msgid "Injury per age group"
msgstr "ื ืคื’ืขื™ื ืœืคื™ ืงื‘ื•ืฆืช ื’ื™ืœ"

Expand Down Expand Up @@ -809,3 +813,6 @@ msgstr ""
#~ msgid "on street"
#~ msgstr "ื‘ืจื—ื•ื‘"

#~ msgid "road_segment_namenon_urban_intersection_hebrew"
#~ msgstr ""

0 comments on commit 3a6fc50

Please sign in to comment.