@@ -51,7 +51,7 @@ def palette2filter(palette, neighbor_sizes=None, bidirection=True):
51
51
"""
52
52
53
53
def generate_cross_filter (number_of_neighbors , dist ):
54
- cross_filter = np .zeros ((number_of_neighbors ,) + palette .shape , dtype = np . bool )
54
+ cross_filter = np .zeros ((number_of_neighbors ,) + palette .shape , dtype = bool )
55
55
cross_filter [0 , dist :, :] = np .logical_or (palette [dist :, :], palette [:- dist , :])
56
56
cross_filter [1 , :, dist :] = np .logical_or (palette [:, dist :], palette [:, :- dist ])
57
57
cross_filter [2 , dist :, dist :] = np .logical_or (
@@ -81,7 +81,7 @@ def generate_cross_filter(number_of_neighbors, dist):
81
81
number_of_span = len (neighbor_sizes )
82
82
number_of_neighbors_per_span = 8 if bidirection else 4
83
83
potential_filter = np .zeros (
84
- (number_of_neighbors_per_span * number_of_span ,) + palette .shape , dtype = np . bool
84
+ (number_of_neighbors_per_span * number_of_span ,) + palette .shape , dtype = bool
85
85
)
86
86
for neighbor_idx , dist in enumerate (neighbor_sizes ):
87
87
offset = neighbor_idx * number_of_neighbors_per_span
@@ -103,7 +103,7 @@ def palette2weight(
103
103
"""
104
104
105
105
def generate_cross_weight (number_of_neighbors , dist ):
106
- cross_filter = np .zeros ((number_of_neighbors ,) + palette .shape , dtype = np . bool )
106
+ cross_filter = np .zeros ((number_of_neighbors ,) + palette .shape , dtype = bool )
107
107
cross_filter [0 , dist :, :] = np .maximum (palette [dist :, :], palette [:- dist , :])
108
108
cross_filter [1 , :, dist :] = np .maximum (palette [:, dist :], palette [:, :- dist ])
109
109
cross_filter [2 , dist :, dist :] = np .maximum (
@@ -152,7 +152,7 @@ def generate_cross_weight(number_of_neighbors, dist):
152
152
number_of_span = len (neighbor_sizes )
153
153
number_of_neighbors_per_span = 8 if bidirection else 4
154
154
potential_weight = np .zeros (
155
- (number_of_neighbors_per_span * number_of_span ,) + palette .shape , dtype = np . bool
155
+ (number_of_neighbors_per_span * number_of_span ,) + palette .shape , dtype = bool
156
156
)
157
157
for neighbor_idx , dist in enumerate (neighbor_sizes ):
158
158
offset = neighbor_idx * number_of_neighbors_per_span
0 commit comments