openmc-dev / plotter

Native plotting GUI for model design and verification
MIT License
48 stars 18 forks source link

Fix filter bin selection performance bug #74

Closed pshriwise closed 2 years ago

pshriwise commented 2 years ago

I noticed that it takes a very long time to unselect an entire category of bins in the plotter. This is caused by each bin making a call to the TallyDock.updateFilters method, which results in a lot of wasted calculation.

This PR removes callback connections to the filter, scores, and nuclides trees and reads the state of the trees using TallyDock.updateModel only when a new plot is generated (i.e. Apply Changes is clicked). It also updates the TallyDock.updateFilters method with logic if for filters where all or none of the bins are selected to improve speed.