source: sasmodels/api/kernelpy.html @ 68532f3

gh-pages
Last change on this file since 68532f3 was 68532f3, checked in by ajj, 8 years ago

Adding docs

  • Property mode set to 100644
File size: 7.2 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8   
9    <title>3.9. Python model evaluator &mdash; Sasmodels</title>
10   
11    <link rel="stylesheet" href="../_static/haiku-site.css" type="text/css" />
12    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13   
14    <script type="text/javascript">
15      var DOCUMENTATION_OPTIONS = {
16        URL_ROOT:    '../',
17        VERSION:     '0.9',
18        COLLAPSE_INDEX: false,
19        FILE_SUFFIX: '.html',
20        HAS_SOURCE:  true
21      };
22    </script>
23    <script type="text/javascript" src="../_static/jquery.js"></script>
24    <script type="text/javascript" src="../_static/underscore.js"></script>
25    <script type="text/javascript" src="../_static/doctools.js"></script>
26    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
27    <link rel="top" title="Sasmodels" href="../index.html" />
28    <link rel="up" title="3. Reference" href="index.html" />
29    <link rel="next" title="3.10. Unit test support" href="model_test.html" />
30    <link rel="prev" title="3.8. Ctypes model evaluator" href="kerneldll.html" /> 
31  </head>
32  <body>
33      <div class="header"><h1 class="heading"><a href="../index.html">
34          <span>Home</span></a></h1>
35        <h2 class="heading"><span>3.9. Python model evaluator</span></h2>
36      </div>
37      <div class="topnav">
38     
39        <p>
40        «&#160;&#160;<a href="kerneldll.html">3.8. Ctypes model evaluator</a>
41        &#160;&#160;::&#160;&#160;
42        <a class="uplink" href="../index.html">Contents</a>
43        &#160;&#160;::&#160;&#160;
44        <a href="model_test.html">3.10. Unit test support</a>&#160;&#160;»
45        </p>
46
47      </div>
48      <div class="content">
49       
50       
51  <div class="section" id="python-model-evaluator">
52<h1>3.9. Python model evaluator<a class="headerlink" href="#python-model-evaluator" title="Permalink to this headline">¶</a></h1>
53<div class="section" id="module-sasmodels.kernelpy">
54<span id="sasmodels-kernelpy"></span><h2>3.9.1. <a class="reference internal" href="#module-sasmodels.kernelpy" title="sasmodels.kernelpy"><tt class="xref py py-mod docutils literal"><span class="pre">sasmodels.kernelpy</span></tt></a><a class="headerlink" href="#module-sasmodels.kernelpy" title="Permalink to this headline">¶</a></h2>
55<dl class="class">
56<dt id="sasmodels.kernelpy.PyInput">
57<em class="property">class </em><tt class="descclassname">sasmodels.kernelpy.</tt><tt class="descname">PyInput</tt><big>(</big><em>q_vectors</em>, <em>dtype</em><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyInput" title="Permalink to this definition">¶</a></dt>
58<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
59<p>Make q data available to the gpu.</p>
60<p><em>q_vectors</em> is a list of q vectors, which will be <em>[q]</em> for 1-D data,
61and <em>[qx, qy]</em> for 2-D data.  Internally, the vectors will be reallocated
62to get the best performance on OpenCL, which may involve shifting and
63stretching the array to better match the memory architecture.  Additional
64points will be evaluated with <em>q=1e-3</em>.</p>
65<p><em>dtype</em> is the data type for the q vectors. The data type should be
66set to match that of the kernel, which is an attribute of
67<tt class="xref py py-class docutils literal"><span class="pre">GpuProgram</span></tt>.  Note that not all kernels support double
68precision, so even if the program was created for double precision,
69the <em>GpuProgram.dtype</em> may be single precision.</p>
70<p>Call <a class="reference internal" href="#sasmodels.kernelpy.PyInput.release" title="sasmodels.kernelpy.PyInput.release"><tt class="xref py py-meth docutils literal"><span class="pre">release()</span></tt></a> when complete.  Even if not called directly, the
71buffer will be released when the data object is freed.</p>
72<dl class="method">
73<dt id="sasmodels.kernelpy.PyInput.release">
74<tt class="descname">release</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyInput.release" title="Permalink to this definition">¶</a></dt>
75<dd></dd></dl>
76
77</dd></dl>
78
79<dl class="class">
80<dt id="sasmodels.kernelpy.PyKernel">
81<em class="property">class </em><tt class="descclassname">sasmodels.kernelpy.</tt><tt class="descname">PyKernel</tt><big>(</big><em>kernel</em>, <em>info</em>, <em>q_input</em><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyKernel" title="Permalink to this definition">¶</a></dt>
82<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
83<p>Callable SAS kernel.</p>
84<p><em>kernel</em> is the DllKernel object to call.</p>
85<p><em>info</em> is the module information</p>
86<p><em>q_input</em> is the DllInput q vectors at which the kernel should be
87evaluated.</p>
88<p>The resulting call method takes the <em>pars</em>, a list of values for
89the fixed parameters to the kernel, and <em>pd_pars</em>, a list of (value,weight)
90vectors for the polydisperse parameters.  <em>cutoff</em> determines the
91integration limits: any points with combined weight less than <em>cutoff</em>
92will not be calculated.</p>
93<p>Call <a class="reference internal" href="#sasmodels.kernelpy.PyKernel.release" title="sasmodels.kernelpy.PyKernel.release"><tt class="xref py py-meth docutils literal"><span class="pre">release()</span></tt></a> when done with the kernel instance.</p>
94<dl class="method">
95<dt id="sasmodels.kernelpy.PyKernel.release">
96<tt class="descname">release</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyKernel.release" title="Permalink to this definition">¶</a></dt>
97<dd></dd></dl>
98
99</dd></dl>
100
101<dl class="class">
102<dt id="sasmodels.kernelpy.PyModel">
103<em class="property">class </em><tt class="descclassname">sasmodels.kernelpy.</tt><tt class="descname">PyModel</tt><big>(</big><em>info</em><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyModel" title="Permalink to this definition">¶</a></dt>
104<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
105<dl class="method">
106<dt id="sasmodels.kernelpy.PyModel.make_input">
107<tt class="descname">make_input</tt><big>(</big><em>q_vectors</em><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyModel.make_input" title="Permalink to this definition">¶</a></dt>
108<dd></dd></dl>
109
110<dl class="method">
111<dt id="sasmodels.kernelpy.PyModel.release">
112<tt class="descname">release</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.kernelpy.PyModel.release" title="Permalink to this definition">¶</a></dt>
113<dd></dd></dl>
114
115</dd></dl>
116
117</div>
118</div>
119
120
121      </div>
122      <div class="bottomnav">
123     
124        <p>
125        «&#160;&#160;<a href="kerneldll.html">3.8. Ctypes model evaluator</a>
126        &#160;&#160;::&#160;&#160;
127        <a class="uplink" href="../index.html">Contents</a>
128        &#160;&#160;::&#160;&#160;
129        <a href="model_test.html">3.10. Unit test support</a>&#160;&#160;»
130        </p>
131
132      </div>
133
134    <div class="footer">
135        &copy; Copyright 2014, sasview team.
136      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
137    </div>
138  </body>
139</html>
Note: See TracBrowser for help on using the repository browser.