@@ -219,7 +219,27 @@ def test_empty_predictions(loader: Loader):
219219 )
220220
221221
222- def test_loader_deletion (
222+ def test_evaluator_loading (
223+ tmp_path : Path ,
224+ basic_segmentations : list [Segmentation ],
225+ ):
226+ loader = Loader .persistent (tmp_path )
227+ loader .add_data (basic_segmentations )
228+ _ = loader .finalize ()
229+ # load from cache
230+ evaluator = Evaluator .load (tmp_path )
231+
232+ assert tmp_path == loader ._path
233+ assert evaluator ._path == loader ._path
234+
235+ assert evaluator .info .number_of_datums == 1
236+ assert evaluator .info .number_of_labels == 2
237+ assert evaluator .info .number_of_pixels == 4
238+ assert evaluator .info .number_of_groundtruth_pixels == 3
239+ assert evaluator .info .number_of_prediction_pixels == 3
240+
241+
242+ def test_evaluator_deletion (
223243 tmp_path : Path ,
224244 basic_segmentations : list [Segmentation ],
225245):
@@ -228,6 +248,12 @@ def test_loader_deletion(
228248 evaluator = loader .finalize ()
229249 assert tmp_path == evaluator ._path
230250
251+ assert evaluator .info .number_of_datums == 1
252+ assert evaluator .info .number_of_labels == 2
253+ assert evaluator .info .number_of_pixels == 4
254+ assert evaluator .info .number_of_groundtruth_pixels == 3
255+ assert evaluator .info .number_of_prediction_pixels == 3
256+
231257 # check only detailed cache exists
232258 assert tmp_path .exists ()
233259 assert evaluator ._generate_cache_path (tmp_path ).exists ()
0 commit comments