@@ -103,6 +103,57 @@ def test_no_events_issue_37(qtbot):
103103 mw .close ()
104104
105105
106+ def test_remove_dataset_h5py_error (qtbot ):
107+ """Removing an activated dataset and activating Quick View fails
108+
109+ Unhandled exception in Shape-Out version 2.0.1.post2:
110+ Traceback (most recent call last):
111+ File "/home/paul/repos/ShapeOut2/shapeout2/gui/main.py", line 235,
112+ in adopt_pipeline
113+ self.widget_quick_view.update_feature_choices()
114+ File "/home/paul/repos/ShapeOut2/shapeout2/gui/quick_view/qv_main.py",
115+ line 635, in update_feature_choices
116+ ds_feats = [f for f in self.rtdc_ds.features if f in feats_scalar]
117+ [...]
118+ File "/home/paul/repos/dclab/dclab/rtdc_dataset/fmt_hdf5.py", line 101,
119+ in _is_defective_feature
120+ if attr in self._h5.attrs:
121+ [...]
122+ File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
123+ File "h5py/h5o.pyx", line 190, in h5py.h5o.open
124+ ValueError: Not a location (invalid object ID)
125+ """
126+ mw = ShapeOut2 ()
127+ qtbot .addWidget (mw )
128+
129+ # add a dataslot
130+ path = pathlib .Path (__file__ ).parent / "data" / "calibration_beads_47.rtdc"
131+ mw .add_dataslot (paths = [path , path ])
132+
133+ assert len (mw .pipeline .slot_ids ) == 2 , "we added those"
134+ assert len (mw .pipeline .filter_ids ) == 1 , "automatically added"
135+
136+ # activate a dataslot
137+ slot_id = mw .pipeline .slot_ids [0 ]
138+ filt_id = mw .pipeline .filter_ids [0 ]
139+ em = mw .block_matrix .get_widget (slot_id , filt_id )
140+ qtbot .mouseClick (em , QtCore .Qt .LeftButton ) # activate
141+ qtbot .mouseClick (em , QtCore .Qt .LeftButton , QtCore .Qt .ShiftModifier )
142+ # did that work?
143+ assert mw .pipeline .is_element_active (slot_id , filt_id )
144+
145+ # close Quick View
146+ qtbot .mouseClick (mw .toolButton_quick_view , QtCore .Qt .LeftButton )
147+
148+ # now remove the dataset
149+ pw = mw .block_matrix .get_widget (slot_id = slot_id )
150+ pw .action_remove ()
151+
152+ # open Quick View
153+ qtbot .mouseClick (mw .toolButton_quick_view , QtCore .Qt .LeftButton )
154+ mw .close ()
155+
156+
106157def test_update_polygon_filter_issue_26 (qtbot ):
107158 """https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut2/issues/26
108159
0 commit comments