Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshduran committed May 4, 2024
1 parent ddc7c4c commit 16bc799
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 52 deletions.
100 changes: 51 additions & 49 deletions docs/brukeropus.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ <h3 id="namespace">Namespace</h3>
</code></pre>
</div>

<p>All other file functions or classes can be directly imported from the <code><a href="brukeropus/file.html">brukeropus.file</a></code> submodule, e.g.:</p>
<p>All other file functions or classes can be directly imported from the <code><a href="brukeropus/file.html">brukeropus.file</a></code> or <code><a href="brukeropus/control.html">brukeropus.control</a></code>
submodules, e.g.:</p>

<div class="pdoc-code codehilite">
<pre><span></span><code><span class="kn">from</span> <span class="nn"><a href="brukeropus/file.html">brukeropus.file</a></span> <span class="kn">import</span> <span class="n">parse_file_and_print</span>
Expand All @@ -78,7 +79,7 @@ <h3 id="namespace">Namespace</h3>
</code></pre>
</div>

<p>as that namespace is subject to change. Instead import directly from <code><a href="">brukeropus</a></code> or its submodule <code><a href="brukeropus/file.html">brukeropus.file</a></code>.</p>
<p>as that namespace is subject to change. Instead import directly from <code><a href="">brukeropus</a></code> or its first level submodules.</p>

<h3 id="reading-opus-files-basic-usage">Reading OPUS Files (Basic Usage)</h3>

