Skip to content

Commit

Permalink
Generated gh-pages for commit 2068558
Browse files Browse the repository at this point in the history
Merge: a476f61 3ef83bc
Author: Giulio Ungaretti <[email protected]>

    Merge pull request #319 from qdev-dk/feature/remove_mp
  • Loading branch information
Documentation Bot committed Oct 2, 2016
1 parent f3cd426 commit d848bdb
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 39 deletions.
34 changes: 18 additions & 16 deletions _modules/qcodes/data/data_set.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>


<div class="viewcode-block" id="new_data"><a class="viewcode-back" href="../../../api/generated/qcodes.new_data.html#qcodes.new_data">[docs]</a><span class="k">def</span> <span class="nf">new_data</span><span class="p">(</span><span class="n">location</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">loc_record</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
<span class="n">io</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_manager</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">DataMode</span><span class="o">.</span><span class="n">LOCAL</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">io</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_manager</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">DataMode</span><span class="o">.</span><span class="n">LOCAL</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="c1"># NOTE(giulioungaretti): leave this docstrings as it is, because</span>
<span class="c1"># documenting the types is silly in this case.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create a new DataSet.</span>

Expand Down Expand Up @@ -190,11 +192,11 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="sd"> says the root data directory is the current working directory, ie</span>
<span class="sd"> where you started the python session.</span>

<span class="sd"> data_manager (DataManager or False, optional): manager for the</span>
<span class="sd"> ``DataServer`` that offloads storage and syncing of this</span>
<span class="sd"> ``DataSet``. Usually omitted (default None) to use the default</span>
<span class="sd"> from ``get_data_manager()``. If ``False``, this ``DataSet`` will</span>
<span class="sd"> store itself.</span>
<span class="sd"> data_manager (Optional[bool]): use a manager for the</span>
<span class="sd"> ``DataServer`` that offloads storage and syncing of this Defaults</span>
<span class="sd"> to ``False`` i.e. this ``DataSet`` will store itself without extra</span>
<span class="sd"> processes. Set to ``True`` to use the default from</span>
<span class="sd"> ``get_data_manager()``.</span>

<span class="sd"> mode (DataMode, optional): connection type to the ``DataServer``.</span>
<span class="sd"> ``DataMode.LOCAL``: this DataSet doesn&#39;t communicate across</span>
Expand Down Expand Up @@ -238,11 +240,11 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">location</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="n">overwrite</span><span class="p">)</span> <span class="ow">and</span> <span class="n">io</span><span class="o">.</span><span class="n">list</span><span class="p">(</span><span class="n">location</span><span class="p">):</span>
<span class="k">raise</span> <span class="n">FileExistsError</span><span class="p">(</span><span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="n">location</span> <span class="o">+</span> <span class="s1">&#39;&quot; already has data&#39;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">data_manager</span> <span class="ow">is</span> <span class="bp">False</span><span class="p">:</span>
<span class="k">if</span> <span class="n">data_manager</span> <span class="ow">is</span> <span class="bp">True</span><span class="p">:</span>
<span class="n">data_manager</span> <span class="o">=</span> <span class="n">get_data_manager</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">mode</span> <span class="o">!=</span> <span class="n">DataMode</span><span class="o">.</span><span class="n">LOCAL</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;DataSets without a data_manager must be local&#39;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">data_manager</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">data_manager</span> <span class="o">=</span> <span class="n">get_data_manager</span><span class="p">()</span>

<span class="k">return</span> <span class="n">DataSet</span><span class="p">(</span><span class="n">location</span><span class="o">=</span><span class="n">location</span><span class="p">,</span> <span class="n">io</span><span class="o">=</span><span class="n">io</span><span class="p">,</span> <span class="n">data_manager</span><span class="o">=</span><span class="n">data_manager</span><span class="p">,</span>
<span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
Expand Down Expand Up @@ -339,11 +341,11 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="sd"> says the root data directory is the current working directory, ie</span>
<span class="sd"> where you started the python session.</span>

<span class="sd"> data_manager (DataManager or False, optional): manager for the</span>
<span class="sd"> ``DataServer`` that offloads storage and syncing of this</span>
<span class="sd"> ``DataSet``. Usually omitted (default None) to use the default</span>
<span class="sd"> from ``get_data_manager()``. If ``False``, this ``DataSet`` will</span>
<span class="sd"> store itself.</span>
<span class="sd"> data_manager (Optional[bool]): use a manager for the</span>
<span class="sd"> ``DataServer`` that offloads storage and syncing of this Defaults</span>
<span class="sd"> to ``False`` i.e. this ``DataSet`` will store itself without extra</span>
<span class="sd"> processes. Set to ``True`` to use the default from</span>
<span class="sd"> ``get_data_manager()``.</span>

<span class="sd"> mode (DataMode, optional): connection type to the ``DataServer``.</span>
<span class="sd"> ``DataMode.LOCAL``: this DataSet doesn&#39;t communicate across</span>
Expand Down Expand Up @@ -391,7 +393,7 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="n">background_functions</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">()</span>

<div class="viewcode-block" id="DataSet.__init__"><a class="viewcode-back" href="../../../api/generated/qcodes.DataSet.html#qcodes.DataSet.__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">location</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">DataMode</span><span class="o">.</span><span class="n">LOCAL</span><span class="p">,</span> <span class="n">arrays</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
<span class="n">data_manager</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">formatter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">io</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">write_period</span><span class="o">=</span><span class="mi">5</span><span class="p">):</span>
<span class="n">data_manager</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">formatter</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">io</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">write_period</span><span class="o">=</span><span class="mi">5</span><span class="p">):</span>
<span class="k">if</span> <span class="n">location</span> <span class="ow">is</span> <span class="bp">False</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">location</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">location</span> <span class="o">=</span> <span class="n">location</span>
<span class="k">else</span><span class="p">:</span>
Expand All @@ -414,7 +416,7 @@ <h1>Source code for qcodes.data.data_set</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">array</span> <span class="ow">in</span> <span class="n">arrays</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_array</span><span class="p">(</span><span class="n">array</span><span class="p">)</span>

<span class="k">if</span> <span class="n">data_manager</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">mode</span> <span class="ow">in</span> <span class="n">SERVER_MODES</span><span class="p">:</span>
<span class="k">if</span> <span class="n">data_manager</span> <span class="ow">is</span> <span class="bp">True</span> <span class="ow">and</span> <span class="n">mode</span> <span class="ow">in</span> <span class="n">SERVER_MODES</span><span class="p">:</span>
<span class="n">data_manager</span> <span class="o">=</span> <span class="n">get_data_manager</span><span class="p">()</span>

<span class="k">if</span> <span class="n">mode</span> <span class="o">==</span> <span class="n">DataMode</span><span class="o">.</span><span class="n">LOCAL</span><span class="p">:</span>
Expand Down
8 changes: 5 additions & 3 deletions _modules/qcodes/instrument/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@

<h1>Source code for qcodes.instrument.base</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Instrument base class.&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">weakref</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">import</span> <span class="nn">weakref</span>

<span class="kn">from</span> <span class="nn">qcodes.utils.metadata</span> <span class="kn">import</span> <span class="n">Metadatable</span>
<span class="kn">from</span> <span class="nn">qcodes.utils.helpers</span> <span class="kn">import</span> <span class="n">DelegateAttributes</span><span class="p">,</span> <span class="n">strip_attrs</span><span class="p">,</span> <span class="n">full_class</span>
Expand Down Expand Up @@ -208,11 +209,12 @@ <h1>Source code for qcodes.instrument.base</h1><div class="highlight"><pre>

<span class="n">_all_instruments</span> <span class="o">=</span> <span class="p">{}</span>

<span class="k">def</span> <span class="nf">__new__</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">server_name</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__new__</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">server_name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Figure out whether to create a base instrument or proxy.&quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">server_name</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">__new__</span><span class="p">(</span><span class="n">cls</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Multiprocessing is in beta, use at own risk&quot;</span><span class="p">,</span> <span class="ne">UserWarning</span><span class="p">)</span>
<span class="k">return</span> <span class="n">RemoteInstrument</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">instrument_class</span><span class="o">=</span><span class="n">cls</span><span class="p">,</span>
<span class="n">server_name</span><span class="o">=</span><span class="n">server_name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

Expand Down
Loading

0 comments on commit d848bdb

Please sign in to comment.