Skip to content

Commit

Permalink
Generated gh-pages for commit 30a9c3d
Browse files Browse the repository at this point in the history
Merge: f3324a5 9deaec1
Author: Jens Hedegaard Nielsen <[email protected]>

    Merge pull request #403 from alexcjohnson/docs/params
  • Loading branch information
Documentation Bot committed Jan 19, 2017
1 parent 78b72d3 commit 85e2af4
Show file tree
Hide file tree
Showing 48 changed files with 2,091 additions and 871 deletions.
27 changes: 19 additions & 8 deletions _modules/qcodes/data/data_array.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">collections</span>

<span class="kn">from</span> <span class="nn">qcodes.utils.helpers</span> <span class="k">import</span> <span class="n">DelegateAttributes</span><span class="p">,</span> <span class="n">full_class</span>
<span class="kn">from</span> <span class="nn">qcodes.utils.helpers</span> <span class="k">import</span> <span class="n">DelegateAttributes</span><span class="p">,</span> <span class="n">full_class</span><span class="p">,</span> <span class="n">warn_units</span>


<div class="viewcode-block" id="DataArray"><a class="viewcode-back" href="../../../auto/qcodes.data.html#qcodes.DataArray">[docs]</a><span class="k">class</span> <span class="nc">DataArray</span><span class="p">(</span><span class="n">DelegateAttributes</span><span class="p">):</span>
Expand Down Expand Up @@ -168,7 +168,7 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span class="sd"> Args:</span>
<span class="sd"> parameter (Optional[Parameter]): The parameter whose values will</span>
<span class="sd"> populate this array, if any. Will copy ``name``, ``full_name``,</span>
<span class="sd"> ``label``, ``units``, and ``snapshot`` from here unless you</span>
<span class="sd"> ``label``, ``unit``, and ``snapshot`` from here unless you</span>
<span class="sd"> provide them explicitly.</span>

<span class="sd"> name (Optional[str]): The short name of this array.</span>
Expand Down Expand Up @@ -207,7 +207,9 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span class="sd"> handle converting this to array_id internally (maybe it</span>
<span class="sd"> already does?)</span>

<span class="sd"> units (Optional[str]): The units of the values stored in this array.</span>
<span class="sd"> unit (Optional[str]): The unit of the values stored in this array.</span>

<span class="sd"> units (Optional[str]): DEPRECATED, redirects to ``unit``.</span>

