Skip to content

Commit

Permalink
Merge pull request #53 from nextstrain/victorlin/fix-typos-in-apply-g…
Browse files Browse the repository at this point in the history
…eolocation-rules

Fix typos in `apply-geolocation-rules`
  • Loading branch information
corneliusroemer authored Jun 20, 2022
2 parents f534e56 + 2f86079 commit c236e5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ingest/bin/apply-geolocation-rules
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_annotated_geolocation(geolocation_rules, raw_geolocation, rule_traversal
Gets the annotated geolocation for the *raw_geolocation* in the provided
*geolocation_rules*.
Recursivley traverses the *geolocation_rules* until we get the annotated
Recursively traverses the *geolocation_rules* until we get the annotated
geolocation, which must be a Tuple. Returns `None` if there are no
applicable rules for the provided *raw_geolocation*.
Expand Down Expand Up @@ -105,8 +105,8 @@ def get_annotated_geolocation(geolocation_rules, raw_geolocation, rule_traversal
# We've reach the next level of geolocation rules,
# so try to traverse the rules with the next target in raw_geolocation
if isinstance(current_rules, dict):
next_traveral_target = raw_geolocation[len(rule_traversal)]
rule_traversal.append(next_traveral_target)
next_traversal_target = raw_geolocation[len(rule_traversal)]
rule_traversal.append(next_traversal_target)
return get_annotated_geolocation(geolocation_rules, raw_geolocation, rule_traversal)

# We did not find any matching rule for the last traversal target
Expand Down Expand Up @@ -199,7 +199,7 @@ if __name__ == '__main__':
parser.add_argument("--geolocation-rules", metavar="TSV", required=True,
help="TSV file of geolocation rules with the format: " +
"'<raw_geolocation><tab><annotated_geolocation>' where the raw and annotated geolocations " +
"are formated as '<region>/<country>/<division>/<location>'. " +
"are formatted as '<region>/<country>/<division>/<location>'. " +
"If creating a general rule, then the raw field value can be substituted with '*'." +
"Lines starting with '#' will be ignored as comments." +
"Trailing '#' will be ignored as comments.")
Expand Down

0 comments on commit c236e5f

Please sign in to comment.