Changeset 9644b5a in sasmodels


Ignore:
Timestamp:
Sep 12, 2017 10:28:09 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
946c8d27
Message:

avoid recalculation of components unless it is a P@S product model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r946c8d27 r9644b5a  
    609609        # Long term, the solution is to change the interface to calculate_Iq 
    610610        # so that it returns a results object containing all the bits: 
    611         #     the A, B, C, ... of the composition model 
     611        #     the A, B, C, ... of the composition model (and any subcomponents?) 
    612612        #     the P and S of the product model, 
    613613        #     the combined model before resolution smearing, 
     
    616616        #     the final I(q), 
    617617        #     ... 
     618        # 
    618619        # Have the model calculator add all of these blindly to the data 
    619620        # tree, and update the graphs which contain them.  The fitter 
     
    627628        # after q max.  Both of these should be addressed before 
    628629        # replacing this code. 
    629         with calculation_lock: 
    630             self._calculate_Iq(qx) 
    631             return self._intermediate_results 
     630        composition = self._model_info.composition 
     631        if composition and composition[0] == 'product': # only P*S for now 
     632            with calculation_lock: 
     633                self._calculate_Iq(qx) 
     634                return self._intermediate_results 
     635        else: 
     636            return None 
    632637 
    633638    def calculate_Iq(self, qx, qy=None): 
Note: See TracChangeset for help on using the changeset viewer.