Skip to content

Commit

Permalink
change save new gconstruct config behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed May 22, 2024
1 parent 1aecdc0 commit 957d6c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/source/configuration/configuration-gconstruction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Graph Construction
* **-\-skip-nonexist-edges**: boolean value to decide whether skip edges whose endpoint nodes don't exist. Default is true.
* **-\-ext-mem-workspace**: the directory where the tool can store data during graph construction. Suggest to use high-speed SSD as the external memory workspace.
* **-\-ext-mem-feat-size**: the minimal number of feature dimensions that features can be stored in external memory. Default is 64.
* **-\-output-conf-file**: The output file with the updated configurations that records the details of data transformation, e.g., one-hot encoding maps, max-min normalization ranges. If not specified, will save the updated configuration file in the **-\-output-dir** with name `data_transform_new.json`.

.. _gconstruction-json:

Expand Down
10 changes: 7 additions & 3 deletions python/graphstorm/gconstruct/construct_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,13 @@ def process_graph(args):
sys_tracker.check('Process the edge data')
num_nodes = {ntype: len(raw_node_id_maps[ntype]) for ntype in raw_node_id_maps}
if args.output_conf_file is not None:
# Save the new config file.
with open(args.output_conf_file, "w", encoding="utf8") as outfile:
json.dump(process_confs, outfile, indent=4)
outfile_path = args.output_conf_file
else:
outfile_path = os.path.join(args.output_dir, 'data_transform_new.json')

# Save the new config file.
with open(outfile_path, "w", encoding="utf8") as outfile:
json.dump(process_confs, outfile, indent=4)

if args.add_reverse_edges:
edges1 = {}
Expand Down

0 comments on commit 957d6c6

Please sign in to comment.