@@ -3800,6 +3800,48 @@ def __getitem__(self, index):
38003800 return self .getter (index )
38013801
38023802
3803+ @dataclass (frozen = True )
3804+ class TableMetadataSchemas :
3805+ """
3806+ Convenience class for returning the schemas of all the tables in a tree sequence.
3807+ """
3808+
3809+ node : metadata_module .MetadataSchema = None
3810+ """
3811+ The metadata schema of the node table.
3812+ """
3813+
3814+ edge : metadata_module .MetadataSchema = None
3815+ """
3816+ The metadata schema of the edge table.
3817+ """
3818+
3819+ site : metadata_module .MetadataSchema = None
3820+ """
3821+ The metadata schema of the site table.
3822+ """
3823+
3824+ mutation : metadata_module .MetadataSchema = None
3825+ """
3826+ The metadata schema of the mutation table.
3827+ """
3828+
3829+ migration : metadata_module .MetadataSchema = None
3830+ """
3831+ The metadata schema of the migration table.
3832+ """
3833+
3834+ individual : metadata_module .MetadataSchema = None
3835+ """
3836+ The metadata schema of the individual table.
3837+ """
3838+
3839+ population : metadata_module .MetadataSchema = None
3840+ """
3841+ The metadata schema of the population table.
3842+ """
3843+
3844+
38033845class TreeSequence :
38043846 """
38053847 A single tree sequence, as defined by the :ref:`data model <sec_data_model>`.
@@ -3819,33 +3861,17 @@ class TreeSequence:
38193861 the :meth:`.variants` method iterates over all sites and their genotypes.
38203862 """
38213863
3822- @dataclass (frozen = True )
3823- class _TableMetadataSchemas :
3824- """
3825- Convenience class for returning schemas
3826- """
3827-
3828- node : metadata_module .MetadataSchema = None
3829- edge : metadata_module .MetadataSchema = None
3830- site : metadata_module .MetadataSchema = None
3831- mutation : metadata_module .MetadataSchema = None
3832- migration : metadata_module .MetadataSchema = None
3833- individual : metadata_module .MetadataSchema = None
3834- population : metadata_module .MetadataSchema = None
3835-
38363864 def __init__ (self , ll_tree_sequence ):
38373865 self ._ll_tree_sequence = ll_tree_sequence
38383866 metadata_schema_strings = self ._ll_tree_sequence .get_table_metadata_schemas ()
38393867 metadata_schema_instances = {
38403868 name : metadata_module .parse_metadata_schema (
38413869 getattr (metadata_schema_strings , name )
38423870 )
3843- for name in vars (self . _TableMetadataSchemas )
3871+ for name in vars (TableMetadataSchemas )
38443872 if not name .startswith ("_" )
38453873 }
3846- self ._table_metadata_schemas = self ._TableMetadataSchemas (
3847- ** metadata_schema_instances
3848- )
3874+ self ._table_metadata_schemas = TableMetadataSchemas (** metadata_schema_instances )
38493875 self ._individuals_time = None
38503876 self ._individuals_population = None
38513877 self ._individuals_location = None
@@ -4134,7 +4160,7 @@ def num_samples(self):
41344160 return self ._ll_tree_sequence .get_num_samples ()
41354161
41364162 @property
4137- def table_metadata_schemas (self ) -> _TableMetadataSchemas :
4163+ def table_metadata_schemas (self ) -> TableMetadataSchemas :
41384164 """
41394165 The set of metadata schemas for the tables in this tree sequence.
41404166 """
0 commit comments