Skip to content

Fixed epivis geo_value processing for geo levels != state, nation #10

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 1 commit into from
May 5, 2025
Merged
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
61 changes: 48 additions & 13 deletions src/indicatorsets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,49 @@ def get_related_indicators(self, queryset, indicator_set_ids: list):
related_indicators.append(
{
"id": indicator.id,
"display_name": indicator.get_display_name if indicator.get_display_name else "",
"member_name": indicator.member_name if indicator.member_name else "",
"member_short_name": indicator.member_short_name if indicator.member_short_name else "",
"display_name": (
indicator.get_display_name if indicator.get_display_name else ""
),
"member_name": (
indicator.member_name if indicator.member_name else ""
),
"member_short_name": (
indicator.member_short_name
if indicator.member_short_name
else ""
),
"name": indicator.name if indicator.name else "",
"indicator_set": indicator.indicator_set.id if indicator.indicator_set else "",
"indicator_set_name": indicator.indicator_set.name if indicator.indicator_set else "",
"indicator_set_short_name": indicator.indicator_set.short_name if indicator.indicator_set else "",
"endpoint": indicator.indicator_set.epidata_endpoint if indicator.indicator_set else "",
"indicator_set": (
indicator.indicator_set.id if indicator.indicator_set else ""
),
"indicator_set_name": (
indicator.indicator_set.name if indicator.indicator_set else ""
),
"indicator_set_short_name": (
indicator.indicator_set.short_name
if indicator.indicator_set
else ""
),
"endpoint": (
indicator.indicator_set.epidata_endpoint
if indicator.indicator_set
else ""
),
"source": indicator.source.name if indicator.source else "",
"time_type": indicator.time_type if indicator.time_type else "",
"description": indicator.description if indicator.description else "",
"member_description": indicator.member_description if indicator.member_description else indicator.description,
"restricted": indicator.indicator_set.dua_required if indicator.indicator_set else "",
"description": (
indicator.description if indicator.description else ""
),
"member_description": (
indicator.member_description
if indicator.member_description
else indicator.description
),
"restricted": (
indicator.indicator_set.dua_required
if indicator.indicator_set
else ""
),
"source_type": indicator.source_type,
}
)
Expand All @@ -111,7 +141,9 @@ def get_url_params(self):
if self.request.GET.get("severity_pyramid_rungs")
else ""
),
"original_data_provider": [el for el in self.request.GET.getlist("original_data_provider")],
"original_data_provider": [
el for el in self.request.GET.getlist("original_data_provider")
],
"temporal_granularity": (
[el for el in self.request.GET.getlist("temporal_granularity")]
if self.request.GET.get("temporal_granularity")
Expand Down Expand Up @@ -186,8 +218,11 @@ def epivis(request):
for indicator in indicators:
if indicator["_endpoint"] == "covidcast":
for geo in covidcast_geos:
if geo["geoType"] in ["nation", "state"]:
geo_value = geo["id"].lower()
geo_value = (
geo["id"].lower()
if geo["geoType"] in ["nation", "state"]
else geo["id"]
)
datasets.append(
{
"color": generate_random_color(),
Expand Down
Loading