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

curate apply-geolocation-rules: Allow rule overrides #1648

Closed
joverlee521 opened this issue Oct 3, 2024 · 2 comments · Fixed by #1745
Closed

curate apply-geolocation-rules: Allow rule overrides #1648

joverlee521 opened this issue Oct 3, 2024 · 2 comments · Fixed by #1745
Assignees
Labels
enhancement New feature or request

Comments

@joverlee521
Copy link
Contributor

Context

augur curate apply-geolocation-rules currently only takes one set of geolocation rules without any concept of priority. If there any of the rules overwrite each other, then the command eventually raises a CyclicGeolocationRulesError.

As @jameshadfield commented:

If we're going to continue with the pattern of a master-list plus some repo-specific additions it'd be nice if those additions could function as overrides. I.e. if the master list replaces X with Y, we could add an override of Y to X (or Y to Z etc) in a repo-specific manner.

This aligns with the plan to create a curated standard list of geolocation rules that users can override with their own rules.

Possible solution

We can add an optional arg to the command that expects a separate file of "prioritized" rules. If provided, the prioritized rules will be applied to the records first. If none of the prioritized rule are applied, then the general rules are applied.

Cyclic rules within each rule set should still be considered a user error and raise an error. However, cyclic rules do not have to be checked between the two sets of rules to allow the prioritized rules to override any of the general rules.

@joverlee521 joverlee521 added the enhancement New feature or request label Oct 3, 2024
@joverlee521
Copy link
Contributor Author

@kimandrews ran into the CyclicGeolocationRulesError again when trying to change the French Guiana location from Europe/France to South America/French Guiana for rabies.

Working around this by changing to South America/French Guiana (France) so that the rules are no longer cyclical.

@joverlee521
Copy link
Contributor Author

Thinking on this some more, I'm not sure we should have a separate "prioritized" flag. This is only needed because we don't have default geolocation rules already. Ideally, the --geolocation-rules option should provide the pathogen repo specific geolocation rules that override the default geolocation rules in Augur.

I think the "correct" thing to do here is

  1. Add the standard geolocation rules to augur
  2. Then update the --geolocation-rules to be optional and clarify in the help text that these are prioritized rules that would override the defaults in Augur.

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.

1 participant