Expand Down Expand Up @@ -141,53 +142,54 @@ <h3 id="controlling-opus-software-basic-usage">Controlling OPUS Software (Basic
</span><span id="L-14"><a href="#L-14"><span class="linenos">14</span></a><span class="sd">```python</span>
</span><span id="L-15"><a href="#L-15"><span class="linenos">15</span></a><span class="sd">from brukeropus import find_opus_files, read_opus, OPUSFile, Opus</span>
</span><span id="L-16"><a href="#L-16"><span class="linenos">16</span></a><span class="sd">```</span>
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a><span class="sd">All other file functions or classes can be directly imported from the `brukeropus.file` submodule, e.g.:</span>
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a><span class="sd">```python</span>
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a><span class="sd">from brukeropus.file import parse_file_and_print</span>
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a><span class="sd">```</span>
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a><span class="sd">It is recommended that you do **not** import from the fully qualified namespace, e.g.:</span>
</span><span id="L-22"><a href="#L-22"><span class="linenos">22</span></a><span class="sd">```python</span>
</span><span id="L-23"><a href="#L-23"><span class="linenos">23</span></a><span class="sd">from brukeropus.file.utils import parse_file_and_print</span>
</span><span id="L-24"><a href="#L-24"><span class="linenos">24</span></a><span class="sd">```</span>
</span><span id="L-25"><a href="#L-25"><span class="linenos">25</span></a><span class="sd">as that namespace is subject to change. Instead import directly from `brukeropus` or its submodule `brukeropus.file`.</span>
</span><span id="L-26"><a href="#L-26"><span class="linenos">26</span></a>
</span><span id="L-27"><a href="#L-27"><span class="linenos">27</span></a><span class="sd">### Reading OPUS Files (Basic Usage)</span>
</span><span id="L-28"><a href="#L-28"><span class="linenos">28</span></a><span class="sd">```python</span>
</span><span id="L-29"><a href="#L-29"><span class="linenos">29</span></a><span class="sd">from brukeropus import read_opus</span>
</span><span id="L-30"><a href="#L-30"><span class="linenos">30</span></a><span class="sd">from matplotlib import pyplot as plt</span>
</span><span id="L-31"><a href="#L-31"><span class="linenos">31</span></a>
</span><span id="L-32"><a href="#L-32"><span class="linenos">32</span></a><span class="sd">opus_file = read_opus(&#39;file.0&#39;) # Returns an OPUSFile class</span>
</span><span id="L-33"><a href="#L-33"><span class="linenos">33</span></a>
</span><span id="L-34"><a href="#L-34"><span class="linenos">34</span></a><span class="sd">opus_file.print_parameters() # Pretty prints all metadata in the file to the console</span>
</span><span id="L-35"><a href="#L-35"><span class="linenos">35</span></a>
</span><span id="L-36"><a href="#L-36"><span class="linenos">36</span></a><span class="sd">if &#39;a&#39; in opus_file.data_keys: # If absorbance spectra was extracted from file</span>
</span><span id="L-37"><a href="#L-37"><span class="linenos">37</span></a><span class="sd"> plt.plot(opus_file.a.x, opus_file.a.y) # Plot absorbance spectra</span>
</span><span id="L-38"><a href="#L-38"><span class="linenos">38</span></a><span class="sd"> plt.title(opus_file.sfm + &#39; - &#39; + opus_file.snm) # Sets plot title to Sample Form - Sample Name</span>
</span><span id="L-39"><a href="#L-39"><span class="linenos">39</span></a><span class="sd"> plt.show() # Display plot</span>
</span><span id="L-40"><a href="#L-40"><span class="linenos">40</span></a><span class="sd">```</span>
</span><span id="L-41"><a href="#L-41"><span class="linenos">41</span></a><span class="sd">More detailed documentation on the file submodule can be found in `brukeropus.file`</span>
</span><span id="L-42"><a href="#L-42"><span class="linenos">42</span></a>
</span><span id="L-43"><a href="#L-43"><span class="linenos">43</span></a><span class="sd">### Controlling OPUS Software (Basic Usage)</span>
</span><span id="L-44"><a href="#L-44"><span class="linenos">44</span></a><span class="sd">```python</span>
</span><span id="L-45"><a href="#L-45"><span class="linenos">45</span></a><span class="sd">from brukeropus import opus, read_opus</span>
</span><span id="L-46"><a href="#L-46"><span class="linenos">46</span></a><span class="sd">from matplotlib import pyplot as plt</span>
</span><span id="L-47"><a href="#L-47"><span class="linenos">47</span></a>
</span><span id="L-48"><a href="#L-48"><span class="linenos">48</span></a><span class="sd">opus = Opus() # Connects to actively running OPUS software</span>
</span><span id="L-49"><a href="#L-49"><span class="linenos">49</span></a>
</span><span id="L-50"><a href="#L-50"><span class="linenos">50</span></a><span class="sd">apt_options = opus.get_param_options(&#39;apt&#39;) # Get all valid aperture settings</span>
</span><span id="L-51"><a href="#L-51"><span class="linenos">51</span></a>
</span><span id="L-52"><a href="#L-52"><span class="linenos">52</span></a><span class="sd">for apt in apt_options[2:-2]: # Loop over all but the two smallest and two largest aperature settings</span>
</span><span id="L-53"><a href="#L-53"><span class="linenos">53</span></a><span class="sd"> filepath = opus.measure_sample(apt=apt, nss=10, unload=True) # Perform measurement and unload file from OPUS</span>
</span><span id="L-54"><a href="#L-54"><span class="linenos">54</span></a><span class="sd"> data = read_opus(filepath) # Read OPUS file from measurement</span>
</span><span id="L-55"><a href="#L-55"><span class="linenos">55</span></a><span class="sd"> plt.plot(data.sm.x, data.sm.y, label=apt) # Plot single-channel sample spectra</span>
</span><span id="L-56"><a href="#L-56"><span class="linenos">56</span></a><span class="sd">plt.legend()</span>
</span><span id="L-57"><a href="#L-57"><span class="linenos">57</span></a><span class="sd">plt.show()</span>
</span><span id="L-58"><a href="#L-58"><span class="linenos">58</span></a><span class="sd">```</span>
</span><span id="L-59"><a href="#L-59"><span class="linenos">59</span></a><span class="sd">More detailed documentation on the control submodule can be found in `brukeropus.control`.</span>
</span><span id="L-60"><a href="#L-60"><span class="linenos">60</span></a><span class="sd">&#39;&#39;&#39;</span>
</span><span id="L-61"><a href="#L-61"><span class="linenos">61</span></a>
</span><span id="L-62"><a href="#L-62"><span class="linenos">62</span></a><span class="kn">from</span> <span class="nn">brukeropus.file</span> <span class="kn">import</span> <span class="n">OPUSFile</span><span class="p">,</span> <span class="n">read_opus</span><span class="p">,</span> <span class="n">find_opus_files</span>
</span><span id="L-63"><a href="#L-63"><span class="linenos">63</span></a><span class="kn">from</span> <span class="nn">brukeropus.control</span> <span class="kn">import</span> <span class="n">Opus</span>
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a><span class="sd">All other file functions or classes can be directly imported from the `brukeropus.file` or `brukeropus.control`</span>
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a><span class="sd">submodules, e.g.:</span>
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a><span class="sd">```python</span>
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a><span class="sd">from brukeropus.file import parse_file_and_print</span>
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a><span class="sd">```</span>
</span><span id="L-22"><a href="#L-22"><span class="linenos">22</span></a><span class="sd">It is recommended that you do **not** import from the fully qualified namespace, e.g.:</span>
</span><span id="L-23"><a href="#L-23"><span class="linenos">23</span></a><span class="sd">```python</span>
</span><span id="L-24"><a href="#L-24"><span class="linenos">24</span></a><span class="sd">from brukeropus.file.utils import parse_file_and_print</span>
</span><span id="L-25"><a href="#L-25"><span class="linenos">25</span></a><span class="sd">```</span>
</span><span id="L-26"><a href="#L-26"><span class="linenos">26</span></a><span class="sd">as that namespace is subject to change. Instead import directly from `brukeropus` or its first level submodules.</span>
</span><span id="L-27"><a href="#L-27"><span class="linenos">27</span></a>
</span><span id="L-28"><a href="#L-28"><span class="linenos">28</span></a><span class="sd">### Reading OPUS Files (Basic Usage)</span>
</span><span id="L-29"><a href="#L-29"><span class="linenos">29</span></a><span class="sd">```python</span>
</span><span id="L-30"><a href="#L-30"><span class="linenos">30</span></a><span class="sd">from brukeropus import read_opus</span>
</span><span id="L-31"><a href="#L-31"><span class="linenos">31</span></a><span class="sd">from matplotlib import pyplot as plt</span>
</span><span id="L-32"><a href="#L-32"><span class="linenos">32</span></a>
</span><span id="L-33"><a href="#L-33"><span class="linenos">33</span></a><span class="sd">opus_file = read_opus(&#39;file.0&#39;) # Returns an OPUSFile class</span>
</span><span id="L-34"><a href="#L-34"><span class="linenos">34</span></a>
</span><span id="L-35"><a href="#L-35"><span class="linenos">35</span></a><span class="sd">opus_file.print_parameters() # Pretty prints all metadata in the file to the console</span>
</span><span id="L-36"><a href="#L-36"><span class="linenos">36</span></a>
</span><span id="L-37"><a href="#L-37"><span class="linenos">37</span></a><span class="sd">if &#39;a&#39; in opus_file.data_keys: # If absorbance spectra was extracted from file</span>
</span><span id="L-38"><a href="#L-38"><span class="linenos">38</span></a><span class="sd"> plt.plot(opus_file.a.x, opus_file.a.y) # Plot absorbance spectra</span>
</span><span id="L-39"><a href="#L-39"><span class="linenos">39</span></a><span class="sd"> plt.title(opus_file.sfm + &#39; - &#39; + opus_file.snm) # Sets plot title to Sample Form - Sample Name</span>
</span><span id="L-40"><a href="#L-40"><span class="linenos">40</span></a><span class="sd"> plt.show() # Display plot</span>
</span><span id="L-41"><a href="#L-41"><span class="linenos">41</span></a><span class="sd">```</span>
</span><span id="L-42"><a href="#L-42"><span class="linenos">42</span></a><span class="sd">More detailed documentation on the file submodule can be found in `brukeropus.file`</span>
</span><span id="L-43"><a href="#L-43"><span class="linenos">43</span></a>
</span><span id="L-44"><a href="#L-44"><span class="linenos">44</span></a><span class="sd">### Controlling OPUS Software (Basic Usage)</span>
</span><span id="L-45"><a href="#L-45"><span class="linenos">45</span></a><span class="sd">```python</span>
</span><span id="L-46"><a href="#L-46"><span class="linenos">46</span></a><span class="sd">from brukeropus import opus, read_opus</span>
</span><span id="L-47"><a href="#L-47"><span class="linenos">47</span></a><span class="sd">from matplotlib import pyplot as plt</span>
</span><span id="L-48"><a href="#L-48"><span class="linenos">48</span></a>
</span><span id="L-49"><a href="#L-49"><span class="linenos">49</span></a><span class="sd">opus = Opus() # Connects to actively running OPUS software</span>
</span><span id="L-50"><a href="#L-50"><span class="linenos">50</span></a>
</span><span id="L-51"><a href="#L-51"><span class="linenos">51</span></a><span class="sd">apt_options = opus.get_param_options(&#39;apt&#39;) # Get all valid aperture settings</span>
</span><span id="L-52"><a href="#L-52"><span class="linenos">52</span></a>
</span><span id="L-53"><a href="#L-53"><span class="linenos">53</span></a><span class="sd">for apt in apt_options[2:-2]: # Loop over all but the two smallest and two largest aperature settings</span>
</span><span id="L-54"><a href="#L-54"><span class="linenos">54</span></a><span class="sd"> filepath = opus.measure_sample(apt=apt, nss=10, unload=True) # Perform measurement and unload file from OPUS</span>
</span><span id="L-55"><a href="#L-55"><span class="linenos">55</span></a><span class="sd"> data = read_opus(filepath) # Read OPUS file from measurement</span>
</span><span id="L-56"><a href="#L-56"><span class="linenos">56</span></a><span class="sd"> plt.plot(data.sm.x, data.sm.y, label=apt) # Plot single-channel sample spectra</span>
</span><span id="L-57"><a href="#L-57"><span class="linenos">57</span></a><span class="sd">plt.legend()</span>
</span><span id="L-58"><a href="#L-58"><span class="linenos">58</span></a><span class="sd">plt.show()</span>
</span><span id="L-59"><a href="#L-59"><span class="linenos">59</span></a><span class="sd">```</span>
</span><span id="L-60"><a href="#L-60"><span class="linenos">60</span></a><span class="sd">More detailed documentation on the control submodule can be found in `brukeropus.control`.</span>
</span><span id="L-61"><a href="#L-61"><span class="linenos">61</span></a><span class="sd">&#39;&#39;&#39;</span>
</span><span id="L-62"><a href="#L-62"><span class="linenos">62</span></a>
</span><span id="L-63"><a href="#L-63"><span class="linenos">63</span></a><span class="kn">from</span> <span class="nn">brukeropus.file</span> <span class="kn">import</span> <span class="n">OPUSFile</span><span class="p">,</span> <span class="n">read_opus</span><span class="p">,</span> <span class="n">find_opus_files</span>
</span><span id="L-64"><a href="#L-64"><span class="linenos">64</span></a><span class="kn">from</span> <span class="nn">brukeropus.control</span> <span class="kn">import</span> <span class="n">Opus</span>
</span></pre></div>


Expand Down
2 changes: 1 addition & 1 deletion docs/brukeropus/control/dde.html
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ <h1 class="modulename">
<div class="attr function">

<span class="def">def</span>
<span class="name">get_winfunc</span><span class="signature pdoc-code multiline">(<span class="param"> <span class="n">libname</span>,</span><span class="param"> <span class="n">funcname</span>,</span><span class="param"> <span class="n">restype</span><span class="o">=</span><span class="kc">None</span>,</span><span class="param"> <span class="n">argtypes</span><span class="o">=</span><span class="p">()</span>,</span><span class="param"> <span class="n">_libcache</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;user32&#39;</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">WinDLL</span> <span class="s1">&#39;user32&#39;</span><span class="p">,</span> <span class="n">handle</span> <span class="mi">7</span><span class="n">ffea65a0000</span><span class="o">&gt;</span><span class="p">}</span></span><span class="return-annotation">):</span></span>
<span class="name">get_winfunc</span><span class="signature pdoc-code multiline">(<span class="param"> <span class="n">libname</span>,</span><span class="param"> <span class="n">funcname</span>,</span><span class="param"> <span class="n">restype</span><span class="o">=</span><span class="kc">None</span>,</span><span class="param"> <span class="n">argtypes</span><span class="o">=</span><span class="p">()</span>,</span><span class="param"> <span class="n">_libcache</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;user32&#39;</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">WinDLL</span> <span class="s1">&#39;user32&#39;</span><span class="p">,</span> <span class="n">handle</span> <span class="mi">7</span><span class="n">fffb73d0000</span><span class="o">&gt;</span><span class="p">}</span></span><span class="return-annotation">):</span></span>

<label class="view-source-button" for="get_winfunc-view-source"><span>View Source</span></label>

Expand Down
Loading

0 comments on commit 16bc799

Please sign in to comment.