Changeset fa800e72 in sasmodels


Ignore:
Timestamp:
Jun 27, 2016 12:43:39 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
e758662
Message:

fix disperser support for sasview 4.0

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    re758662 rfa800e72  
    484484        :param dispersion: dispersion object of type Dispersion 
    485485        """ 
    486         if parameter in (s for s in self.params.keys()): 
     486        if parameter in self.params: 
    487487            # TODO: Store the disperser object directly in the model. 
    488             # The current method of creating one on the fly whenever it is 
    489             # needed is kind of funky. 
    490             # Note: can't seem to get disperser parameters from sasview 
    491             # (1) Could create a sasview model that has not yet # been 
    492             # converted, assign the disperser to one of its polydisperse 
    493             # parameters, then retrieve the disperser parameters from the 
    494             # sasview model.  (2) Could write a disperser parameter retriever 
    495             # in sasview.  (3) Could modify sasview to use sasmodels.weights 
    496             # dispersers. 
    497             # For now, rely on the fact that the sasview only ever uses 
    498             # new dispersers in the set_dispersion call and create a new 
    499             # one instead of trying to assign parameters. 
    500             from . import weights 
    501             disperser = weights.dispersers[dispersion.__class__.__name__] 
    502             dispersion = weights.models[disperser]() 
     488            # The current method of relying on the sasview gui to 
     489            # remember them is kind of funky. 
    503490            self.dispersion[parameter] = dispersion.get_pars() 
    504491        else: 
  • sasmodels/weights.py

    ra936688 rfa800e72  
    205205    v, w = obj.get_weights(value, limits[0], limits[1], relative) 
    206206    return v, w 
    207  
    208 # Hack to allow sasview dispersion objects to interoperate with sasmodels 
    209 dispersers = dict((v.__name__, k) for k, v in MODELS.items()) 
    210 dispersers['DispersionModel'] = RectangleDispersion.type 
    211  
Note: See TracChangeset for help on using the changeset viewer.