Skip to content

Update dependencies #873

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

Merged
merged 5 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
- topics: rework road topics ([#878], [#880])
- topics: remove covid19 related tags from topics ([#882])

### Other Changes

- build: update dependencies ([#873])

[#873]: https://github.com/GIScience/ohsome-quality-api/pull/873
[#878]: https://github.com/GIScience/ohsome-quality-api/issues/878
[#880]: https://github.com/GIScience/ohsome-quality-api/issues/880
[#882]: https://github.com/GIScience/ohsome-quality-api/issues/882
Expand All @@ -22,7 +26,6 @@
- attribute-completeness: added subkeys to filters for sidewalk and cycleway attributes ([#877])
- attribute-completeness: added new topic and topic - specific attributes and deleted non-functional attributes ([#850])


[#850]: https://github.com/GIScience/ohsome-quality-api/issue/850
[#877]: https://github.com/GIScience/ohsome-quality-api/issue/877

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ def compute_units_for_all_and_matched(self):
all = f"{int(self.absolute_value_1)} elements"
matched = f"{int(self.absolute_value_2)} elements"
elif self.topic.aggregation_type == "area":
all = f"{str(round(self.absolute_value_1/1000000, 2))} km²"
matched = f"{str(round(self.absolute_value_2/1000000, 2))} km²"
all = f"{str(round(self.absolute_value_1 / 1000000, 2))} km²"
matched = f"{str(round(self.absolute_value_2 / 1000000, 2))} km²"
elif self.topic.aggregation_type == "length":
all = f"{str(round(self.absolute_value_1/1000, 2))} km"
matched = f"{str(round(self.absolute_value_2/1000, 2))} km"
all = f"{str(round(self.absolute_value_1 / 1000, 2))} km"
matched = f"{str(round(self.absolute_value_2 / 1000, 2))} km"
else:
raise ValueError("Invalid aggregation_type")
return all, matched
11 changes: 7 additions & 4 deletions ohsome_quality_api/indicators/road_comparison/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def calculate(self) -> None:
self.result.description += self.warnings[key] + "\n"
self.result.description += (
f"{self.data_ref[key]['name']} has a road length of "
f"{(self.length_total[key]/1000):.2f} km, of which "
f"{(self.length_matched[key]/1000):.2f} km are covered by roads in "
f"{(self.length_total[key] / 1000):.2f} km, of which "
f"{(self.length_matched[key] / 1000):.2f} km are covered by roads in "
f"OSM. "
)

Expand Down Expand Up @@ -169,6 +169,10 @@ def create_figure(self) -> None:
for i, (name, ratio, date) in enumerate(
zip(ref_name, ref_ratio, ref_processingdate)
):
hovertext = (
f"OSM Covered: {(self.length_matched[name] / 1000):.2f} km "
+ f"({date:%b %d, %Y})"
)
fig.add_trace(
pgo.Bar(
x=[name],
Expand All @@ -179,8 +183,7 @@ def create_figure(self) -> None:
line=dict(color=Color.GREY.value, width=1),
),
width=0.4,
hovertext=f"OSM Covered: {(self.length_matched[name]/1000):.2f} km"
f" ({date:%b %d, %Y})",
hovertext=hovertext,
hoverinfo="text",
)
)
Expand Down
Loading