<s> from __future__ import with_statement <EOL> from . . dream import views as dream_views <EOL> from . . dream import stats as dream_stats <EOL> from . . import errplot <EOL> from . plot_view import PlotView <EOL> class UncertaintyView ( PlotView ) : <EOL> title = "<STR_LIT>" <EOL> def plot ( self ) : <EOL> if not self . plot_state : <EOL> return <EOL> history , stats = self . plot_state <EOL> with self . pylab_interface as pylab : <EOL> pylab . clf ( ) <EOL> dream_views . plot_vars ( history . draw ( ) , stats ) <EOL> pylab . draw ( ) <EOL> def update ( self , state ) : <EOL> self . plot_state = state <EOL> self . plot ( ) <EOL> def OnFitProgress ( self , event ) : <EOL> if event . problem != self . model : <EOL> return <EOL> history = event . uncertainty_state <EOL> stats = dream_stats . var_stats ( history . draw ( ) ) <EOL> self . update ( ( history , stats ) ) <EOL> class CorrelationView ( PlotView ) : <EOL> title = "<STR_LIT>" <EOL> def plot ( self ) : <EOL> if not self . plot_state : <EOL> return <EOL> if self . plot_state . Nvar > <NUM_LIT:15> : <EOL> return <EOL> history = self . plot_state <EOL> with self . pylab_interface as pylab : <EOL> pylab . clf ( ) <EOL> dream_views . plot_corrmatrix ( history . draw ( ) ) <EOL> pylab . draw ( ) <EOL> def update ( self , state ) : <EOL> self . plot_state = state <EOL> self . plot ( ) <EOL> def OnFitProgress ( self , event ) : <EOL> if event . problem != self . model : <EOL> return <EOL> self . update ( event . uncertainty_state ) <EOL> class TraceView ( PlotView ) : <EOL> title = "<STR_LIT>" <EOL> def plot ( self ) : <EOL> if not self . plot_state : <EOL> return <EOL> history = self . plot_state <EOL> with self . pylab_interface as pylab : <EOL> pylab . clf ( ) <EOL> dream_views . plot_trace ( history ) <EOL> pylab . draw ( ) <EOL> def update ( self , state ) : <EOL> self . plot_state = state <EOL> self . plot ( ) <EOL> def OnFitProgress ( self , event ) : <EOL> if event . problem != self . model : <EOL> return <EOL> self . plot_state = event . uncertainty_state <EOL> self . plot ( ) <EOL> class ModelErrorView ( PlotView ) : <EOL> title = "<STR_LIT>" <EOL> def plot ( self ) : <EOL> if not self . plot_state : <EOL> return <EOL> with self . pylab_interface as pylab : <EOL> pylab . clf ( ) <EOL> errplot . show_errors ( self . plot_state ) <EOL> pylab . draw ( ) <EOL> def OnFitProgress ( self , event ) : <EOL> if event . problem != self . model : <EOL> return <EOL> self . update ( event . problem , event . uncertainty_state ) <EOL> def update ( self , problem , state ) : <EOL> self . plot_state = errplot . calc_errors_from_state ( problem , state ) <EOL> self . plot ( ) </s>
