Skip to content

Commit

Permalink
deploy: 9fcac82
Browse files Browse the repository at this point in the history
  • Loading branch information
tfcollins committed Dec 6, 2024
1 parent 7063b9c commit 6869ada
Show file tree
Hide file tree
Showing 147 changed files with 2,425 additions and 2,425 deletions.
2 changes: 1 addition & 1 deletion main/_static/app.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main/_static/app.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main/_static/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main/_static/style.min.css.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions main/attr/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<title>Attributes &#8212; Analog Devices Hardware Python Interfaces 0.0.19 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8e8a900e" />
<link rel="stylesheet" type="text/css" href="../_static/style.min.css?v=95305861" />
<link rel="stylesheet" type="text/css" href="../_static/style.min.css?v=ab97267f" />
<link rel="stylesheet" type="text/css" href="../_static/css/style.css?v=632a43e7" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=57f2e648"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=4825356b"></script>
<script defer="" src="../_static/app.umd.js?v=c93eadd1"></script>
<script defer="" src="../_static/app.umd.js?v=689b8755"></script>
<link rel="icon" href="../_static/favicon.png"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand Down Expand Up @@ -94,7 +94,7 @@
<div class="localtoc">
<div class="tocwrapper">
<div>
<div class="localtoc-header">On this page</div>
<div class="localtoc-header"></div>
<a id="scroll-up" href="#top-anchor" title="Back to top"></a>
</div>
<nav>
Expand Down Expand Up @@ -294,7 +294,7 @@
<div class="body" role="main">

<section id="attributes">
<h1>Attributes<a class="headerlink" href="#attributes" title="Permalink to this heading">#</a></h1>
<h1>Attributes<a class="headerlink" href="#attributes" title="Permalink to this heading"></a></h1>
<p>To simplify hardware configuration through different IIO drivers, basic class properties are exposed at the top-level of each device specific class. These properties abstract away the need to know a specific channel name, attribute type, source device name, and other details required in the libIIO API. Instead properties have easy to understand names, documentation, and error handling to help manage interfacing with different hardware. Property data can be read and written as follows from a given device interface class:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">adi</span>

Expand Down
64 changes: 32 additions & 32 deletions main/buffers/index.html

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions main/dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<title>Developers &#8212; Analog Devices Hardware Python Interfaces 0.0.19 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8e8a900e" />
<link rel="stylesheet" type="text/css" href="../_static/style.min.css?v=95305861" />
<link rel="stylesheet" type="text/css" href="../_static/style.min.css?v=ab97267f" />
<link rel="stylesheet" type="text/css" href="../_static/css/style.css?v=632a43e7" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=57f2e648"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=4825356b"></script>
<script defer="" src="../_static/app.umd.js?v=c93eadd1"></script>
<script defer="" src="../_static/app.umd.js?v=689b8755"></script>
<link rel="icon" href="../_static/favicon.png"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand Down Expand Up @@ -94,7 +94,7 @@
<div class="localtoc">
<div class="tocwrapper">
<div>
<div class="localtoc-header">On this page</div>
<div class="localtoc-header"></div>
<a id="scroll-up" href="#top-anchor" title="Back to top"></a>
</div>
<nav>
Expand Down Expand Up @@ -310,14 +310,14 @@
<div class="body" role="main">

