Skip to content

Commit 96dc912

Browse files
dodamihakhileshh
authored andcommitted
hotfix: explicit uint64 typing to avoid float64 rounding
1 parent db6023d commit 96dc912

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pychunkedgraph/graph/edges/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ def merge_cross_edge_dicts(x_edges_d1: Dict, x_edges_d2: Dict) -> Dict:
6969
Combines two cross chunk dictionaries of form
7070
{node_id: {layer id : edge list}}.
7171
"""
72-
node_ids = np.unique(list(x_edges_d1.keys()) + list(x_edges_d2.keys()))
72+
node_ids = np.unique(
73+
np.array(list(x_edges_d1.keys()) + list(x_edges_d2.keys()), dtype=basetypes.NODE_ID)
74+
)
7375
result_d = {}
7476
for node_id in node_ids:
7577
cross_edge_ds = [x_edges_d1.get(node_id, {}), x_edges_d2.get(node_id, {})]

pychunkedgraph/graph/segmenthistory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def operation_id_root_id_dict(self):
7878

7979
@property
8080
def operation_ids(self):
81-
return np.array(list(self.operation_id_root_id_dict.keys()))
81+
return np.array(list(self.operation_id_root_id_dict.keys()), dtype=basetypes.OPERATION_ID)
8282

8383
@property
8484
def _log_rows(self):

pychunkedgraph/meshing/meshgen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _get_root_ids(args):
253253

254254
lx_id_remap = get_higher_to_lower_remapping(cg, chunk_id, time_stamp=time_stamp)
255255

256-
lx_ids = np.array(list(lx_id_remap.keys()))
256+
lx_ids = np.array(list(lx_id_remap.keys()), dtype=np.uint64)
257257

258258
root_ids = np.zeros(len(lx_ids), dtype=np.uint64)
259259
n_jobs = np.min([n_threads, len(lx_ids)])
@@ -1034,8 +1034,8 @@ def get_multi_child_nodes(cg, chunk_id, node_id_subset=None, chunk_bbox_string=F
10341034
node_ids=node_id_subset, properties=attributes.Hierarchy.Child
10351035
)
10361036

1037-
node_ids = np.array(list(range_read.keys()))
1038-
node_rows = np.array(list(range_read.values()))
1037+
node_ids = np.array(list(range_read.keys()), dtype=np.uint64)
1038+
node_rows = np.array(list(range_read.values()), dtype=object)
10391039
child_fragments = np.array(
10401040
[
10411041
fragment.value

0 commit comments

Comments
 (0)