-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Labels
Python APIIssue is about the Python APIIssue is about the Python APIenhancementNew feature or requestNew feature or request
Milestone
Description
There doesn't seem to be much validation of the schema itself when we set a metadata schema. E.g., if we do:
import tskit
tables = tskit.TableCollection(1)
tables.nodes.metadata_schema = tskit.MetadataSchema(
{
"codec": "json",
"type": "object",
"properties": {"accession_number": {"type": "integer"}},
"additional Properties": True,
}
)
print(tables.nodes.metadata_schema)
tables.nodes.add_row(metadata={})OrderedDict([('additional Properties', True),
('codec', 'json'),
('properties',
OrderedDict([('accession_number',
OrderedDict([('type', 'integer')]))])),
('type', 'object')])
(Note the space in "additionalProperties")
This is pretty unhelpful from a developer perspective - we should at least give an error if the schema contains stuff we don't understand.
benjeffery
Metadata
Metadata
Assignees
Labels
Python APIIssue is about the Python APIIssue is about the Python APIenhancementNew feature or requestNew feature or request