Changeset a85a569 in sasmodels for sasmodels/modelinfo.py


Ignore:
Timestamp:
Sep 5, 2017 9:40:03 AM (7 years ago)
Author:
lewis
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
be3cce9
Parents:
31ae428 (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket-767

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    r65314f7 ra85a569  
    467467                         if p.polydisperse and p.type not in ('orientation', 'magnetic')) 
    468468        self.pd_2d = set(p.name for p in self.call_parameters if p.polydisperse) 
     469 
     470    def __getitem__(self, key): 
     471        # Find the parameter definition 
     472        for par in self.call_parameters: 
     473            if par.name == key: 
     474                break 
     475        else: 
     476            raise KeyError("unknown parameter %r"%key) 
     477        return par 
    469478 
    470479    def _set_vector_lengths(self): 
     
    757766    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    758767    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
     768    info.random = getattr(kernel_module, 'random', None) 
    759769 
    760770    # multiplicity info 
Note: See TracChangeset for help on using the changeset viewer.