Skip to content

Commit ba06a14

Browse files
committed
added silent print for base widget's _add_props_and_table funciton and overwrite intersecting vesicle pools with new ones
1 parent 7c2b84b commit ba06a14

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

synapse_net/tools/base_widget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ def _add_properties_and_table(self, layer, table_data, save_path=""):
330330
layer.properties = table_data
331331

332332
if add_table is not None:
333-
add_table(layer, self.viewer)
333+
with _SilencePrint():
334+
add_table(layer, self.viewer)
334335

335336
# Save table to file if save path is provided.
336337
if save_path != "":

synapse_net/tools/vesicle_pool_widget.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ def _compute_vesicle_pool(
167167
# Combine the vesicle ids corresponding to the previous assignment with the
168168
# assignment for the new / current pool.
169169
old_pool_ids = pool_properties.label.values.tolist()
170+
171+
# Overwrite the intersection of the two pool assignments with the new pool.
172+
pool_intersections = np.intersect1d(pool_vesicle_ids, old_pool_ids)
173+
old_pool_ids = [item for item in old_pool_ids if item not in pool_intersections]
174+
pool_properties = pool_properties[~pool_properties['label'].isin(pool_intersections)]
175+
170176
pool_assignments = sorted(pool_vesicle_ids + old_pool_ids)
171177

172178
# Get a map for each vesicle id to its pool.

0 commit comments

Comments
 (0)