jacquev6/ActionTree

View on GitHub
docs/user_guide/drawings.html

Summary

Maintainability
Test Coverage

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <title>Drawings &#8212; ActionTree 0.13.2 documentation</title>
    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Outputs and side-effects" href="outputs.html" />
    <link rel="prev" title="Introduction" href="introduction.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="drawings">
<h1>Drawings<a class="headerlink" href="#drawings" title="Permalink to this headline">¶</a></h1>
<div class="section" id="gantt-chart">
<h2>Gantt chart<a class="headerlink" href="#gantt-chart" title="Permalink to this headline">¶</a></h2>
<p>ActionTree uses <a class="reference external" href="https://pypi.python.org/pypi/matplotlib">matplotlib</a> to visualize Gantt charts. Install all
required dependencies with <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">ActionTree[gantt]</span></code>.</p>
<p>You can draw a Gantt chart of the execution with <a class="reference internal" href="../reference.html#ActionTree.GanttChart" title="ActionTree.GanttChart"><code class="xref py py-class docutils literal notranslate"><span class="pre">GanttChart</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ActionTree</span> <span class="kn">import</span> <span class="n">GanttChart</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">chart</span> <span class="o">=</span> <span class="n">GanttChart</span><span class="p">(</span><span class="n">link_report</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chart</span><span class="o">.</span><span class="n">write_to_png</span><span class="p">(</span><span class="s2">&quot;link_gantt_chart.png&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="figure align-center" id="id1">
<img alt="../_images/link_gantt_chart.png" src="../_images/link_gantt_chart.png" />
<p class="caption"><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">link_gantt_chart.png</span></code></span><a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>
</div>
<p>Each action is represented by an horizontal line.
The left part, optional, is thin. It represents the time the action was ready to execute (all dependencies were done)
but waiting for a resource (typically a CPU core to execute on).
The right part is thicker and represents the actual execution of the action.
<a class="reference internal" href="resources.html#resources"><span class="std std-ref">Resources</span></a> and <a class="reference internal" href="timing.html#timing"><span class="std std-ref">timing</span></a> are explained in detail later in this user guide.</p>
<p>Actions are linked to their dependencies using thin doted lines.</p>
<p>Actions that failed are in red, and actions that were canceled due to a failure in their dependencies are in grey:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">compile_unexisting</span> <span class="o">=</span> <span class="n">CallSubprocess</span><span class="p">([</span><span class="s2">&quot;g++&quot;</span><span class="p">,</span> <span class="s2">&quot;-c&quot;</span><span class="p">,</span> <span class="s2">&quot;unexisting.cpp&quot;</span><span class="p">,</span> <span class="s2">&quot;-o&quot;</span><span class="p">,</span> <span class="s2">&quot;_build/unexisting.o&quot;</span><span class="p">],</span> <span class="n">label</span><span class="o">=</span><span class="s2">&quot;g++ -c unexisting.cpp&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">compile_unexisting</span><span class="o">.</span><span class="n">add_dependency</span><span class="p">(</span><span class="n">make_build_dir</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">link</span><span class="o">.</span><span class="n">add_dependency</span><span class="p">(</span><span class="n">compile_unexisting</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">failed_link_report</span> <span class="o">=</span> <span class="n">execute</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="n">cpu_cores</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">keep_going</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">do_raise</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">failed_link_report</span><span class="o">.</span><span class="n">is_success</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chart</span> <span class="o">=</span> <span class="n">GanttChart</span><span class="p">(</span><span class="n">failed_link_report</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chart</span><span class="o">.</span><span class="n">write_to_png</span><span class="p">(</span><span class="s2">&quot;failed_link_gantt_chart.png&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="figure align-center" id="id2">
<img alt="../_images/failed_link_gantt_chart.png" src="../_images/failed_link_gantt_chart.png" />
<p class="caption"><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">failed_link_gantt_chart.png</span></code></span><a class="headerlink" href="#id2" title="Permalink to this image">¶</a></p>
</div>
</div>
<div class="section" id="dependency-graph">
<h2>Dependency graph<a class="headerlink" href="#dependency-graph" title="Permalink to this headline">¶</a></h2>
<p>ActionTree uses <a class="reference external" href="https://pypi.python.org/pypi/graphviz">graphviz</a> to visualize dependency graphs. Install all
required dependencies with <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span>
<span class="pre">ActionTree[dependency_graphs]</span></code>.</p>
<p>You can draw a dependency graph with <a class="reference internal" href="../reference.html#ActionTree.DependencyGraph" title="ActionTree.DependencyGraph"><code class="xref py py-class docutils literal notranslate"><span class="pre">DependencyGraph</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ActionTree</span> <span class="kn">import</span> <span class="n">DependencyGraph</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">graph</span> <span class="o">=</span> <span class="n">DependencyGraph</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">graph</span><span class="o">.</span><span class="n">write_to_png</span><span class="p">(</span><span class="s2">&quot;link_dependency_graph.png&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="figure align-center" id="id3">
<img alt="../_images/link_dependency_graph.png" src="../_images/link_dependency_graph.png" />
<p class="caption"><span class="caption-text"><code class="docutils literal notranslate"><span class="pre">link_dependency_graph.png</span></code></span><a class="headerlink" href="#id3" title="Permalink to this image">¶</a></p>
</div>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.png" alt="Logo"/>
            </a></p>
<h1 class="logo"><a href="../index.html">ActionTree</a></h1>






<p>
<iframe src="https://ghbtns.com/github-btn.html?user=jacquev6&repo=ActionTree&type=watch&count=true&size=large&v=2"
  allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>





<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../user_guide.html">User guide</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Drawings</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#gantt-chart">Gantt chart</a></li>
<li class="toctree-l3"><a class="reference internal" href="#dependency-graph">Dependency graph</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="outputs.html">Outputs and side-effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="timing.html">Timing information</a></li>
<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks</a></li>
<li class="toctree-l2"><a class="reference internal" href="resources.html">Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="source_files.html">Source files of examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Reference</a></li>
</ul>


<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2013-2018 <a href="http://vincent-jacques.net/">Vincent Jacques</a><script src="https://jacquev6.net/ribbon.2.js" data-project="ActionTree"></script>.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="../_sources/user_guide/drawings.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>