Skip to content

Commit

Permalink
Update docs (#23)
Browse files Browse the repository at this point in the history
* converted strings to numbers

* reformatted keys
  • Loading branch information
nwlandry authored Apr 5, 2024
1 parent 4a636ab commit d7b503c
Show file tree
Hide file tree
Showing 3 changed files with 315 additions and 315 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This is a repository of openly available hypergraph datasets in JSON format with

## Overview of the xgi-data format
The xgi-data format for hypergraph data sets is a JSON data structure with the following structure:
* "hypergraph-data": This tag accesses the attributes of the entire hypergraph dataset such as the authors or dataset name.
* "node-data": This tag accesses the nodes of the hypergraph and their associated properties as a dictionary where the keys are node IDs and the corresponding values are dictionaries. If a node doesn't have any properties, the associated dictionary is empty.
* "name": This tag accesses the node's name if there is one that is different from the ID specified in the hyperedges.
* `hypergraph-data`: This tag accesses the attributes of the entire hypergraph dataset such as the authors or dataset name.
* `node-data`: This tag accesses the nodes of the hypergraph and their associated properties as a dictionary where the keys are node IDs and the corresponding values are dictionaries. If a node doesn't have any properties, the associated dictionary is empty.
* `name`: This tag accesses the node's name if there is one that is different from the ID specified in the hyperedges.
* Other tags are user-specified based on the particular attributes provided by the dataset.
* "edge-data": This tag accesses the hyperedges of the hypergraph and their associated attributes.
* "name": This tag accesses the edge's name if one is provided.
* "timestamp": This is the tag specifying the time associated with the hyperedge if it is given. All times are stored in ISO8601 standard.
* `edge-data`: This tag accesses the hyperedges of the hypergraph and their associated attributes.
* `name`: This tag accesses the edge's name if one is provided.
* `timestamp`: This is the tag specifying the time associated with the hyperedge if it is given. All times are stored in ISO8601 standard.
* Other tags are user-specified based on the particular attributes provided by the dataset.
* "edge-dict": This tag accesses the edge IDs and the corresponding nodes which participate in that hyperedge.
* `edge-dict`: This tag accesses the edge IDs and the corresponding nodes which participate in that hyperedge.

All IDs are strings but can be converted to other types if desired.

Expand Down
22 changes: 11 additions & 11 deletions get_stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@
" data = json.load(file)\n",
"\n",
"props = {\n",
" \"num-nodes\": \"{:,d}\".format(num_nodes),\n",
" \"num-edges\": \"{:,d}\".format(num_edges),\n",
" \"num-unique-edges\": \"{:,d}\".format(num_unique_edges),\n",
" \"min-edge-size\": \"{:,d}\".format(smin),\n",
" \"max-edge-size\": \"{:,d}\".format(smax),\n",
" \"mean-edge-size\": \"{:,.2f}\".format(smean),\n",
" \"min-degree\": \"{:,d}\".format(dmin),\n",
" \"max-degree\": \"{:,d}\".format(dmax),\n",
" \"mean-degree\": \"{:,.2f}\".format(dmean),\n",
" \"num-components\": \"{:,d}\".format(num_components),\n",
" \"gc-size\": \"{:,d}\".format(size_gc),\n",
" \"num-nodes\": int(num_nodes),\n",
" \"num-edges\": int(num_edges),\n",
" \"num-unique-edges\": int(num_unique_edges),\n",
" \"min-edge-size\": int(smin),\n",
" \"max-edge-size\": int(smax),\n",
" \"mean-edge-size\": round(smean, 2),\n",
" \"min-degree\": int(dmin),\n",
" \"max-degree\": int(dmax),\n",
" \"mean-degree\": round(dmean, 2),\n",
" \"num-components\": int(num_components),\n",
" \"gc-size\": int(size_gc),\n",
"}\n",
"data[dataset_name].update(props)\n",
"\n",
Expand Down
Loading

0 comments on commit d7b503c

Please sign in to comment.