Skip to content

Commit

Permalink
Generated gh-pages for commit 4880bef
Browse files Browse the repository at this point in the history
Author: Serwan Asaad <serwan.asaad@gmail.com>

    fix: MatPlot.rescale_axis fixes (#875)
  • Loading branch information
Documentation Bot committed Dec 4, 2017
1 parent e755d86 commit 84ff48a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
18 changes: 13 additions & 5 deletions _modules/qcodes/plots/qcmatplotlib.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>

<span class="kn">from</span> <span class="nn">.base</span> <span class="k">import</span> <span class="n">BasePlot</span>
<span class="kn">import</span> <span class="nn">qcodes.config</span>
<span class="kn">from</span> <span class="nn">qcodes.data.data_array</span> <span class="k">import</span> <span class="n">DataArray</span>


<div class="viewcode-block" id="MatPlot"><a class="viewcode-back" href="../../../api/generated/qcodes.plots.qcmatplotlib.MatPlot.html#qcodes.plots.qcmatplotlib.MatPlot">[docs]</a><span class="k">class</span> <span class="nc">MatPlot</span><span class="p">(</span><span class="n">BasePlot</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
Expand Down Expand Up @@ -220,7 +222,7 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>
<span class="n">subplots</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="mi">1</span><span class="p">)</span>

<span class="bp">self</span><span class="o">.</span><span class="n">_init_plot</span><span class="p">(</span><span class="n">subplots</span><span class="p">,</span> <span class="n">figsize</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="n">num</span><span class="p">)</span>

<span class="c1"># Add data to plot if passed in args, kwargs are passed to all subplots</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">):</span>
Expand Down Expand Up @@ -582,11 +584,17 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="s2">&quot;</span><span class="si">{0:g}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span> <span class="o">*</span> <span class="n">scale</span><span class="p">)</span>

