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

Set metadata schemas #303

Closed
wants to merge 2 commits into from
Closed

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Jul 23, 2023

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

@hyanwong
Copy link
Member Author

Also fixes #203

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
Copy link
Member

@benjeffery benjeffery left a 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.

@hyanwong
Copy link
Member Author

hyanwong commented Jul 26, 2023

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 struct on node metadata in tsinfer is a good call?

@hyanwong
Copy link
Member Author

hyanwong commented Jun 4, 2024

Obsoleted by #383 . We can revisit using struct metadata later.

@hyanwong hyanwong closed this Jun 4, 2024
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.

"set_metadata" parameter
2 participants