Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jalencato committed Oct 25, 2023
1 parent 73a6d6d commit 4f18922
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions python/graphstorm/gconstruct/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,23 +1114,23 @@ def process_features(data, ops, ext_mem=None):
val = val.reshape(-1, 1)
if len(col_name) == 1:
new_data[key] = val
continue
tmp_key = key
# Use external memory if it is available
if ext_mem is not None:
if not os.path.exists(feature_path):
os.makedirs(feature_path)
wrapper = ExtFeatureWrapper(feature_path, val.shape, val.dtype)
# Generate a hashcode
random_uuid = uuid.uuid4()
hash_object = hashlib.sha256(str(random_uuid).encode())
hash_hex = hash_object.hexdigest()

val.tofile(feature_path + '/{}_{}.npy'.format(col, hash_hex))
else:
tmp_key = key
# Use external memory if it is available
if ext_mem is not None:
if not os.path.exists(feature_path):
os.makedirs(feature_path)
wrapper = ExtFeatureWrapper(feature_path, val.shape, val.dtype)
# Generate a hashcode
random_uuid = uuid.uuid4()
hash_object = hashlib.sha256(str(random_uuid).encode())
hash_hex = hash_object.hexdigest()

val.tofile(feature_path + '/{}_{}.npy'.format(col, hash_hex))
else:
val = np.column_stack((new_data[key], val)) \
if key in new_data else val
new_data[key] = val
val = np.column_stack((new_data[key], val)) \
if key in new_data else val
new_data[key] = val

if len(col_name) > 1 and ext_mem is not None:
wrapper.merge()
Expand Down

0 comments on commit 4f18922

Please sign in to comment.