<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">subplot</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subplots</span><span class="p">):</span>
<span class="n">traces</span> <span class="o">=</span> <span class="p">[</span><span class="n">trace</span> <span class="k">for</span> <span class="n">trace</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">traces</span> <span class="k">if</span> <span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;subplot&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="o">==</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">traces</span><span class="p">:</span>
<span class="k">continue</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># TODO: include all traces when calculating maxval etc.</span>
<span class="n">trace</span> <span class="o">=</span> <span class="n">traces</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">for</span> <span class="n">axis</span> <span class="ow">in</span> <span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="s1">&#39;z&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">traces</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s1">&#39;config&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">axis</span><span class="p">):</span>
<span class="n">unit</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">traces</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">unit</span>
<span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">traces</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">label</span>
<span class="n">maxval</span> <span class="o">=</span> <span class="nb">abs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">traces</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span><span class="o">.</span><span class="n">max</span><span class="p">()</span>
<span class="k">if</span> <span class="n">axis</span> <span class="ow">in</span> <span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">],</span> <span class="n">DataArray</span><span class="p">):</span>
<span class="n">unit</span> <span class="o">=</span> <span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">unit</span>
<span class="n">label</span> <span class="o">=</span> <span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">label</span>
<span class="n">maxval</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmax</span><span class="p">(</span><span class="nb">abs</span><span class="p">(</span><span class="n">trace</span><span class="p">[</span><span class="s1">&#39;config&#39;</span><span class="p">][</span><span class="n">axis</span><span class="p">]</span><span class="o">.</span><span class="n">ndarray</span><span class="p">))</span>
<span class="n">units_to_scale</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">standardunits</span>

<span class="c1"># allow values up to a &lt;1000. i.e. nV is used up to 1000 nV</span>
Expand Down
2 changes: 1 addition & 1 deletion api/generated/qcodes.instrument_drivers.Advantech.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<p>Tested with driver version 3.1.10.0 and ddl version 3.1.12.1.</p>
<dl class="attribute">
<dt id="qcodes.instrument_drivers.Advantech.PCIE_1751.Advantech_PCIE_1751.ERRORMSG">
<code class="descname">ERRORMSG</code><em class="property"> = {0: 'The operation is completed successfully.', 2684354560: 'The interrupt resource is not available.', 2684354562: 'The property value is out of range.', 2684354563: 'The property value is not supported.', 2684354564: 'The property value conflicts with the current state.', 2684354565: 'The value range of all channels in a group should be same, such as 4~20mA of PCI-1724.', 3758096384: &quot;The handle is NULL or its type doesn't match the required operation.&quot;, 2684354561: 'The parameter is out of the range.', 3758096392: 'The required function is not supported.', 3758096393: 'The required event is not supported.', 3758096394: 'The required property is not supported.', 3758096395: 'The required property is read-only.', 3758096396: 'The specified property value conflicts with the current state.', 3758096386: 'The parameter value is not supported.', 3758096398: 'The specified property value is not supported.', 3758096397: 'The specified property value is out of range.', 3758096400: 'The required privilege is not available because someone else had own it.', 3758096401: 'The driver of specified device was not found.', 3758096402: 'The driver version of the specified device mismatched.', 3758096387: 'The parameter value format is not the expected.', 3758096404: 'The device is not opened.', 3758096405: 'The required device does not exist.', 3758096406: 'The required device is unrecognized by driver.', 3758096407: 'The configuration data of the specified device is lost or unavailable.', 3758096408: &quot;The function is not initialized and can't be started.&quot;, 3758096388: 'Not enough memory is available to complete the operation.', 3758096410: 'The interrupt resource is not available.', 3758096399: &quot;The handle hasn't own the privilege of the operation the user wanted.&quot;, 3758096412: 'Time out when reading/writing the device.', 3758096413: 'The given signature does not match with the device current one.', 3758096414: 'The function cannot be executed while the buffered AI is running.', 3758096389: 'The data buffer is null.', 3758096411: 'The DMA channel is not available.', 3758096385: 'The parameter value is out of range.', 3758096390: 'The data buffer is too small for the operation.', 3758096391: 'The data length exceeded the limitation.', 3758096403: 'The loaded driver count exceeded the limitation.', 3758096409: 'The function is busy.', 3758096415: 'The value range is not available in single-ended mode.', 3758161919: 'Undefined error.'}</em><a class="headerlink" href="#qcodes.instrument_drivers.Advantech.PCIE_1751.Advantech_PCIE_1751.ERRORMSG" title="Permalink to this definition"></a></dt>
<code class="descname">ERRORMSG</code><em class="property"> = {0: 'The operation is completed successfully.', 2684354560: 'The interrupt resource is not available.', 2684354561: 'The parameter is out of the range.', 2684354562: 'The property value is out of range.', 2684354563: 'The property value is not supported.', 2684354564: 'The property value conflicts with the current state.', 2684354565: 'The value range of all channels in a group should be same, such as 4~20mA of PCI-1724.', 3758096384: &quot;The handle is NULL or its type doesn't match the required operation.&quot;, 3758096385: 'The parameter value is out of range.', 3758096386: 'The parameter value is not supported.', 3758096387: 'The parameter value format is not the expected.', 3758096388: 'Not enough memory is available to complete the operation.', 3758096389: 'The data buffer is null.', 3758096390: 'The data buffer is too small for the operation.', 3758096391: 'The data length exceeded the limitation.', 3758096392: 'The required function is not supported.', 3758096393: 'The required event is not supported.', 3758096394: 'The required property is not supported.', 3758096395: 'The required property is read-only.', 3758096396: 'The specified property value conflicts with the current state.', 3758096397: 'The specified property value is out of range.', 3758096398: 'The specified property value is not supported.', 3758096399: &quot;The handle hasn't own the privilege of the operation the user wanted.&quot;, 3758096400: 'The required privilege is not available because someone else had own it.', 3758096401: 'The driver of specified device was not found.', 3758096402: 'The driver version of the specified device mismatched.', 3758096403: 'The loaded driver count exceeded the limitation.', 3758096404: 'The device is not opened.', 3758096405: 'The required device does not exist.', 3758096406: 'The required device is unrecognized by driver.', 3758096407: 'The configuration data of the specified device is lost or unavailable.', 3758096408: &quot;The function is not initialized and can't be started.&quot;, 3758096409: 'The function is busy.', 3758096410: 'The interrupt resource is not available.', 3758096411: 'The DMA channel is not available.', 3758096412: 'Time out when reading/writing the device.', 3758096413: 'The given signature does not match with the device current one.', 3758096414: 'The function cannot be executed while the buffered AI is running.', 3758096415: 'The value range is not available in single-ended mode.', 3758161919: 'Undefined error.'}</em><a class="headerlink" href="#qcodes.instrument_drivers.Advantech.PCIE_1751.Advantech_PCIE_1751.ERRORMSG" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
Expand Down
4 changes: 2 additions & 2 deletions api/generated/qcodes.instrument_drivers.QDev.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

<dl class="attribute">
<dt id="qcodes.instrument_drivers.QDev.QDac.QDac.voltage_range_status">
<code class="descname">voltage_range_status</code><em class="property"> = {'X 0.1': 1, 'X 1': 10}</em><a class="headerlink" href="#qcodes.instrument_drivers.QDev.QDac.QDac.voltage_range_status" title="Permalink to this definition"></a></dt>
<code class="descname">voltage_range_status</code><em class="property"> = {'X 1': 10, 'X 0.1': 1}</em><a class="headerlink" href="#qcodes.instrument_drivers.QDev.QDac.QDac.voltage_range_status" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
Expand Down Expand Up @@ -382,7 +382,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

<dl class="attribute">
<dt id="qcodes.instrument_drivers.QDev.QDac_channels.QDac.voltage_range_status">
<code class="descname">voltage_range_status</code><em class="property"> = {'X 0.1': 1, 'X 1': 10}</em><a class="headerlink" href="#qcodes.instrument_drivers.QDev.QDac_channels.QDac.voltage_range_status" title="Permalink to this definition"></a></dt>
<code class="descname">voltage_range_status</code><em class="property"> = {'X 1': 10, 'X 0.1': 1}</em><a class="headerlink" href="#qcodes.instrument_drivers.QDev.QDac_channels.QDac.voltage_range_status" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
Expand Down
4 changes: 2 additions & 2 deletions api/generated/qcodes.instrument_drivers.signal_hound.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

<dl class="attribute">
<dt id="qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus">
<code class="descname">saStatus</code><em class="property"> = {'saInternetErr': -12, 'saInvalidParameterErr': -4, 'saExternalReferenceNotFound': -89, 'saTrackingGeneratorNotFound': -10, 'saDeviceNotOpenErr': -3, 'saParameterClamped': 3, 'saFrequencyRangeErr': -99, 'saNoError': 0, 'saInvalidDetectorErr': -95, 'saDeviceNotFoundErr': -8, 'saNoCorrections': 1, 'saTooManyDevicesErr': -5, 'saDeviceNotConfiguredErr': -6, 'saUSBCommErr': -11, 'saOvenColdErr': -20, 'saUnknownErr': -666, 'saInvalidScaleErr': -94, 'saInvalidModeErr': -7, 'saNullPtrErr': -1, 'saDeviceNotIdleErr': -9, 'saInvalidDeviceErr': -2, 'saCompressionWarning': 2, 'saNotConfiguredErr': -6, 'saBandwidthErr': -91, 'saBandwidthClamped': 4}</em><a class="headerlink" href="#qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus" title="Permalink to this definition"></a></dt>
<code class="descname">saStatus</code><em class="property"> = {'saUnknownErr': -666, 'saFrequencyRangeErr': -99, 'saInvalidDetectorErr': -95, 'saInvalidScaleErr': -94, 'saBandwidthErr': -91, 'saExternalReferenceNotFound': -89, 'saOvenColdErr': -20, 'saInternetErr': -12, 'saUSBCommErr': -11, 'saTrackingGeneratorNotFound': -10, 'saDeviceNotIdleErr': -9, 'saDeviceNotFoundErr': -8, 'saInvalidModeErr': -7, 'saNotConfiguredErr': -6, 'saDeviceNotConfiguredErr': -6, 'saTooManyDevicesErr': -5, 'saInvalidParameterErr': -4, 'saDeviceNotOpenErr': -3, 'saInvalidDeviceErr': -2, 'saNullPtrErr': -1, 'saNoError': 0, 'saNoCorrections': 1, 'saCompressionWarning': 2, 'saParameterClamped': 3, 'saBandwidthClamped': 4}</em><a class="headerlink" href="#qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus_inverted">
<code class="descname">saStatus_inverted</code><em class="property"> = {0: 'saNoError', 1: 'saNoCorrections', 2: 'saCompressionWarning', 3: 'saParameterClamped', 4: 'saBandwidthClamped', -1: 'saNullPtrErr', -99: 'saFrequencyRangeErr', -95: 'saInvalidDetectorErr', -94: 'saInvalidScaleErr', -91: 'saBandwidthErr', -666: 'saUnknownErr', -89: 'saExternalReferenceNotFound', -20: 'saOvenColdErr', -12: 'saInternetErr', -11: 'saUSBCommErr', -10: 'saTrackingGeneratorNotFound', -9: 'saDeviceNotIdleErr', -8: 'saDeviceNotFoundErr', -7: 'saInvalidModeErr', -6: 'saNotConfiguredErr', -5: 'saTooManyDevicesErr', -4: 'saInvalidParameterErr', -3: 'saDeviceNotOpenErr', -2: 'saInvalidDeviceErr'}</em><a class="headerlink" href="#qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus_inverted" title="Permalink to this definition"></a></dt>
<code class="descname">saStatus_inverted</code><em class="property"> = {-666: 'saUnknownErr', -99: 'saFrequencyRangeErr', -95: 'saInvalidDetectorErr', -94: 'saInvalidScaleErr', -91: 'saBandwidthErr', -89: 'saExternalReferenceNotFound', -20: 'saOvenColdErr', -12: 'saInternetErr', -11: 'saUSBCommErr', -10: 'saTrackingGeneratorNotFound', -9: 'saDeviceNotIdleErr', -8: 'saDeviceNotFoundErr', -7: 'saInvalidModeErr', -6: 'saDeviceNotConfiguredErr', -5: 'saTooManyDevicesErr', -4: 'saInvalidParameterErr', -3: 'saDeviceNotOpenErr', -2: 'saInvalidDeviceErr', -1: 'saNullPtrErr', 0: 'saNoError', 1: 'saNoCorrections', 2: 'saCompressionWarning', 3: 'saParameterClamped', 4: 'saBandwidthClamped'}</em><a class="headerlink" href="#qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus_inverted" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
Expand Down
Loading

0 comments on commit 84ff48a

Please sign in to comment.