<section id="developers">
<h1>Developers<a class="headerlink" href="#developers" title="Permalink to this heading">#</a></h1>
<h1>Developers<a class="headerlink" href="#developers" title="Permalink to this heading"></a></h1>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This section is only for developers and advanced users.</p>
</div>
<p>When submitting code or running tests, there are a few ways things are done in pyadi-iio.</p>
<section id="invoke">
<h2>Invoke<a class="headerlink" href="#invoke" title="Permalink to this heading">#</a></h2>
<h2>Invoke<a class="headerlink" href="#invoke" title="Permalink to this heading"></a></h2>
<p>To make repetitve tasks easier, pyadi-iio utilizes pyinvoke. To see the available options (once pyinvoke is installed) run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">invoke --list</span>
<span class="go">Available tasks:</span>
Expand All @@ -335,7 +335,7 @@ <h2>Invoke<a class="headerlink" href="#invoke" title="Permalink to this heading"
</div>
</section>
<section id="precommit">
<h2>Precommit<a class="headerlink" href="#precommit" title="Permalink to this heading">#</a></h2>
<h2>Precommit<a class="headerlink" href="#precommit" title="Permalink to this heading"></a></h2>
<p><strong>pre-commit</strong> is heavily relied on for keeping code in order and for eliminating certain bugs. Be sure to run these checks before submitting code. This can be run through pyinvoke or directly from the repo root as:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">invoke precommit</span>
</pre></div>
Expand All @@ -345,7 +345,7 @@ <h2>Precommit<a class="headerlink" href="#precommit" title="Permalink to this he
</div>
</section>
<section id="testing">
<h2>Testing<a class="headerlink" href="#testing" title="Permalink to this heading">#</a></h2>
<h2>Testing<a class="headerlink" href="#testing" title="Permalink to this heading"></a></h2>
<p>Testing pyadi-iio requires hardware, but fortunately by default it assumes no hardware is connected unless found. It will only load specific tests for hardware it can find and skip all other tests. <strong>pytest</strong>, which is the framework pyadi-iio uses, can be call as following:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">invoke test</span>
</pre></div>
Expand All @@ -354,7 +354,7 @@ <h2>Testing<a class="headerlink" href="#testing" title="Permalink to this headin
</pre></div>
</div>
<section id="test-configuration">
<h3>Test Configuration<a class="headerlink" href="#test-configuration" title="Permalink to this heading">#</a></h3>
<h3>Test Configuration<a class="headerlink" href="#test-configuration" title="Permalink to this heading"></a></h3>
<p>There are several advanced features of pytest that are utilized by pyadi-iio. Specifically custom markers and custom plugins.</p>
<p>Markers are a way of labeling tests, which can be then used to filter specific tests. Markers are provided through the <a class="reference external" href="https://github.com/analogdevicesinc/pyadi-iio/blob/master/test/test_map.py">test_map.py</a> file in the test directory. These markers are used to map FPGA based boards with daughtercards to specific tests. <a class="reference external" href="https://wiki.analog.com/resources/tools-software/linux-software/embedded_arm_images">Reference design folder names</a> from the ADI SD cards are using as the markers, which them can be passed through the <em>-m</em> flag to enabled certain tests. For example, the following would enable all tests related to <em>ADRV9009</em>, assuming the hardware is available:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">python3 -m pytest -m zynqmp-zcu102-rev10-adrv9009</span>
Expand All @@ -367,15 +367,15 @@ <h3>Test Configuration<a class="headerlink" href="#test-configuration" title="Pe
<p>If you are working on a driver or board that is not in the hardware map, a custom one can be created as documentation in the <a class="reference external" href="https://pytest-libiio.readthedocs.io/en/latest/cli/#hardware-maps">pytest-libiio CLI</a>.</p>
</section>
<section id="new-hardware-requirements">
<h3>New Hardware Requirements<a class="headerlink" href="#new-hardware-requirements" title="Permalink to this heading">#</a></h3>
<h3>New Hardware Requirements<a class="headerlink" href="#new-hardware-requirements" title="Permalink to this heading"></a></h3>
<p>In order to maintain pyadi-iio, for all new drivers the development team will require emulation contexts to be submitted alongside the new class interfaces. This is to ensure that the new drivers are tested and maintained. Emulation contexts can be created using <a class="reference external" href="https://pytest-libiio.readthedocs.io/en/latest/emulation/#adding-device-support">xml_gen</a>. CI will automatically validate that all hardware interfaces have emulation contexts and prevent merging if they are missing.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Note that xml_gen is not the same as iio_genxml, as iio_genxml does not capture default values of properties required for emulation.</p>
</div>
</section>
<section id="test-functions-and-fixtures">
<h3>Test Functions and Fixtures<a class="headerlink" href="#test-functions-and-fixtures" title="Permalink to this heading">#</a></h3>
<h3>Test Functions and Fixtures<a class="headerlink" href="#test-functions-and-fixtures" title="Permalink to this heading"></a></h3>
<p>pyadi-iio has a large set of parameterizable fixtures for testing different device specific class interfaces. See the links belows to the different test categories:</p>
<div class="toctree-wrapper compound">
<ul>
Expand Down Expand Up @@ -436,10 +436,10 @@ <h3>Test Functions and Fixtures<a class="headerlink" href="#test-functions-and-f
</section>
</section>
<section id="set-up-isolated-environment">
<h2>Set Up Isolated Environment<a class="headerlink" href="#set-up-isolated-environment" title="Permalink to this heading">#</a></h2>
<h2>Set Up Isolated Environment<a class="headerlink" href="#set-up-isolated-environment" title="Permalink to this heading"></a></h2>
<p>This section will discuss a method to do isolated development with the correct package versions. The main purpose here is to eliminate any discrepancies that can arise (especially with the linting tools) when running precommit and other checks. This is also useful to not pollute your local global packages. The approach here relies upon leveraging <strong>pyenv</strong> and <strong>pipenv</strong> together.</p>
<section id="install-pyenv">
<h3>Install pyenv<a class="headerlink" href="#install-pyenv" title="Permalink to this heading">#</a></h3>
<h3>Install pyenv<a class="headerlink" href="#install-pyenv" title="Permalink to this heading"></a></h3>
<p><strong>pyenv</strong> is a handy tool for installing different and isolated versions of python on your system. Since distributions can ship with rather random versions of python, pyenv can help us install exactly the versions we want. The quick way to install pyenv is with their bash script:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>curl<span class="w"> </span>https://pyenv.run<span class="w"> </span><span class="p">|</span><span class="w"> </span>bash
</pre></div>
Expand All @@ -456,7 +456,7 @@ <h3>Install pyenv<a class="headerlink" href="#install-pyenv" title="Permalink to
</div>
</section>
<section id="create-isolated-install-with-pipenv">
<h3>Create isolated install with pipenv<a class="headerlink" href="#create-isolated-install-with-pipenv" title="Permalink to this heading">#</a></h3>
<h3>Create isolated install with pipenv<a class="headerlink" href="#create-isolated-install-with-pipenv" title="Permalink to this heading"></a></h3>
<p>Get the repo, set python version, and setup env</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip3<span class="w"> </span>install<span class="w"> </span>-U<span class="w"> </span>pipenv
pyenv<span class="w"> </span><span class="nb">local</span><span class="w"> </span><span class="m">3</span>.6.9
Expand All @@ -476,7 +476,7 @@ <h3>Create isolated install with pipenv<a class="headerlink" href="#create-isola
</section>
</section>
<section id="emulation">
<h2>Emulation<a class="headerlink" href="#emulation" title="Permalink to this heading">#</a></h2>
<h2>Emulation<a class="headerlink" href="#emulation" title="Permalink to this heading"></a></h2>
<p>By leveraging <a class="reference external" href="https://github.com/analogdevicesinc/iio-emu">iio-emu</a>, hardware or contexts can be emulated for testing without physical devices. However, currently this emulation does not validate attribute rates, states of drivers, or equivalent data sources. This feature should be used to test a library itself rather than hardware drivers.</p>
<p><strong>pyadi-iio</strong> uses <em>iio-emu</em> through <em>pytest-libiio</em>, which handles loading the correct context files based on the fixtures used for each test. Essentially, when <em>pytest</em> is run, based on the fixture below, <em>pytest-libiio</em> will spawn the correct context with <em>iio-emu</em> and pass the URI of that context to the test.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pytest</span>
Expand Down
Loading

0 comments on commit 6869ada

Please sign in to comment.