Skip to content

Commit

Permalink
schemas: Update display_defaults.branch_label for Auspice v2 config a…
Browse files Browse the repository at this point in the history
…nd dataset

Reconciles the two schemas with some minor improvements + a bug fix.
While the enum values in one schema were valid, they're not the _only_
valid values.

This display_default refers to the keys of branch_attr.labels objects on
nodes, so I reused the former's pattern of allowed characters.  I think
that pattern may be too restrictive and not accurately describe what
Auspice will handle, but that's a broader issue with other parts of the
schema too and something to investigate for another day.

Hint that there's a special-cased value ("none") by mentioning it
explicitly in the pattern.
  • Loading branch information
tsibley committed May 12, 2022
1 parent fe92b82 commit 65ebea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion augur/data/schema-auspice-config-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@
"enum": ["rect", "radial", "unrooted", "clock"]
},
"branch_label": {
"description": "What branch label should be displayed by default, or 'none' to hide labels by default.",
"$comment": "Should be a key present in the per-node branch_attrs.labels object of the exported JSON; pattern is from the schema for that object",
"type": "string",
"enum": ["clade", "aa", "none"]
"pattern": "^(none|[a-zA-Z0-9]+)$"
},
"transmission_lines": {
"type": "boolean"
Expand Down
6 changes: 4 additions & 2 deletions augur/data/schema-export-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@
"type": "boolean"
},
"branch_label": {
"description": "What branch label should be displayed by default.",
"type": "string"
"description": "What branch label should be displayed by default, or 'none' to hide labels by default.",
"$comment": "Should be a key present in the per-node branch_attrs.labels object of the exported JSON; pattern is from the schema for that object",
"type": "string",
"pattern": "^(none|[a-zA-Z0-9]+)$"
},
"transmission_lines": {
"description": "Should transmission lines (if available) be displaye by default",
Expand Down

0 comments on commit 65ebea1

Please sign in to comment.