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

Composable auspice config #1756

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jameshadfield
Copy link
Member

Work in progress

Closes #298

This centralises deprecated keys rather than scattering them through
the `export_v2.py` code. This makes the export code easier to follow
and is a pre-requisite for (upcoming) config file overlays/merging.

At least two unreported bugs were fixed:
1. 'maintainer' (deprecated) would be used instead of 'maintainers'
2. 'color_options' - any option which used a 'legendTitle' but not a
   'menuTitle' would trigger an uncaught `KeyError`
The move from v1 to v2 auspice configs remapped both the top-level key
'defaults' as well as keys within config['defaults']. The previous code
attempted to remap deprecated (2nd-level) keys within config['defaults']
as well as within config['display_defaults'] however the latter wasn't
intended and wouldn't be allowed as the config['display_defaults']
structure would have failed validation prior to this remapping.

Here we restore the intended behaviour which updates the structure of
config['defaults'], as needed, at the time we move this deprecated
structure to the (now current) config['display_defaults']
There are a huge number of modifications and special-casing around
'author[s]' and 'numdate'/'num_date'.

If author or temporal information is set on the metadata / node-data
JSONs (under "author" or "authors", "numdate" or "num_date") we'll
always export it on nodes in the tree. This means the need to specify
author[s] or numdate/num_date in "metadata columns" is a no-op and we
can simplify things by filtering them all out.

For colorings we preserve the existing behaviour of renaming "authors"
to "author".

Making sense of all these remappings is hard with the current code. One
simplification would be to move the command-line parsing into the
`read_auspice_config` function and generate a unified config structure
ahead of time, but for now i'm only focusing on the config JSON.
@jameshadfield jameshadfield force-pushed the james/composable-auspice-config-298 branch from 0c4004e to 5a162fa Compare February 13, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement composable auspice config file for augur export v2
1 participant