Cellprofiler analyst - Closing Classifier Evaluation Window throws an error

Hi @DStirling …yet another one for the road :upside_down_face:

It’s a minor bug, but when it occurs you need to start from scratch. So it might be frustrating if you did a huge classification/training.

==>
If you perform several classification cycles (classify new objects + train + evaluation to see if Confusion Matrix is better), and if you close one of old Confusion Matrix Figures and continue cycling, it throws this error:

An error occurred in the program:
RuntimeError: wrapped C/C++ object of type FigureFrameWxAgg has been deleted

Traceback (most recent call last):
  File "cpa/classifier.py", line 1453, in OnEvaluation
  File "cpa/fastgentleboosting.py", line 545, in ConfusionMatrix
  File "matplotlib/pyplot.py", line 353, in show
  File "matplotlib/backend_bases.py", line 3524, in show
  File "matplotlib/backends/backend_wx.py", line 1049, in show

The error blocks any further classification training. It’s necessary to restart CPA.
While exiting it throws an other error:

An error occurred in the program:
RuntimeError: wrapped C/C++ object of type MainGUI has been deleted

Traceback (most recent call last):
  File "CellProfiler-Analyst.py", line 423, in on_close

Thanks, we’re aware of this one - it’s Mac-only unfortunately. Still working on a fix.

For now, the workaround is not to close evaluation windows until you’ve finished using CPA.