@@ -144,28 +144,35 @@ def guess_continuous(property):
144
144
145
145
def _paste_data (self , store ):
146
146
"""Paste only currently unannotated data."""
147
- features = self ._clipboard .pop ("features" )
147
+ features = self ._clipboard .pop ("features" , None )
148
148
if features is None :
149
149
return
150
+
150
151
unannotated = [
151
152
keypoints .Keypoint (label , id_ ) not in store .annotated_keypoints
152
153
for label , id_ in zip (features ["label" ], features ["id" ])
153
154
]
155
+ if not any (unannotated ):
156
+ return
157
+
154
158
new_features = features .iloc [unannotated ]
155
159
indices_ = self ._clipboard .pop ("indices" )
156
160
text_ = self ._clipboard .pop ("text" )
157
161
self ._clipboard = {k : v [unannotated ] for k , v in self ._clipboard .items ()}
158
162
self ._clipboard ["features" ] = new_features
159
163
self ._clipboard ["indices" ] = indices_
160
164
if text_ is not None :
161
- new_text = {k : v [unannotated ] for k , v in text_ .items ()}
165
+ new_text = {
166
+ "string" : text_ ["string" ][unannotated ],
167
+ "color" : text_ ["color" ],
168
+ }
162
169
self ._clipboard ["text" ] = new_text
163
170
164
171
npoints = len (self ._view_data )
165
172
totpoints = len (self .data )
166
173
167
174
if len (self ._clipboard .keys ()) > 0 :
168
- not_disp = self ._dims_not_displayed
175
+ not_disp = self ._slice_input . not_displayed
169
176
data = deepcopy (self ._clipboard ['data' ])
170
177
offset = [
171
178
self ._slice_indices [i ] - self ._clipboard ['indices' ][i ]
@@ -179,6 +186,9 @@ def _paste_data(self, store):
179
186
self ._size = np .append (
180
187
self .size , deepcopy (self ._clipboard ['size' ]), axis = 0
181
188
)
189
+ self ._symbol = np .append (
190
+ self .symbol , deepcopy (self ._clipboard ['symbol' ]), axis = 0
191
+ )
182
192
183
193
self ._feature_table .append (self ._clipboard ['features' ])
184
194
0 commit comments