Skip to content

Commit c55707d

Browse files
authored
Merge pull request #157 from jckitch/patch-1
Fixes #156
2 parents cfa22ec + d33fc3c commit c55707d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spacebench/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def __init__(
297297
if ext == "csv":
298298
data = pd.read_csv(os.path.join(tgtdir, "synthetic_data.csv"), index_col=0)
299299
elif ext in ("tab", "tsv"):
300-
data = pd.read_csv(os.path.join(tgtdir, "synthetic_data.tab"), sep="\t")
300+
data = pd.read_csv(os.path.join(tgtdir, "synthetic_data.tab"), sep="\t", index_col=0)
301301
elif ext == "parquet":
302302
data = pd.read_parquet(os.path.join(tgtdir, "synthetic_data.parquet"))
303303
else:
@@ -337,7 +337,7 @@ def __init__(
337337
graph.add_nodes_from(coords.index)
338338
graph.add_edges_from(edges.values)
339339

340-
node2id = {n: i for i, n in enumerate(graph.nodes)}
340+
node2id = {n: i for i, n in enumerate(data.index)}
341341
self.edge_list = [(node2id[e[0]], node2id[e[1]]) for e in graph.edges]
342342
self.graph = nx.from_edgelist(self.edge_list)
343343

0 commit comments

Comments
 (0)