Changeset fb7180c in sasview for src/sans


Ignore:
Timestamp:
May 7, 2014 6:50:18 PM (11 years ago)
Author:
pkienzle
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e544c84
Parents:
f121904
Message:

enable park constrained fit test

Location:
src/sans
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sans/fit/AbstractFitEngine.py

    r95d58d3 rfb7180c  
    428428 
    429429        sasmodel = model.model 
    430         if len(constraints) > 0: 
    431             for constraint in constraints: 
    432                 name, value = constraint 
    433                 try: 
    434                     model.parameterset[str(name)].set(str(value)) 
    435                 except: 
    436                     msg = "Fit Engine: Error occurs when setting the constraint" 
    437                     msg += " %s for parameter %s " % (value, name) 
    438                     raise ValueError, msg 
    439                  
     430        model.constraints = constraints 
     431 
    440432        if len(pars) > 0: 
    441433            temp = [] 
     
    610602    def __init__(self, model=None, param_list=None, data=None): 
    611603        self.calls = None 
    612         self.pars = [] 
    613604        self.fitness = None 
    614605        self.chisqr = None 
     
    621612        self.residuals = [] 
    622613        self.index = [] 
    623         self.parameters = None 
    624614        self.model = model 
    625615        self.data = data 
  • src/sans/fit/BumpsFitting.py

    red4aef2 rfb7180c  
    182182        """ 
    183183        # Note: technically, unbounded fitters and unmonitored fitters are 
    184         self.setp(x) 
     184        self.setp(p) 
    185185 
    186186        # Compute penalty for being out of bounds which increases the farther 
  • src/sans/fit/ParkFitting.py

    r95d58d3 rfb7180c  
    122122        """ 
    123123        list_params = [] 
    124         self.pars = [] 
    125124        self.pars = fitparams 
    126125        for item in fitparams: 
     
    501500            if fproblem.get_to_fit() == 1: 
    502501                fitproblems.append(fproblem) 
    503         if len(fitproblems) == 0:  
     502        if len(fitproblems) == 0: 
    504503            raise RuntimeError, "No Assembly scheduled for Park fitting." 
    505             return 
    506504        for item in fitproblems: 
    507505            model = item.get_model() 
     
    512510                    ind = item.pars.index(name) 
    513511                    parkmodel.model.setParam(name, item.vals[ind]) 
     512 
     513            # set the constraints into the model 
     514            for p,v in model.constraints: 
     515                parkmodel.parameterset[str(p)].set(str(v)) 
    514516             
    515517            for p in parkmodel.parameterset: 
    516518                ## does not allow status change for constraint parameters 
    517519                if p.status != 'computed': 
    518                     if p.get_name()in item.pars: 
     520                    if p.get_name() in item.pars: 
    519521                        ## make parameters selected for  
    520522                        #fit will be between boundaries 
     
    583585            if result is not None: 
    584586                for p in result.parameters: 
    585                     if p.data.name == small_result.data.name and \ 
    586                             p.model.name == small_result.model.name: 
     587                    #if p.data.name == small_result.data.name and 
     588                    if p.model.name == small_result.model.name: 
    587589                        small_result.index = m.data.idx 
    588590                        small_result.fitness = result.fitness 
  • src/sans/perspectives/fitting/simfitpage.py

    r5777106 rfb7180c  
    378378        box_description = wx.StaticBox(self, -1,"Easy Setup ") 
    379379        boxsizer = wx.StaticBoxSizer(box_description, wx.HORIZONTAL)      
    380         sizer_constraint = wx.BoxSizer(wx.HORIZONTAL|wx.LEFT|wx.RIGHT|wx.EXPAND) 
     380        sizer_constraint = wx.BoxSizer(wx.HORIZONTAL) 
    381381        self.model_cbox_left = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
    382382        self.model_cbox_left.Clear() 
Note: See TracChangeset for help on using the changeset viewer.