File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Orange/widgets/data/tests Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 22# pylint: disable=missing-docstring
33from os import path , remove
44from unittest .mock import Mock
5+ import pickle
6+ import tempfile
7+
58
69import numpy as np
10+ import scipy .sparse as sp
711
812from AnyQt .QtCore import QMimeData , QPoint , Qt , QUrl
913from AnyQt .QtGui import QDragEnterEvent , QDropEvent
@@ -195,3 +199,19 @@ def test_check_datetime_disabled(self):
195199 for i in range (4 ):
196200 vartype_delegate .setEditorData (combo , idx (i ))
197201 self .assertEqual (combo .count (), counts [i ])
202+
203+ def test_domain_edit_on_sparse_data (self ):
204+ iris = Table ("iris" )
205+ iris .X = sp .csr_matrix (iris .X )
206+
207+ f = tempfile .NamedTemporaryFile (suffix = '.pickle' , delete = False )
208+ pickle .dump (iris , f )
209+ f .close ()
210+
211+ self .widget .add_path (f .name )
212+ self .widget .load_data ()
213+
214+ output = self .get_output ("Data" )
215+ self .assertIsInstance (output , Table )
216+ self .assertEqual (iris .X .shape , output .X .shape )
217+ self .assertTrue (sp .issparse (output .X ))
You can’t perform that action at this time.
0 commit comments