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

apply-geolocation-rules: Rule matching should be case-insensitive #1738

Closed
joverlee521 opened this issue Jan 28, 2025 · 1 comment · Fixed by #1740
Closed

apply-geolocation-rules: Rule matching should be case-insensitive #1738

joverlee521 opened this issue Jan 28, 2025 · 1 comment · Fixed by #1740
Assignees
Labels
enhancement New feature or request

Comments

@joverlee521
Copy link
Contributor

Context

I recently added an geolocation rule in nextstrain/avian-flu#121 that I was surprised was not already included in the "central" geolocation rules in ncov-ingest. While auditing the "central" rules for #1488, I realized that this was due to the different string casing of the rules.

North America/USA/Ca/* vs North America/USA/CA/*

The raw location matching should be case-insensitive so that we don't have to maintain rules for the different string casings.

Side note, my recent experience with fauna has made me wary of case-insensitive location matching, but it should be fine here because we do a hierarchical location match.

@joverlee521 joverlee521 added the enhancement New feature or request label Jan 28, 2025
@joverlee521 joverlee521 self-assigned this Jan 28, 2025
@jameshadfield
Copy link
Member

👍 lowercase is what we use for geo matching in export too:

augur/augur/export_v2.py

Lines 512 to 520 in 73f1fa9

for deme in trait_values: # note: deme may be numeric, or string
try:
deme_search_value = deme.lower()
except AttributeError:
deme_search_value = str(deme)
try:
deme_to_lat_longs[deme] = lat_long_mapping[(trait_info["key"].lower(), deme_search_value)]
except KeyError:
warn("{}->{} did not have an associated lat/long value (matching performed in lower case). Auspice won't be able to display this location.".format(trait_info["key"], deme))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants