Changeset 8f93522 in sasmodels


Ignore:
Timestamp:
Oct 10, 2016 12:36:59 PM (5 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:
2f2c70c
Parents:
479d0f3
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    red10b57 r8f93522  
    320320        else: 
    321321            hidden = set() 
     322        if self._model_info.structure_factor: 
     323            hidden.add('scale') 
     324            hidden.add('background') 
     325            self._model_info.parameters.defaults['background'] = 0. 
    322326 
    323327        self._persistency_dict = {} 
     
    668672                return [self.multiplicity], [1.0] 
    669673            else: 
    670                 return [np.NaN], [1.0] 
     674                # For hidden parameters use the default value. 
     675                value = self._model_info.parameters.defaults.get(par.name, np.NaN) 
     676                return [value], [1.0] 
    671677        elif par.polydisperse: 
    672678            dis = self.dispersion[par.name] 
     
    689695    cylinder = Cylinder() 
    690696    return cylinder.evalDistribution([0.1, 0.1]) 
     697 
     698def test_structure_factor(): 
     699    # type: () -> float 
     700    """ 
     701    Test that a sasview model (cylinder) can be run. 
     702    """ 
     703    Model = _make_standard_model('hardsphere') 
     704    model = Model() 
     705    value = model.evalDistribution([0.1, 0.1]) 
     706    if np.isnan(value): 
     707        raise ValueError("hardsphere returns null") 
    691708 
    692709def test_rpa(): 
Note: See TracChangeset for help on using the changeset viewer.