Changeset 51f14603 in sasview


Ignore:
Timestamp:
Apr 3, 2014 9:37:53 AM (11 years ago)
Author:
Peter Parker
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
2f2d9d0
Parents:
eea3ffa
Message:

Refs #202 - Fix Sphinx build errors (not including park-1.2.1/). Most warnings remain.

Files:
27 edited

Legend:

Unmodified
Added
Removed
  • src/sans/calculator/resolution_calculator.py

    r5777106 r51f14603  
    473473        """ 
    474474        Get the variance when the slit/pinhole size is given 
    475         : size: list that can be one(diameter for circular) 
    476                 or two components(lengths for rectangular) 
     475        : size: list that can be one(diameter for circular) or two components(lengths for rectangular) 
    477476        : distance: [z, x] where z along the incident beam, x // qx_value 
    478477        : comp: direction of the sigma; can be 'phi', 'y', 'x', and 'radial' 
  • src/sans/calculator/sans_gen.py

    rf468791 r51f14603  
    197197        """ 
    198198        Evaluate a distribution of q-values. 
    199         * For 1D, a numpy array is expected as input: 
    200             evalDistribution(q)    
    201         where q is a numpy array. 
    202         * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], 
    203           where 1D arrays,   
    204         :param qdist: ndarray of scalar q-values or list [qx,qy]  
    205                     where qx,qy are 1D ndarrays  
     199        * For 1D, a numpy array is expected as input: evalDistribution(q) where q is a numpy array. 
     200        * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], where 1D arrays. 
     201        :param qdist: ndarray of scalar q-values or list [qx,qy] where qx,qy are 1D ndarrays  
    206202        """ 
    207203        if qdist.__class__.__name__ == 'list': 
     
    952948    def set_sldms(self, sld_mx, sld_my, sld_mz): 
    953949        """ 
    954         Sets (|m|, m_theta, m_phi) 
     950        Sets (\|m\|, m_theta, m_phi) 
    955951        """ 
    956952        if sld_mx.__class__.__name__ == 'float': 
  • src/sans/data_util/calcthread.py

    r4bae1ef r51f14603  
    3333     
    3434    When defining the compute() method you need to include code which 
    35     allows the GUI to run.  They are as follows: 
    36         self.isquit()          call frequently to check for interrupts 
    37         self.update(kw=...)    call when the GUI could be updated 
    38         self.complete(kw=...)  call before exiting compute() 
     35    allows the GUI to run.  They are as follows: :: 
     36 
     37        self.isquit()          # call frequently to check for interrupts 
     38        self.update(kw=...)    # call when the GUI could be updated 
     39        self.complete(kw=...)  # call before exiting compute() 
     40 
    3941    The update() and complete() calls accept field=value keyword 
    4042    arguments which are passed to the called function.  complete() 
     
    4648    of the derived class. 
    4749 
    48     The user of this class will call the following: 
    49  
    50         thread = Work(...,kw=...)  prepare the work thread. 
    51         thread.queue(...,kw=...)   queue a work unit 
    52         thread.requeue(...,kw=...) replace work unit on the end of queue 
    53         thread.reset(...,kw=...)   reset the queue to the given work unit 
    54         thread.stop()              clear the queue and halt 
    55         thread.interrupt()         halt the current work unit but continue 
    56         thread.ready(delay=0.)     request an update signal after delay 
    57         thread.isrunning()         returns true if compute() is running 
     50    The user of this class will call the following: :: 
     51 
     52        thread = Work(...,kw=...)  # prepare the work thread. 
     53        thread.queue(...,kw=...)   # queue a work unit 
     54        thread.requeue(...,kw=...) # replace work unit on the end of queue 
     55        thread.reset(...,kw=...)   # reset the queue to the given work unit 
     56        thread.stop()              # clear the queue and halt 
     57        thread.interrupt()         # halt the current work unit but continue 
     58        thread.ready(delay=0.)     # request an update signal after delay 
     59        thread.isrunning()         # returns true if compute() is running 
    5860 
    5961    Use queue() when all work must be done.  Use requeue() when intermediate 
     
    6365    stop() to halt the current and pending computations (e.g., in response to 
    6466    a stop button). 
    65      
     67 
    6668    The methods queue(), requeue() and reset() are proxies for the compute() 
    6769    method in the subclass.  Look there for a description of the arguments. 
     
    8284    should be implemented vary from framework to framework. 
    8385 
    84     For wx, something like the following is needed: 
     86    For wx, something like the following is needed: :: 
    8587 
    8688        import wx, wx.lib.newevent 
  • src/sans/data_util/registry.py

    r4bae1ef r51f14603  
    1515    Note that there may be multiple loaders for the same extension. 
    1616 
    17     Example: 
     17    Example: :: 
    1818 
    19     registry = ExtensionRegistry() 
     19        registry = ExtensionRegistry() 
    2020 
    21     # Add an association by setting an element 
    22     registry['.zip'] = unzip 
    23      
    24     # Multiple extensions for one loader 
    25     registry['.tgz'] = untar 
    26     registry['.tar.gz'] = untar 
     21        # Add an association by setting an element 
     22        registry['.zip'] = unzip 
     23         
     24        # Multiple extensions for one loader 
     25        registry['.tgz'] = untar 
     26        registry['.tar.gz'] = untar 
    2727 
    28     # Generic extensions to use after trying more specific extensions;  
    29     # these will be checked after the more specific extensions fail. 
    30     registry['.gz'] = gunzip 
     28        # Generic extensions to use after trying more specific extensions;  
     29        # these will be checked after the more specific extensions fail. 
     30        registry['.gz'] = gunzip 
    3131 
    32     # Multiple loaders for one extension 
    33     registry['.cx'] = cx1 
    34     registry['.cx'] = cx2 
    35     registry['.cx'] = cx3 
     32        # Multiple loaders for one extension 
     33        registry['.cx'] = cx1 
     34        registry['.cx'] = cx2 
     35        registry['.cx'] = cx3 
    3636 
    37     # Show registered extensions 
    38     print registry.extensions() 
    39      
    40     # Can also register a format name for explicit control from caller 
    41     registry['cx3'] = cx3 
    42     print registry.formats() 
     37        # Show registered extensions 
     38        print registry.extensions() 
     39         
     40        # Can also register a format name for explicit control from caller 
     41        registry['cx3'] = cx3 
     42        print registry.formats() 
    4343 
    44     # Retrieve loaders for a file name 
    45     registry.lookup('hello.cx') -> [cx3,cx2,cx1] 
     44        # Retrieve loaders for a file name 
     45        registry.lookup('hello.cx') -> [cx3,cx2,cx1] 
    4646 
    47     # Run loader on a filename 
    48     registry.load('hello.cx') -> 
    49         try: 
     47        # Run loader on a filename 
     48        registry.load('hello.cx') -> 
     49            try: 
     50                return cx3('hello.cx') 
     51            except: 
     52                try: 
     53                    return cx2('hello.cx') 
     54                except: 
     55                    return cx1('hello.cx') 
     56 
     57        # Load in a specific format ignoring extension 
     58        registry.load('hello.cx',format='cx3') -> 
    5059            return cx3('hello.cx') 
    51         except: 
    52             try: 
    53                 return cx2('hello.cx') 
    54             except: 
    55                 return cx1('hello.cx') 
    56  
    57     # Load in a specific format ignoring extension 
    58     registry.load('hello.cx',format='cx3') -> 
    59         return cx3('hello.cx') 
    6060    """ 
    6161    def __init__(self, **kw): 
  • src/sans/fit/AbstractFitEngine.py

    r5777106 r51f14603  
    557557         
    558558        :param model: sans.models type  
    559         :param : is the key of the fitArrange dictionary where model is  
    560                 saved as a value 
     559        :param id: is the key of the fitArrange dictionary where model is saved as a value 
    561560        :param pars: the list of parameters to fit  
    562561        :param constraints: list of  
     
    566565            Example:   
    567566            we want to fit 2 model M1 and M2 both have parameters A and B. 
    568             constraints can be: 
    569              constraints = [(M1.A, M2.B+2), (M1.B= M2.A *5),...,] 
     567            constraints can be ``constraints = [(M1.A, M2.B+2), (M1.B= M2.A *5),...,]`` 
    570568             
    571569              
  • src/sans/fit/ParkFitting.py

    r5777106 r51f14603  
    315315    Set model parameter "M1"= model.name add {model.parameter.name:value}. 
    316316     
    317     :note: Set_param() if used must always preceded set_model() 
    318          for the fit to be performed. 
    319     engine.set_param( model,"M1", {'A':2,'B':4}) 
     317    ..note:: 
     318       Set_param() if used must always preceded set_model() for the fit to be performed. 
     319      ``engine.set_param( model,"M1", {'A':2,'B':4})`` 
    320320     
    321321    Add model with a dictionnary of FitArrangeList{} where Uid is a key 
     
    327327    chisqr1, out1, cov1=engine.fit({model.parameter.name:value},qmin,qmax) 
    328328     
    329     :note: {model.parameter.name:value} is ignored in fit function since  
     329    ..note:: 
     330        {model.parameter.name:value} is ignored in fit function since  
    330331        the user should make sure to call set_param himself. 
    331332         
  • src/sans/guiframe/CategoryManager.py

    r5777106 r51f14603  
    22 
    33""" 
    4  
    5 /** 
    6         This software was developed by Institut Laue-Langevin as part of 
    7         Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
    8  
    9         Copyright 2012 Institut Laue-Langevin 
    10  
    11 **/ 
     4This software was developed by Institut Laue-Langevin as part of 
     5Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
     6 
     7Copyright 2012 Institut Laue-Langevin 
    128 
    139""" 
  • src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py

    r5777106 r51f14603  
    22""" 
    33Dialog for appearance of plot symbols, color, size etc. 
    4 /** 
    5     This software was developed by Institut Laue-Langevin as part of 
    6     Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
    7  
    8     Copyright 2012 Institut Laue-Langevin 
    9  
    10 **/ 
     4 
     5This software was developed by Institut Laue-Langevin as part of 
     6Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
     7 
     8Copyright 2012 Institut Laue-Langevin 
    119""" 
    1210import wx 
  • src/sans/guiframe/local_perspectives/plotting/boxSum.py

    r5777106 r51f14603  
    259259        Receive a dictionary and reset the slicer with values contained  
    260260        in the values of the dictionary. 
    261         :param params: a dictionary containing name of slicer parameters and  
    262             values the user assigned to the slicer. 
     261        :param params: a dictionary containing name of slicer parameters and values the user assigned to the slicer. 
    263262        """ 
    264263        x_max = math.fabs(params["Width"] )/2 
  • src/sans/guiframe/plugin_base.py

    r5777106 r51f14603  
    1717    For example, a plug-in called Foo should be place in "perspectives/Foo". 
    1818    That directory contains at least two files: 
    19         perspectives/Foo/__init__.py contains two lines: 
    20          
    21             PLUGIN_ID = "Foo plug-in 1.0" 
    22             from Foo import * 
     19 
     20    1. perspectives/Foo/__init__.py contains two lines: :: 
     21         
     22        PLUGIN_ID = "Foo plug-in 1.0" 
     23        from Foo import * 
    2324             
    24         perspectives/Foo/Foo.py contains the definition of the Plugin 
    25         class for the Foo plug-in. The interface of that Plugin class 
    26         should follow the interface of the class you are looking at. 
     25    2. perspectives/Foo/Foo.py contains the definition of the Plugin 
     26       class for the Foo plug-in. The interface of that Plugin class 
     27       should follow the interface of the class you are looking at. 
    2728         
    2829    See dummyapp.py for a plugin example. 
  • src/sans/models/BaseComponent.py

    r5777106 r51f14603  
    9696        Evaluate a distribution of q-values. 
    9797         
    98         * For 1D, a numpy array is expected as input: 
     98        * For 1D, a numpy array is expected as input: :: 
    9999         
    100100            evalDistribution(q) 
    101101             
     102          where q is a numpy array. 
     103         
     104         
     105        * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], 
     106          where 1D arrays, :: 
     107         
     108              qx_prime = [ qx[0], qx[1], qx[2], ....] 
     109 
     110          and :: 
     111 
     112              qy_prime = [ qy[0], qy[1], qy[2], ....]  
     113         
     114        Then get :: 
     115 
     116            q = numpy.sqrt(qx_prime^2+qy_prime^2) 
     117         
     118        that is a qr in 1D array; :: 
     119 
     120            q = [q[0], q[1], q[2], ....]  
     121         
     122        ..note:: 
     123          Due to 2D speed issue, no anisotropic scattering  
     124          is supported for python models, thus C-models should have 
     125          their own evalDistribution methods. 
     126         
     127        The method is then called the following way: :: 
     128         
     129            evalDistribution(q) 
     130 
    102131        where q is a numpy array. 
    103132         
    104          
    105         * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], 
    106           where 1D arrays, 
    107          
    108         qx_prime = [ qx[0], qx[1], qx[2], ....] 
    109         and 
    110         qy_prime = [ qy[0], qy[1], qy[2], ....]  
    111          
    112         Then get 
    113         q = numpy.sqrt(qx_prime^2+qy_prime^2) 
    114          
    115         that is a qr in 1D array; 
    116         q = [q[0], q[1], q[2], ....]  
    117          
    118         :Note: Due to 2D speed issue, no anisotropic scattering  
    119             is supported for python models, thus C-models should have 
    120              their own evalDistribution methods. 
    121          
    122         The method is then called the following way: 
    123          
    124         evalDistribution(q) 
    125         where q is a numpy array. 
    126          
    127         :param qdist: ndarray of scalar q-values or list [qx,qy]  
    128                     where qx,qy are 1D ndarrays  
    129          
     133        :param qdist: ndarray of scalar q-values or list [qx,qy] where qx,qy are 1D ndarrays 
    130134        """ 
    131135        if qdist.__class__.__name__ == 'list': 
  • src/sans/models/Constant.py

    r5777106 r51f14603  
    77 
    88class Constant(BaseComponent): 
    9     """ Class that evaluates a constant model.  
    10         List of default parameters: 
    11          value           = 1.0  
     9    """ 
     10    Class that evaluates a constant model.  
     11    List of default parameters: 
     12     
     13    * value           = 1.0  
    1214    """ 
    1315         
  • src/sans/models/PolymerExclVolume.py

    r5777106 r51f14603  
    2525    Refer to that file and the structure it contains 
    2626    for details of the model. 
     27 
    2728    List of default parameters: 
    28          scale           = 0.01  
    29          rg              = 100.0 [A] 
    30          m               = 3.0  
    31          background      = 0.0 [1/cm] 
     29     
     30    * scale           = 0.01  
     31    * rg              = 100.0 [A] 
     32    * m               = 3.0  
     33    * background      = 0.0 [1/cm] 
    3234 
    3335    """ 
  • src/sans/models/PowerLawAbsModel.py

    r5777106 r51f14603  
    11"""  
    2     Provide F(x) = scale* (|x|)^(-m) + bkd 
     2    Provide F(x) = scale* (\|x\|)^(-m) + bkd 
    33    Power law function as a BaseComponent model 
    44""" 
     
    88class PowerLawAbsModel(PowerLawModel): 
    99    """ 
    10         Class that evaluates a absolute Power_Law model. 
    11          
     10    Class that evaluates a absolute Power_Law model. :: 
     11     
    1212        F(x) = scale* (|x|)^(-m) + bkd 
    13          
    14         The model has three parameters:  
    15             m     =  power 
    16             scale  =  scale factor 
    17             bkd    =  incoherent background 
     13     
     14    The model has three parameters: 
     15 
     16    * m     =  power 
     17    * scale  =  scale factor 
     18    * bkd    =  incoherent background 
    1819    """ 
    1920     
  • src/sans/models/TwoPowerLawModel.py

    r5777106 r51f14603  
    1717        =C*pow(qval,-1.0*power2) for q>qc 
    1818    where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2). 
     19     
    1920    List of default parameters: 
    20      coef_A = coefficient 
    21      power1 = (-) Power @ low Q 
    22      power2 = (-) Power @ high Q 
    23      qc = crossover Q-value 
    24      background = incoherent background 
     21     
     22    * coef_A = coefficient 
     23    * power1 = (-) Power @ low Q 
     24    * power2 = (-) Power @ high Q 
     25    * qc = crossover Q-value 
     26    * background = incoherent background 
    2527    """ 
    2628         
  • src/sans/models/c_extension/python_wrapper/WrapperGenerator.py

    r230f479 r51f14603  
    126126        buf = f.read() 
    127127         
    128         self.default_list = "List of default parameters:\n" 
     128        self.default_list = "\n    List of default parameters:\n\n" 
    129129        #lines = string.split(buf,'\n') 
    130130        lines = buf.split('\n') 
     
    293293                    if len(toks2) >= 2: 
    294294                        units = toks2[1] 
    295                     self.default_list += "        %-15s = %s %s\n" % \ 
     295                    self.default_list += "    * %-15s = %s %s\n" % \ 
    296296                        (toks[1], val, units) 
    297297                     
  • src/sans/models/c_extension/python_wrapper/modelTemplate.txt

    r230f479 r51f14603  
    1616Provide functionality for a C extension model 
    1717 
    18 :WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    19          DO NOT MODIFY THIS FILE, MODIFY 
    20             [INCLUDE_FILE] 
    21          AND RE-RUN THE GENERATOR SCRIPT 
     18.. WARNING:: 
     19 
     20   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
     21   DO NOT MODIFY THIS FILE, MODIFY 
     22   [INCLUDE_FILE] 
     23   AND RE-RUN THE GENERATOR SCRIPT 
    2224""" 
    2325 
  • src/sans/models/qsmearing.py

    r5777106 r51f14603  
    500500    Make fake data_x points extrapolated outside of the data_x points 
    501501     
    502     : param width: array of std of q resolution 
    503     : param Data1D.x: Data1D.x array 
    504      
    505     : return new_width, data_x_ext: extrapolated width array and x array 
    506      
    507     : assumption1: data_x is ordered from lower q to higher q 
    508     : assumption2: len(data) = len(width) 
    509     : assumption3: the distance between the data points is more compact  
    510             than the size of width  
    511     : Todo1: Make sure that the assumptions are correct for Data1D 
    512     : Todo2: This fixes the edge problem in Qsmearer but still needs to make  
    513             smearer interface  
     502    :param width: array of std of q resolution 
     503    :param Data1D.x: Data1D.x array 
     504     
     505    :return new_width, data_x_ext: extrapolated width array and x array 
     506     
     507    :assumption1: data_x is ordered from lower q to higher q 
     508    :assumption2: len(data) = len(width) 
     509    :assumption3: the distance between the data points is more compact than the size of width  
     510    :Todo1: Make sure that the assumptions are correct for Data1D 
     511    :Todo2: This fixes the edge problem in Qsmearer but still needs to make smearer interface  
    514512    """ 
    515513    # Length of the width 
  • src/sans/perspectives/calculator/data_operator.py

    rf468791 r51f14603  
    2929class DataOperPanel(wx.ScrolledWindow): 
    3030    """ 
    31     :param data: when not empty the class can  
    32                 same information into a data object 
    33         and post event containing the changed data object to some other frame 
    3431    """ 
    3532    def __init__(self, parent, *args, **kwds): 
  • src/sans/perspectives/calculator/kiessig_calculator_panel.py

    r5777106 r51f14603  
    11""" 
    2    This software was developed by the University of Tennessee as part of the 
     2This software was developed by the University of Tennessee as part of the 
    33Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    44project funded by the US National Science Foundation.  
  • src/sans/perspectives/calculator/resolution_calculator_panel.py

    r5777106 r51f14603  
    11""" 
    2    This software was developed by the University of Tennessee as part of the 
     2This software was developed by the University of Tennessee as part of the 
    33Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    44project funded by the US National Science Foundation.  
  • src/sans/perspectives/calculator/slit_length_calculator_panel.py

    r5777106 r51f14603  
    11""" 
    2    This software was developed by the University of Tennessee as part of the 
     2This software was developed by the University of Tennessee as part of the 
    33Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    44project funded by the US National Science Foundation.  
  • src/sans/perspectives/invariant/invariant_state.py

    r5777106 r51f14603  
    252252        : param file: file to write to 
    253253        : param doc: XML document object [optional] 
    254         : param entry_node: XML node within the XML document at which  
    255             we will append the data [optional]    
     254        : param entry_node: XML node within the XML document at which we will append the data [optional] 
    256255        """ 
    257256        from xml.dom.minidom import getDOMImplementation 
  • src/sans/plottools/SimpleFont.py

    ra9d5684 r51f14603  
    11 
    22""" 
    3 /** 
    4         This software was developed by Institut Laue-Langevin as part of 
    5         Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
     3This software was developed by Institut Laue-Langevin as part of 
     4Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 
    65 
    7         Copyright 2012 Institut Laue-Langevin 
    8  
    9 **/ 
    10  
     6Copyright 2012 Institut Laue-Langevin 
    117""" 
    128 
  • src/sans/plottools/plottables.py

    ra9d5684 r51f14603  
    343343    A transform has a number of attributes. 
    344344     
    345     name: user visible name for the transform.  This will 
    346         appear in the context menu for the axis and the transform 
    347         menu for the graph. 
    348          
    349     type: operational axis.  This determines whether the 
    350         transform should appear on x,y or z axis context 
    351         menus, or if it should appear in the context menu for 
    352         the graph. 
    353          
    354     inventory: (not implemented)  
    355         a dictionary of user settable parameter names and 
    356         their associated types.  These should appear as keyword 
    357         arguments to the transform call.  For example, Fresnel 
    358         reflectivity requires the substrate density: 
    359              { 'rho': type.Value(10e-6/units.angstrom**2) } 
    360               
    361         Supply reasonable defaults in the callback so that 
    362         limited plotting clients work even though they cannot 
    363         set the inventory. 
     345    name 
     346      user visible name for the transform.  This will 
     347      appear in the context menu for the axis and the transform 
     348      menu for the graph. 
     349         
     350    type 
     351      operational axis.  This determines whether the 
     352      transform should appear on x,y or z axis context 
     353      menus, or if it should appear in the context menu for 
     354      the graph. 
     355         
     356    inventory 
     357      (not implemented)  
     358      a dictionary of user settable parameter names and 
     359      their associated types.  These should appear as keyword 
     360      arguments to the transform call.  For example, Fresnel 
     361      reflectivity requires the substrate density: 
     362      ``{ 'rho': type.Value(10e-6/units.angstrom**2) }``        
     363      Supply reasonable defaults in the callback so that 
     364      limited plotting clients work even though they cannot 
     365      set the inventory. 
    364366         
    365367    """ 
  • src/sans/pr/invertor.py

    r5777106 r51f14603  
    6161     
    6262    In the following i refers to the ith base function coefficient. 
    63     The matrix has its entries j in its first Npts rows set to 
     63    The matrix has its entries j in its first Npts rows set to :: 
     64 
    6465        A[j][i] = (Fourier transformed base function for point j) 
    6566         
    6667    We them choose a number of r-points, n_r, to evaluate the second 
    6768    derivative of P(r) at. This is used as our regularization term. 
    68     For a vector r of length n_r, the following n_r rows are set to 
     69    For a vector r of length n_r, the following n_r rows are set to :: 
     70 
    6971        A[j+Npts][i] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, 
    7072        evaluated at r[j]) 
    7173         
    72     The vector b has its first Npts entries set to 
     74    The vector b has its first Npts entries set to :: 
     75 
    7376        b[j] = (I(q) observed for point j) 
    7477         
     
    7982     
    8083    Methods inherited from Cinvertor: 
    81     - get_peaks(pars): returns the number of P(r) peaks 
    82     - oscillations(pars): returns the oscillation parameters for the output P(r) 
    83     - get_positive(pars): returns the fraction of P(r) that is above zero 
    84     - get_pos_err(pars): returns the fraction of P(r) that is 1-sigma above zero 
     84 
     85    * ``get_peaks(pars)``: returns the number of P(r) peaks 
     86    * ``oscillations(pars)``: returns the oscillation parameters for the output P(r) 
     87    * ``get_positive(pars)``: returns the fraction of P(r) that is above zero 
     88    * ``get_pos_err(pars)``: returns the fraction of P(r) that is 1-sigma above zero 
    8589    """ 
    8690    ## Chisqr of the last computation 
     
    252256         
    253257        In the following i refers to the ith base function coefficient. 
    254         The matrix has its entries j in its first Npts rows set to 
     258        The matrix has its entries j in its first Npts rows set to :: 
     259 
    255260            A[i][j] = (Fourier transformed base function for point j) 
    256261             
    257262        We them choose a number of r-points, n_r, to evaluate the second 
    258263        derivative of P(r) at. This is used as our regularization term. 
    259         For a vector r of length n_r, the following n_r rows are set to 
     264        For a vector r of length n_r, the following n_r rows are set to :: 
     265 
    260266            A[i+Npts][j] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, evaluated at r[j]) 
    261267             
    262         The vector b has its first Npts entries set to 
     268        The vector b has its first Npts entries set to :: 
     269 
    263270            b[j] = (I(q) observed for point j) 
    264271             
     
    271278        :param nr: number of r points to evaluate the 2nd derivative at for the reg. term. 
    272279        :return: c_out, c_cov - the coefficients with covariance matrix 
    273          
    274280        """ 
    275281        # Reset the background value before proceeding 
     
    395401         
    396402        In the following i refers to the ith base function coefficient. 
    397         The matrix has its entries j in its first Npts rows set to 
     403        The matrix has its entries j in its first Npts rows set to :: 
     404 
    398405            A[i][j] = (Fourier transformed base function for point j) 
    399406             
    400407        We them choose a number of r-points, n_r, to evaluate the second 
    401408        derivative of P(r) at. This is used as our regularization term. 
    402         For a vector r of length n_r, the following n_r rows are set to 
     409        For a vector r of length n_r, the following n_r rows are set to :: 
     410 
    403411            A[i+Npts][j] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, 
    404412            evaluated at r[j]) 
    405413             
    406         The vector b has its first Npts entries set to 
     414        The vector b has its first Npts entries set to :: 
     415 
    407416            b[j] = (I(q) observed for point j) 
    408417             
     
    413422         
    414423        :param nfunc: number of base functions to use. 
    415         :param nr: number of r points to evaluate the 2nd derivative at 
    416             for the reg. term. 
     424        :param nr: number of r points to evaluate the 2nd derivative at for the reg. term. 
    417425 
    418426        If the result does not allow us to compute the covariance matrix, 
     
    512520        number of terms 
    513521         
    514         :param isquit_func: reference to thread function to call to 
    515                             check whether the computation needs to 
    516                             be stopped. 
     522        :param isquit_func: 
     523          reference to thread function to call to check whether the computation needs to 
     524          be stopped. 
    517525         
    518526        :return: number of terms, alpha, message 
  • test/sansmodels/test/utest_newstylemodels.py

    r5777106 r51f14603  
    6363            print self.model.other 
    6464        self.assertRaises(AttributeError, setother) 
    65          
    66 class TestAdaptor(unittest.TestCase): 
    67     """ 
    68         Testing C++ Cylinder model 
    69     """ 
    70     def setUp(self): 
    71         from sans.models.NewCylinderModel import CylinderModel 
    72         self.model = CylinderModel() 
    73          
    74          
    75     def test_setparam(self): 
    76         self.model.setParam("length", 151.0) 
    77         self.assertEquals(self.model.getParam("length"), 151.0) 
    78          
    79          
    80          
    81         print self.model(0.001) 
    82         print self.model.parameters['length'] 
    83         self.model.setParam("length", 250.0) 
    84         self.assertEquals(self.model.getParam("length"), 250.0) 
    85          
    86         print self.model.parameters['length'] 
    87         print self.model(0.001) 
    88          
    89      
    9065   
    9166if __name__ == '__main__': 
Note: See TracChangeset for help on using the changeset viewer.