Skip to content

Commit 84ff48a

Browse files
author
Documentation Bot
committed
Generated gh-pages for commit 4880bef
Author: Serwan Asaad <[email protected]> fix: MatPlot.rescale_axis fixes (#875)
1 parent e755d86 commit 84ff48a

6 files changed

+21
-13
lines changed

_modules/qcodes/plots/qcmatplotlib.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>
179179

180180
<span class="kn">from</span> <span class="nn">.base</span> <span class="k">import</span> <span class="n">BasePlot</span>
181181
<span class="kn">import</span> <span class="nn">qcodes.config</span>
182+
<span class="kn">from</span> <span class="nn">qcodes.data.data_array</span> <span class="k">import</span> <span class="n">DataArray</span>
183+
182184

183185
<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>
184186
<span class="sd">&quot;&quot;&quot;</span>
@@ -220,7 +222,7 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>
220222
<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>
221223

222224
<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>
223-
225+
224226
<span class="c1"># Add data to plot if passed in args, kwargs are passed to all subplots</span>
225227
<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>
226228
<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>
@@ -582,11 +584,17 @@ <h1>Source code for qcodes.plots.qcmatplotlib</h1><div class="highlight"><pre>
582584
<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>
583585

584586
<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>
587+
<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>
588+
<span class="k">if</span> <span class="ow">not</span> <span class="n">traces</span><span class="p">:</span>
589+
<span class="k">continue</span>
590+
<span class="k">else</span><span class="p">:</span>
591+
<span class="c1"># TODO: include all traces when calculating maxval etc.</span>
592+
<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>
585593
<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>
586-
<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>
587-
<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>
588-
<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>
589-
<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>
594+
<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>
595+
<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>
596+
<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>
597+
<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>
590598
<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>
591599

592600
<span class="c1"># allow values up to a &lt;1000. i.e. nV is used up to 1000 nV</span>

api/generated/qcodes.instrument_drivers.Advantech.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
232232
<p>Tested with driver version 3.1.10.0 and ddl version 3.1.12.1.</p>
233233
<dl class="attribute">
234234
<dt id="qcodes.instrument_drivers.Advantech.PCIE_1751.Advantech_PCIE_1751.ERRORMSG">
235-
<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>
235+
<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>
236236
<dd></dd></dl>
237237

238238
<dl class="method">

api/generated/qcodes.instrument_drivers.QDev.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
279279

280280
<dl class="attribute">
281281
<dt id="qcodes.instrument_drivers.QDev.QDac.QDac.voltage_range_status">
282-
<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>
282+
<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>
283283
<dd></dd></dl>
284284

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

383383
<dl class="attribute">
384384
<dt id="qcodes.instrument_drivers.QDev.QDac_channels.QDac.voltage_range_status">
385-
<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>
385+
<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>
386386
<dd></dd></dl>
387387

388388
<dl class="method">

api/generated/qcodes.instrument_drivers.signal_hound.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
318318

319319
<dl class="attribute">
320320
<dt id="qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus">
321-
<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>
321+
<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>
322322
<dd></dd></dl>
323323

324324
<dl class="attribute">
325325
<dt id="qcodes.instrument_drivers.signal_hound.USB_SA124B.SignalHound_USB_SA124B.saStatus_inverted">
326-
<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>
326+
<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>
327327
<dd></dd></dl>
328328

329329
<dl class="method">

0 commit comments

Comments
 (0)