Changeset 51f14603 in sasview
- Timestamp:
- Apr 3, 2014 9:37:53 AM (11 years ago)
- 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
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/calculator/resolution_calculator.py
r5777106 r51f14603 473 473 """ 474 474 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) 477 476 : distance: [z, x] where z along the incident beam, x // qx_value 478 477 : comp: direction of the sigma; can be 'phi', 'y', 'x', and 'radial' -
src/sans/calculator/sans_gen.py
rf468791 r51f14603 197 197 """ 198 198 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 206 202 """ 207 203 if qdist.__class__.__name__ == 'list': … … 952 948 def set_sldms(self, sld_mx, sld_my, sld_mz): 953 949 """ 954 Sets ( |m|, m_theta, m_phi)950 Sets (\|m\|, m_theta, m_phi) 955 951 """ 956 952 if sld_mx.__class__.__name__ == 'float': -
src/sans/data_util/calcthread.py
r4bae1ef r51f14603 33 33 34 34 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 39 41 The update() and complete() calls accept field=value keyword 40 42 arguments which are passed to the called function. complete() … … 46 48 of the derived class. 47 49 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 unit52 thread.requeue(...,kw=...) replace work unit on the end of queue53 thread.reset(...,kw=...) reset the queue to the given work unit54 thread.stop() clear the queue and halt55 thread.interrupt() halt the current work unit but continue56 thread.ready(delay=0.) request an update signal after delay57 thread.isrunning() returns true if compute() is running50 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 58 60 59 61 Use queue() when all work must be done. Use requeue() when intermediate … … 63 65 stop() to halt the current and pending computations (e.g., in response to 64 66 a stop button). 65 67 66 68 The methods queue(), requeue() and reset() are proxies for the compute() 67 69 method in the subclass. Look there for a description of the arguments. … … 82 84 should be implemented vary from framework to framework. 83 85 84 For wx, something like the following is needed: 86 For wx, something like the following is needed: :: 85 87 86 88 import wx, wx.lib.newevent -
src/sans/data_util/registry.py
r4bae1ef r51f14603 15 15 Note that there may be multiple loaders for the same extension. 16 16 17 Example: 17 Example: :: 18 18 19 registry = ExtensionRegistry()19 registry = ExtensionRegistry() 20 20 21 # Add an association by setting an element22 registry['.zip'] = unzip23 24 # Multiple extensions for one loader25 registry['.tgz'] = untar26 registry['.tar.gz'] = untar21 # 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 27 27 28 # Generic extensions to use after trying more specific extensions;29 # these will be checked after the more specific extensions fail.30 registry['.gz'] = gunzip28 # Generic extensions to use after trying more specific extensions; 29 # these will be checked after the more specific extensions fail. 30 registry['.gz'] = gunzip 31 31 32 # Multiple loaders for one extension33 registry['.cx'] = cx134 registry['.cx'] = cx235 registry['.cx'] = cx332 # Multiple loaders for one extension 33 registry['.cx'] = cx1 34 registry['.cx'] = cx2 35 registry['.cx'] = cx3 36 36 37 # Show registered extensions38 print registry.extensions()39 40 # Can also register a format name for explicit control from caller41 registry['cx3'] = cx342 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() 43 43 44 # Retrieve loaders for a file name45 registry.lookup('hello.cx') -> [cx3,cx2,cx1]44 # Retrieve loaders for a file name 45 registry.lookup('hello.cx') -> [cx3,cx2,cx1] 46 46 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') -> 50 59 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 extension58 registry.load('hello.cx',format='cx3') ->59 return cx3('hello.cx')60 60 """ 61 61 def __init__(self, **kw): -
src/sans/fit/AbstractFitEngine.py
r5777106 r51f14603 557 557 558 558 :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 561 560 :param pars: the list of parameters to fit 562 561 :param constraints: list of … … 566 565 Example: 567 566 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),...,]`` 570 568 571 569 -
src/sans/fit/ParkFitting.py
r5777106 r51f14603 315 315 Set model parameter "M1"= model.name add {model.parameter.name:value}. 316 316 317 :note: Set_param() if used must always preceded set_model()318 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})`` 320 320 321 321 Add model with a dictionnary of FitArrangeList{} where Uid is a key … … 327 327 chisqr1, out1, cov1=engine.fit({model.parameter.name:value},qmin,qmax) 328 328 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 330 331 the user should make sure to call set_param himself. 331 332 -
src/sans/guiframe/CategoryManager.py
r5777106 r51f14603 2 2 3 3 """ 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 **/ 4 This software was developed by Institut Laue-Langevin as part of 5 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 6 7 Copyright 2012 Institut Laue-Langevin 12 8 13 9 """ -
src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py
r5777106 r51f14603 2 2 """ 3 3 Dialog 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 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 11 9 """ 12 10 import wx -
src/sans/guiframe/local_perspectives/plotting/boxSum.py
r5777106 r51f14603 259 259 Receive a dictionary and reset the slicer with values contained 260 260 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. 263 262 """ 264 263 x_max = math.fabs(params["Width"] )/2 -
src/sans/guiframe/plugin_base.py
r5777106 r51f14603 17 17 For example, a plug-in called Foo should be place in "perspectives/Foo". 18 18 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 * 23 24 24 25 26 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. 27 28 28 29 See dummyapp.py for a plugin example. -
src/sans/models/BaseComponent.py
r5777106 r51f14603 96 96 Evaluate a distribution of q-values. 97 97 98 * For 1D, a numpy array is expected as input: 98 * For 1D, a numpy array is expected as input: :: 99 99 100 100 evalDistribution(q) 101 101 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 102 131 where q is a numpy array. 103 132 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 130 134 """ 131 135 if qdist.__class__.__name__ == 'list': -
src/sans/models/Constant.py
r5777106 r51f14603 7 7 8 8 class 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 12 14 """ 13 15 -
src/sans/models/PolymerExclVolume.py
r5777106 r51f14603 25 25 Refer to that file and the structure it contains 26 26 for details of the model. 27 27 28 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] 32 34 33 35 """ -
src/sans/models/PowerLawAbsModel.py
r5777106 r51f14603 1 1 """ 2 Provide F(x) = scale* ( |x|)^(-m) + bkd2 Provide F(x) = scale* (\|x\|)^(-m) + bkd 3 3 Power law function as a BaseComponent model 4 4 """ … … 8 8 class PowerLawAbsModel(PowerLawModel): 9 9 """ 10 Class that evaluates a absolute Power_Law model.11 10 Class that evaluates a absolute Power_Law model. :: 11 12 12 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 18 19 """ 19 20 -
src/sans/models/TwoPowerLawModel.py
r5777106 r51f14603 17 17 =C*pow(qval,-1.0*power2) for q>qc 18 18 where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2). 19 19 20 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 25 27 """ 26 28 -
src/sans/models/c_extension/python_wrapper/WrapperGenerator.py
r230f479 r51f14603 126 126 buf = f.read() 127 127 128 self.default_list = " List of default parameters:\n"128 self.default_list = "\n List of default parameters:\n\n" 129 129 #lines = string.split(buf,'\n') 130 130 lines = buf.split('\n') … … 293 293 if len(toks2) >= 2: 294 294 units = toks2[1] 295 self.default_list += " 295 self.default_list += " * %-15s = %s %s\n" % \ 296 296 (toks[1], val, units) 297 297 -
src/sans/models/c_extension/python_wrapper/modelTemplate.txt
r230f479 r51f14603 16 16 Provide functionality for a C extension model 17 17 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 22 24 """ 23 25 -
src/sans/models/qsmearing.py
r5777106 r51f14603 500 500 Make fake data_x points extrapolated outside of the data_x points 501 501 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 514 512 """ 515 513 # Length of the width -
src/sans/perspectives/calculator/data_operator.py
rf468791 r51f14603 29 29 class DataOperPanel(wx.ScrolledWindow): 30 30 """ 31 :param data: when not empty the class can32 same information into a data object33 and post event containing the changed data object to some other frame34 31 """ 35 32 def __init__(self, parent, *args, **kwds): -
src/sans/perspectives/calculator/kiessig_calculator_panel.py
r5777106 r51f14603 1 1 """ 2 2 This software was developed by the University of Tennessee as part of the 3 3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 4 4 project funded by the US National Science Foundation. -
src/sans/perspectives/calculator/resolution_calculator_panel.py
r5777106 r51f14603 1 1 """ 2 2 This software was developed by the University of Tennessee as part of the 3 3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 4 4 project funded by the US National Science Foundation. -
src/sans/perspectives/calculator/slit_length_calculator_panel.py
r5777106 r51f14603 1 1 """ 2 2 This software was developed by the University of Tennessee as part of the 3 3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 4 4 project funded by the US National Science Foundation. -
src/sans/perspectives/invariant/invariant_state.py
r5777106 r51f14603 252 252 : param file: file to write to 253 253 : 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] 256 255 """ 257 256 from xml.dom.minidom import getDOMImplementation -
src/sans/plottools/SimpleFont.py
ra9d5684 r51f14603 1 1 2 2 """ 3 /** 4 This software was developed by Institut Laue-Langevin as part of 5 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 3 This software was developed by Institut Laue-Langevin as part of 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 6 5 7 Copyright 2012 Institut Laue-Langevin 8 9 **/ 10 6 Copyright 2012 Institut Laue-Langevin 11 7 """ 12 8 -
src/sans/plottools/plottables.py
ra9d5684 r51f14603 343 343 A transform has a number of attributes. 344 344 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. 364 366 365 367 """ -
src/sans/pr/invertor.py
r5777106 r51f14603 61 61 62 62 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 64 65 A[j][i] = (Fourier transformed base function for point j) 65 66 66 67 We them choose a number of r-points, n_r, to evaluate the second 67 68 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 69 71 A[j+Npts][i] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, 70 72 evaluated at r[j]) 71 73 72 The vector b has its first Npts entries set to 74 The vector b has its first Npts entries set to :: 75 73 76 b[j] = (I(q) observed for point j) 74 77 … … 79 82 80 83 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 85 89 """ 86 90 ## Chisqr of the last computation … … 252 256 253 257 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 255 260 A[i][j] = (Fourier transformed base function for point j) 256 261 257 262 We them choose a number of r-points, n_r, to evaluate the second 258 263 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 260 266 A[i+Npts][j] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, evaluated at r[j]) 261 267 262 The vector b has its first Npts entries set to 268 The vector b has its first Npts entries set to :: 269 263 270 b[j] = (I(q) observed for point j) 264 271 … … 271 278 :param nr: number of r points to evaluate the 2nd derivative at for the reg. term. 272 279 :return: c_out, c_cov - the coefficients with covariance matrix 273 274 280 """ 275 281 # Reset the background value before proceeding … … 395 401 396 402 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 398 405 A[i][j] = (Fourier transformed base function for point j) 399 406 400 407 We them choose a number of r-points, n_r, to evaluate the second 401 408 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 403 411 A[i+Npts][j] = (2nd derivative of P(r), d**2(P(r))/d(r)**2, 404 412 evaluated at r[j]) 405 413 406 The vector b has its first Npts entries set to 414 The vector b has its first Npts entries set to :: 415 407 416 b[j] = (I(q) observed for point j) 408 417 … … 413 422 414 423 :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. 417 425 418 426 If the result does not allow us to compute the covariance matrix, … … 512 520 number of terms 513 521 514 :param isquit_func: reference to thread function to call to515 516 522 :param isquit_func: 523 reference to thread function to call to check whether the computation needs to 524 be stopped. 517 525 518 526 :return: number of terms, alpha, message -
test/sansmodels/test/utest_newstylemodels.py
r5777106 r51f14603 63 63 print self.model.other 64 64 self.assertRaises(AttributeError, setother) 65 66 class TestAdaptor(unittest.TestCase):67 """68 Testing C++ Cylinder model69 """70 def setUp(self):71 from sans.models.NewCylinderModel import CylinderModel72 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 90 65 91 66 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.