unravel.utils.GraphDataset

unravel.utils.GraphDataset(format='spektral', **kwargs)[source]

Factory function that creates the appropriate dataset based on format.

Parameters:
  • format (Literal['spektral', 'pyg'] | None) – Format specification (‘spektral’ or ‘pyg’). Defaults to ‘spektral’.

  • **kwargs – Arguments passed to the dataset constructor

Returns:

SpektralGraphDataset or PyGGraphDataset depending on format

Return type:

SpektralGraphDataset | PyGGraphDataset

Examples

# Spektral format (default) dataset = GraphDataset(graphs=spektral_graph_list, format=’spektral’)

# PyG format dataset = GraphDataset(graphs=pyg_data_list, format=’pyg’)

# From pickle files dataset = GraphDataset(pickle_file=’graphs.pickle.gz’, format=’pyg’)