Changeset be86916 in sasmodels


Ignore:
Timestamp:
Nov 6, 2016 5:29:57 AM (8 years ago)
Author:
ajj
Branches:
release_v0.95
Parents:
f837f0b
git-author:
Paul Kienzle <pkienzle@…> (10/10/16 12:36:59)
git-committer:
Andrew Jackson <andrew.jackson@…> (11/06/16 05:29:57)
Message:

hide structure factor background/scale from sasview gui. Fixes #657.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r9c1a59c rbe86916  
    311311        else: 
    312312            hidden = set() 
     313        if self._model_info.structure_factor: 
     314            hidden.add('scale') 
     315            hidden.add('background') 
     316            self._model_info.parameters.defaults['background'] = 0. 
    313317 
    314318        self._persistency_dict = {} 
     
    655659                return [self.multiplicity], [1.0] 
    656660            else: 
    657                 return [np.NaN], [1.0] 
     661                # For hidden parameters use the default value. 
     662                value = self._model_info.parameters.defaults.get(par.name, np.NaN) 
     663                return [value], [1.0] 
    658664        elif par.polydisperse: 
    659665            dis = self.dispersion[par.name] 
     
    676682    cylinder = Cylinder() 
    677683    return cylinder.evalDistribution([0.1, 0.1]) 
     684 
     685def test_structure_factor(): 
     686    # type: () -> float 
     687    """ 
     688    Test that a sasview model (cylinder) can be run. 
     689    """ 
     690    Model = _make_standard_model('hardsphere') 
     691    model = Model() 
     692    value = model.evalDistribution([0.1, 0.1]) 
     693    if np.isnan(value): 
     694        raise ValueError("hardsphere returns null") 
    678695 
    679696def test_rpa(): 
Note: See TracChangeset for help on using the changeset viewer.