Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/cli.py
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | |||||
@click.pass_context | @click.pass_context | ||||
def compress(ctx, graph, out_dir, steps): | def compress(ctx, graph, out_dir, steps): | ||||
"""Compress a graph using WebGraph | """Compress a graph using WebGraph | ||||
Input: a pair of files g.nodes.csv.gz, g.edges.csv.gz | Input: a pair of files g.nodes.csv.gz, g.edges.csv.gz | ||||
Output: a directory containing a WebGraph compressed graph | Output: a directory containing a WebGraph compressed graph | ||||
Compression steps are: (1) mph, (2) bv, (3) bv_obl, (4) bfs, (5) permute, | Compression steps are: (1) mph, (2) bv, (3) bfs, (4) permute_bfs, (5) llp, | ||||
(6) permute_obl, (7) stats, (8) transpose, (9) transpose_obl, (10) maps, | (6) permute_llp, (7) obl, (8) compose_orders, (9) stats, (10) transpose, | ||||
(11) clean_tmp. Compression steps can be selected by name or number using | (11) transpose_obl, (12) maps, (11) clean_tmp. Compression steps can be | ||||
--steps, separating them with commas; step ranges (e.g., 3-9, 6-, etc.) are | selected by name or number using --steps, separating them with commas; step | ||||
also supported. | ranges (e.g., 3-9, 6-, etc.) are also supported. | ||||
""" | """ | ||||
from swh.graph import webgraph | from swh.graph import webgraph | ||||
graph_name = graph.name | graph_name = graph.name | ||||
in_dir = graph.parent | in_dir = graph.parent | ||||
try: | try: | ||||
conf = ctx.obj["config"]["graph"]["compress"] | conf = ctx.obj["config"]["graph"]["compress"] | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |