Skip to content

Commit 88eec8b

Browse files
committed
Update comments
1 parent 5a6254a commit 88eec8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nx_cugraph/drawing/layout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ def forceatlas2_layout(
9595
pos, default=[np.nan] * 2, dtype=np.dtype(np.float32, dim)
9696
)
9797

98+
# find, if there exists, the missing position values
9899
missing_vals = cp.isnan(start_pos_arr).all(axis=1)
99100
num_missing = int(cp.count_nonzero(missing_vals))
100101

102+
# fill in with valid random range
101103
if num_missing:
102-
# get the min & max for X and Y
103104
xy_min = cp.nanmin(start_pos_arr, axis=0)
104105
xy_max = cp.nanmax(start_pos_arr, axis=0)
105-
106-
# fill in missing default values with random initial positions
107106
seed = create_random_state(seed)
108107

108+
# fill missing gaps with valid random coords
109109
start_pos_arr[missing_vals] = xy_min + cp.asarray(
110110
seed.rand(num_missing, 2), dtype=np.float32
111111
) * (xy_max - xy_min)

0 commit comments

Comments
 (0)