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

Schema updates #727

Merged
merged 3 commits into from
Jun 14, 2021
Merged

Schema updates #727

merged 3 commits into from
Jun 14, 2021

Conversation

jameshadfield
Copy link
Member

Updates augur export v2 and the relevant schemas to allow us to use features introduced in Auspice v2.26.0.

See commit messages for more details.

@jameshadfield jameshadfield requested a review from a team May 27, 2021 03:57
@codecov
Copy link

codecov bot commented May 27, 2021

Codecov Report

Merging #727 (73649be) into master (15dfc8b) will increase coverage by 1.12%.
The diff coverage is 2.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #727      +/-   ##
==========================================
+ Coverage   31.51%   32.63%   +1.12%     
==========================================
  Files          41       41              
  Lines        5674     5972     +298     
  Branches     1373     1487     +114     
==========================================
+ Hits         1788     1949     +161     
- Misses       3812     3942     +130     
- Partials       74       81       +7     
Impacted Files Coverage Δ
augur/export_v2.py 11.07% <2.94%> (-0.43%) ⬇️
augur/distance.py 50.97% <0.00%> (+5.08%) ⬆️
augur/utils.py 47.43% <0.00%> (+6.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15dfc8b...73649be. Read the comment docs.

Copy link
Contributor

@huddlej huddlej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, @jameshadfield. I made a few clarifying comments inline, but we could probably just merge this as is, if you like.

It might be nice to add some minimal doctests to the new functions before merging even if it's just to get the practice of implementing tests in this module. We can chat about this offline though.

augur/export_v2.py Outdated Show resolved Hide resolved
augur/export_v2.py Outdated Show resolved Hide resolved
augur/export_v2.py Show resolved Hide resolved
augur/export_v2.py Show resolved Hide resolved
augur/data/schema-export-v2.json Show resolved Hide resolved
These updates allow specification of custom legend info via the auspice
config JSON which is schema-validated and exported. This functionality
is utilised by auspice 2.26.0 (see
nextstrain/auspice#1340 for more).
Auspice 2.26.0 can now use custom colors for continuous scales via the
`scale` property on such a coloring; previously custom colors were only
available for discrete scales (see
nextstrain/auspice#1340 for more).

Here we extend the schema for the auspice config JSON and update
`augur export` to allow export of such scale information for continuous
colorings.

Previously, scale information (for discrete scales) could only come from
a colors TSV file supplied via `augur export --colors <TSV>`. We now
allow this to be specified in the auspice config JSON, and use this
information preferentially over the TSV.
This sets up a template for testing `augur export v2` which is
rather complex in the different ways it can be called. The tests here
are only intended to cover features introduced by this PR.
Copy link
Contributor

@huddlej huddlej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks excellent, @jameshadfield. The new tests helped me understand this PR, but they also provide great documentation for the future. The mocked up tree data is especially handy for similar types of tests in the future.

Comment on lines +20 to +29
"legend": [
{"value": 1, "display": "0-2", "bounds": [-1,2]},
{"value": 3, "display": "3-5", "bounds": [2,5]},
{"value": 5, "display": ">5", "bounds": [5, 10]}
],
"scale": [
[1, "#081d58"],
[3, "#1d91c0"],
[5, "#c7e9b4"]
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really helpful documentation of how to use these new features! I will probably refer to these tests as I learn how to use these features.

@huddlej huddlej added this to the Feature release 12.1.0 milestone Jun 14, 2021
@huddlej huddlej merged commit 52b0ccb into master Jun 14, 2021
@huddlej huddlej deleted the schema-updates branch June 14, 2021 22:34
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.

2 participants