-
Notifications
You must be signed in to change notification settings - Fork 10
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
Set metadata schemas #303
Set metadata schemas #303
Conversation
2e30b73
to
1bde2e7
Compare
Also fixes #203 |
1bde2e7
to
93c0d4d
Compare
5933ae3
to
e10343b
Compare
Defaults to a "struct" type unless a schema already exists (or if there is a null schema that can be interpreted as JSON). Fixes tskit-dev#302
e10343b
to
83ffc1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @hyanwong, we really should get the metadata updating methods into tskit proper, but I think they'll have a similar behaviour to what you've done here.
How much do we care about backwards compatibility here? The two character names suck, and with struct
there is no cost to longer, more descriptive names.
Thanks @benjeffery. I agree that the 2 character names are a bit crap. I'm not that concerned about backwards compatibility, TBH, but at the moment, tsinfer sets JSON metadata on nodes, and with this PR to tsdate, we don't change the codec when adding the Tsdate-specific metadata. So long names may kill us, storage-wise, when running tsdate on the current tsinferred trees. If we address tskit-dev/tsinfer#416 then this ceases to be an issue, as tsinfer would output struct metadata for nodes too. I'm inclined to merge this PR (which doesn't really change behaviour much), but open another to say that we should switch to a more legible naming scheme when tsinfer switches to struct? I assume that you think |
Obsoleted by #383 . We can revisit using struct metadata later. |
Defaults to a "struct" type unless a schema already exists (or if there is a null schema that can be interpreted as JSON). If so, the schema is modified to allow the mean time and variance in time (
mn
&vr
) to be saved as extra values.To maintain backwards-compatibility, I have used the top-level keys "mn" and "vr" for the mean and variance in times (the description field in the schema should make it clear what these are).
Fixes #302