<span class="sd"> is_setpoint (bool): True if this is a setpoint array, False if it</span>
<span class="sd"> is measured. Default False.</span>
Expand All @@ -223,7 +225,7 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span class="s1">&#39;array_id&#39;</span><span class="p">,</span>
<span class="s1">&#39;name&#39;</span><span class="p">,</span>
<span class="s1">&#39;shape&#39;</span><span class="p">,</span>
<span class="s1">&#39;units&#39;</span><span class="p">,</span>
<span class="s1">&#39;unit&#39;</span><span class="p">,</span>
<span class="s1">&#39;label&#39;</span><span class="p">,</span>
<span class="s1">&#39;action_indices&#39;</span><span class="p">,</span>
<span class="s1">&#39;is_setpoint&#39;</span><span class="p">)</span>
Expand All @@ -233,7 +235,7 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span class="n">COPY_ATTRS_FROM_INPUT</span> <span class="o">=</span> <span class="p">(</span>
<span class="s1">&#39;name&#39;</span><span class="p">,</span>
<span class="s1">&#39;label&#39;</span><span class="p">,</span>
<span class="s1">&#39;units&#39;</span><span class="p">)</span>
<span class="s1">&#39;unit&#39;</span><span class="p">)</span>

<span class="c1"># keys in the parameter snapshot to omit from our snapshot</span>
<span class="n">SNAP_OMIT_KEYS</span> <span class="o">=</span> <span class="p">(</span>
Expand All @@ -247,13 +249,17 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>

<div class="viewcode-block" id="DataArray.__init__"><a class="viewcode-back" href="../../../api/generated/qcodes.DataArray.html#qcodes.DataArray.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parameter</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">full_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">snapshot</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">array_id</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">set_arrays</span><span class="o">=</span><span class="p">(),</span> <span class="n">shape</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">action_indices</span><span class="o">=</span><span class="p">(),</span> <span class="n">units</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">is_setpoint</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">action_indices</span><span class="o">=</span><span class="p">(),</span> <span class="n">unit</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">units</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">is_setpoint</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">preset_data</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
<span class="bp">self</span><span class="o">.</span><span class="n">full_name</span> <span class="o">=</span> <span class="n">full_name</span> <span class="ow">or</span> <span class="n">name</span>
<span class="bp">self</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="n">label</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shape</span> <span class="o">=</span> <span class="n">shape</span>
<span class="bp">self</span><span class="o">.</span><span class="n">units</span> <span class="o">=</span> <span class="n">units</span>
<span class="k">if</span> <span class="n">units</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">warn_units</span><span class="p">(</span><span class="s1">&#39;DataArray&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span>
<span class="k">if</span> <span class="n">unit</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">unit</span> <span class="o">=</span> <span class="n">units</span>
<span class="bp">self</span><span class="o">.</span><span class="n">unit</span> <span class="o">=</span> <span class="n">unit</span>
<span class="bp">self</span><span class="o">.</span><span class="n">array_id</span> <span class="o">=</span> <span class="n">array_id</span>
<span class="bp">self</span><span class="o">.</span><span class="n">is_setpoint</span> <span class="o">=</span> <span class="n">is_setpoint</span>
<span class="bp">self</span><span class="o">.</span><span class="n">action_indices</span> <span class="o">=</span> <span class="n">action_indices</span>
Expand Down Expand Up @@ -656,7 +662,12 @@ <h1>Source code for qcodes.data.data_array</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;synced_index&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">last_index</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">last_index</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">synced_index</span><span class="p">)</span>

<span class="k">return</span> <span class="p">(</span><span class="n">last_index</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">ndarray</span><span class="o">.</span><span class="n">size</span></div></div>
<span class="k">return</span> <span class="p">(</span><span class="n">last_index</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">ndarray</span><span class="o">.</span><span class="n">size</span></div>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">units</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">warn_units</span><span class="p">(</span><span class="s1">&#39;DataArray&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">unit</span></div>
</pre></div>

</div>
Expand Down
17 changes: 16 additions & 1 deletion _modules/qcodes/data/data_set.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>

<span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="p">{}</span>

<span class="bp">self</span><span class="o">.</span><span class="n">arrays</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">arrays</span> <span class="o">=</span> <span class="n">_PrettyPrintDict</span><span class="p">()</span>
<span class="k">if</span> <span class="n">arrays</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">action_id_map</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_clean_array_ids</span><span class="p">(</span><span class="n">arrays</span><span class="p">)</span>
<span class="k">for</span> <span class="n">array</span> <span class="ow">in</span> <span class="n">arrays</span><span class="p">:</span>
Expand Down Expand Up @@ -1003,6 +1003,21 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="n">out</span> <span class="o">+=</span> <span class="n">out_template</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">info</span><span class="o">=</span><span class="n">arr_info_i</span><span class="p">,</span> <span class="n">lens</span><span class="o">=</span><span class="n">column_lengths</span><span class="p">)</span>

<span class="k">return</span> <span class="n">out</span></div></div>


<span class="k">class</span> <span class="nc">_PrettyPrintDict</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> simple wrapper for a dict to repr its items on separate lines</span>
<span class="sd"> with a bit of indentation</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">body</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1"> &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="nb">repr</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;: &#39;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_indent</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">v</span><span class="p">))</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">items</span><span class="p">()])</span>
<span class="k">return</span> <span class="s1">&#39;{</span><span class="se">\n</span><span class="s1"> &#39;</span> <span class="o">+</span> <span class="n">body</span> <span class="o">+</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">}&#39;</span>

<span class="k">def</span> <span class="nf">_indent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">s</span><span class="p">):</span>
<span class="n">lines</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">return</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1"> &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lines</span><span class="p">)</span>
</pre></div>

</div>
Expand Down
Loading

0 comments on commit 85e2af4

Please sign in to comment.