xgi.readwrite.xgi_data
Load a data set from the xgi-data repository or a local file.
Functions
- xgi.readwrite.xgi_data.load_xgi_data(dataset=None, cache=True, read=False, path='', nodetype=None, edgetype=None, max_order=None)[source]
Load a data set from the xgi-data repository or a local file.
- Parameters:
dataset (str, optional) – Dataset name. Valid options are the top-level tags of the index.json file in the xgi-data repository. If None (default), prints the list of available datasets.
cache (bool, optional) – Whether to cache the input data, by default True.
read (bool, optional) – If read==True, search for a local copy of the data set. Use the local copy if it exists, otherwise use the xgi-data repository. By default, False.
path (str, optional) – Path to a local copy of the data set
nodetype (type, optional) – Type to cast the node ID to, by default None.
edgetype (type, optional) – Type to cast the edge ID to, by default None.
max_order (int, optional) – Maximum order of edges to add to the hypergraph, by default None.
- Returns:
The loaded hypergraph.
- Return type:
- Raises:
XGIError – The specified dataset does not exist.
- xgi.readwrite.xgi_data.download_xgi_data(dataset, path='')[source]
Make a local copy of a dataset in the xgi-data repository.
- Parameters:
dataset (str) – Dataset name. Valid options are the top-level tags of the index.json file in the xgi-data repository.
path (str, optional) – Path to where the local copy should be saved. If none is given, save file to local directory.