Changeset b0bebdc in sasview


Ignore:
Timestamp:
Dec 29, 2016 1:57:56 PM (8 years ago)
Author:
mathieu
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c1681ea
Parents:
bb3eb744
Message:

Adapt SasViewModel? to new multiplication model replacement. Fixes #209

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    rd3911e3 rb0bebdc  
    197197            output[index] = self.model.evalDistribution(self.data.x[index]) 
    198198 
    199         sq_model = None 
    200         pq_model = None 
     199        sq_values = None 
     200        pq_values = None 
     201        s_model = None 
     202        p_model = None 
    201203        if isinstance(self.model, MultiplicationModel): 
    202             sq_model = numpy.zeros((len(self.data.x))) 
    203             pq_model = numpy.zeros((len(self.data.x))) 
    204             sq_model[index] = self.model.s_model.evalDistribution(self.data.x[index]) 
    205             pq_model[index] = self.model.p_model.evalDistribution(self.data.x[index]) 
     204            s_model = self.model.s_model 
     205            p_model = self.model.p_model 
     206        else: 
     207            p_model, s_model = self.model.get_composition_models() 
     208 
     209        if p_model is not None and s_model is not None: 
     210            sq_values = numpy.zeros((len(self.data.x))) 
     211            pq_values = numpy.zeros((len(self.data.x))) 
     212            sq_values[index] = s_model.evalDistribution(self.data.x[index]) 
     213            pq_values[index] = p_model.evalDistribution(self.data.x[index]) 
    206214 
    207215        elapsed = time.time() - self.starttime 
     
    220228                      unsmeared_data=unsmeared_data, 
    221229                      unsmeared_error=unsmeared_error, 
    222                       pq_model=pq_model, 
    223                       sq_model=sq_model) 
     230                      pq_model=pq_values, 
     231                      sq_model=sq_values) 
    224232 
    225233    def results(self): 
Note: See TracChangeset for help on using the changeset viewer.