Changeset 3a1afed in sasmodels


Ignore:
Timestamp:
Feb 20, 2019 3:32:04 PM (4 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
cd28947
Parents:
119073a
Message:

remove calculate_ER/calculate_VR since it was broken and only needed for 3.x multiplication models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r5024a56 r3a1afed  
    695695            return self._calculate_Iq(qx, qy) 
    696696 
    697     def _calculate_Iq(self, qx, qy=None, Fq=False, effective_radius_type=1): 
     697    def _calculate_Iq(self, qx, qy=None): 
    698698        if self._model is None: 
    699699            self._model = core.build_model(self._model_info) 
     
    715715        #print("values", values) 
    716716        #print("is_mag", is_magnetic) 
    717         if Fq: 
    718             result = calculator.Fq(call_details, values, cutoff=self.cutoff, 
    719                                    magnetic=is_magnetic, 
    720                                    effective_radius_type=effective_radius_type) 
    721717        result = calculator(call_details, values, cutoff=self.cutoff, 
    722718                            magnetic=is_magnetic) 
     
    736732        Calculate the effective radius for P(q)*S(q) 
    737733 
     734        *mode* is the R_eff type, which defaults to 1 to match the ER 
     735        calculation for sasview models from version 3.x. 
     736 
    738737        :return: the value of the effective radius 
    739738        """ 
    740         Fq = self._calculate_Iq([0.1], True, mode) 
    741         return Fq[2] 
     739        # ER and VR are only needed for old multiplication models, based on 
     740        # sas.sascalc.fit.MultiplicationModel.  Fail for now.  If we want to 
     741        # continue supporting them then add some test cases so that the code 
     742        # is exercised.  We can access ER/VR using the kernel Fq function by 
     743        # extending _calculate_Iq so that it calls: 
     744        #    if er_mode > 0: 
     745        #        res = calculator.Fq(call_details, values, cutoff=self.cutoff, 
     746        #                            magnetic=False, effective_radius_type=mode) 
     747        #        R_eff, form_shell_ratio = res[2], res[4] 
     748        #        return R_eff, form_shell_ratio 
     749        # Then use the following in calculate_ER: 
     750        #    ER, VR = self._calculate_Iq(q=[0.1], er_mode=mode) 
     751        #    return ER 
     752        # Similarly, for calculate_VR: 
     753        #    ER, VR = self._calculate_Iq(q=[0.1], er_mode=1) 
     754        #    return VR 
     755        # Obviously a combined calculate_ER_VR method would be better, but 
     756        # we only need them to support very old models, so ignore the 2x 
     757        # performance hit. 
     758        raise NotImplementedError("ER function is no longer available.") 
    742759 
    743760    def calculate_VR(self): 
     
    748765        :return: the value of the form:shell volume ratio 
    749766        """ 
    750         Fq = self._calculate_Iq([0.1], True, mode) 
    751         return Fq[4] 
     767        # See comments in calculate_ER. 
     768        raise NotImplementedError("VR function is no longer available.") 
    752769 
    753770    def set_dispersion(self, parameter, dispersion): 
Note: See TracChangeset for help on using the changeset viewer.