PEATDB/Ekin/Ekin_main.py
def updateVars(self, fitdata, reset=True, X=None):
        """Update with current fitdata, only done when we load the dataset"""
        if fitdata != None and fitdata.has_key('model'):
            model = fitdata['model']
            self.model_type.set(model)
            if X==None: X = Fitting.getFitter(model=model)
            if fitdata.has_key('error'):
                self.sqdiff.set('%9.4e' %float(fitdata['error']))
            else:
                self.sqdiff.set('N/A')
            for i in range(len(self.fvars)):
                if fitdata.has_key(i):
                    #in case fit param is stored as string
                    if isinstance(fitdata[i],str):
                        fitdata[i]=float(fitdata[i])
                    val=fitdata[i]
                    if reset:
                        self.fvars[i][0].set(1)
                    self.fvars[i][3].set('%9.4e' %val)
                else:
                    self.fvars[i][0].set(0)
                    self.fvars[i][3].set('-')
            #param labels
            for i in range(len(self.fvars)):
                try:
                    val = X.varnames[i]
                    self.fvars[i][1].set(val)
                except:
                    self.fvars[i][1].set('')
        else:
            #no fit data passed, so we set to default vals
            for i in range(len(self.fvars)):
                self.fvars[i][3].set('-')
        return
Update with current fitdata, only done when we load the dataset
Update with current fitdata, only done when we load the dataset
Update with current fitdata only done when we load the dataset
def updateVars(self, fitdata, reset=True, X=None):
        if fitdata != None and fitdata.has_key('model'):
            model = fitdata['model']
            self.model_type.set(model)
            if X==None: X = Fitting.getFitter(model=model)
            if fitdata.has_key('error'):
                self.sqdiff.set('%9.4e' %float(fitdata['error']))
            else:
                self.sqdiff.set('N/A')
            for i in range(len(self.fvars)):
                if fitdata.has_key(i):
                    if isinstance(fitdata[i],str):
                        fitdata[i]=float(fitdata[i])
                    val=fitdata[i]
                    if reset:
                        self.fvars[i][0].set(1)
                    self.fvars[i][3].set('%9.4e' %val)
                else:
                    self.fvars[i][0].set(0)
                    self.fvars[i][3].set('-')
            for i in range(len(self.fvars)):
                try:
                    val = X.varnames[i]
                    self.fvars[i][1].set(val)
                except:
                    self.fvars[i][1].set('')
        else:
            for i in range(len(self.fvars)):
                self.fvars[i][3].set('-')
        return
def updateVars ( self , fitdata , reset = True , X = None ) : if fitdata != None and fitdata . has_key ( 'model' ) : model = fitdata [ 'model' ] self . model_type . set ( model ) if X == None : X = Fitting . getFitter ( model = model ) if fitdata . has_key ( 'error' ) : self . sqdiff . set ( '%9.4e' % float ( fitdata [ 'error' ] ) ) else : self . sqdiff . set ( 'N/A' ) for i in range ( len ( self . fvars ) ) : if fitdata . has_key ( i ) : if isinstance ( fitdata [ i ] , str ) : fitdata [ i ] = float ( fitdata [ i ] ) val = fitdata [ i ] if reset : self . fvars [ i ] [ 0 ] . set ( 1 ) self . fvars [ i ] [ 3 ] . set ( '%9.4e' % val ) else : self . fvars [ i ] [ 0 ] . set ( 0 ) self . fvars [ i ] [ 3 ] . set ( '-' ) for i in range ( len ( self . fvars ) ) : try : val = X . varnames [ i ] self . fvars [ i ] [ 1 ] . set ( val ) except : self . fvars [ i ] [ 1 ] . set ( '' ) else : for i in range ( len ( self . fvars ) ) : self . fvars [ i ] [ 3 ] . set ( '-' ) return
Update with current fitdata, only done when we load the dataset
Update with current fitdata only done when we load the dataset
"""Update with current fitdata, only done when we load the dataset""" #in case fit param is stored as string #param labels #no fit data passed, so we set to default vals
self
fitdata
reset
X