Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > b9a6a1b9f2781444d2917afd8e4421ab > files > 828

ipython-doc-2.3.0-2.2.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Module: parallel.controller.dictdb &mdash; IPython 2.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '2.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" />
    <link rel="up" title="The IPython API" href="../index.html" />
    <link rel="next" title="Module: parallel.controller.heartmonitor" href="IPython.parallel.controller.heartmonitor.html" />
    <link rel="prev" title="Module: parallel.controller.dependency" href="IPython.parallel.controller.dependency.html" /> 
  </head>
  <body>

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.heartmonitor.html" title="Module: parallel.controller.heartmonitor"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.dependency.html" title="Module: parallel.controller.dependency"
             accesskey="P">previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" accesskey="U">The IPython API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">parallel.controller.dictdb</span></tt></a><ul>
<li><a class="reference internal" href="#classes">4 Classes</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="IPython.parallel.controller.dependency.html"
                        title="previous chapter">Module: <tt class="docutils literal"><span class="pre">parallel.controller.dependency</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="IPython.parallel.controller.heartmonitor.html"
                        title="next chapter">Module: <tt class="docutils literal"><span class="pre">parallel.controller.heartmonitor</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/api/generated/IPython.parallel.controller.dictdb.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-IPython.parallel.controller.dictdb">
<span id="module-parallel-controller-dictdb"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">parallel.controller.dictdb</span></tt><a class="headerlink" href="#module-IPython.parallel.controller.dictdb" title="Permalink to this headline">¶</a></h1>
<p>A Task logger that presents our DB interface,
but exists entirely in memory and implemented with dicts.</p>
<p>Authors:</p>
<ul class="simple">
<li>Min RK</li>
</ul>
<p>TaskRecords are dicts of the form:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s">&#39;msg_id&#39;</span> <span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="p">),</span>
    <span class="s">&#39;client_uuid&#39;</span> <span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="p">),</span>
    <span class="s">&#39;engine_uuid&#39;</span> <span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;header&#39;</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">(</span><span class="n">header</span><span class="p">),</span>
    <span class="s">&#39;content&#39;</span><span class="p">:</span> <span class="nb">dict</span><span class="p">(</span><span class="n">content</span><span class="p">),</span>
    <span class="s">&#39;buffers&#39;</span><span class="p">:</span> <span class="nb">list</span><span class="p">(</span><span class="n">buffers</span><span class="p">),</span>
    <span class="s">&#39;submitted&#39;</span><span class="p">:</span> <span class="n">datetime</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;started&#39;</span><span class="p">:</span> <span class="n">datetime</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;completed&#39;</span><span class="p">:</span> <span class="n">datetime</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;received&#39;</span><span class="p">:</span> <span class="n">datetime</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;resubmitted&#39;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;result_header&#39;</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">(</span><span class="n">header</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;result_content&#39;</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">(</span><span class="n">content</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s">&#39;result_buffers&#39;</span> <span class="p">:</span> <span class="nb">list</span><span class="p">(</span><span class="n">buffers</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
<p>With this info, many of the special categories of tasks can be defined by query,
e.g.:</p>
<ul class="simple">
<li>pending: completed is None</li>
<li>client&#8217;s outstanding: client_uuid = uuid &amp;&amp; completed is None</li>
<li>MIA: arrived is None (and completed is None)</li>
</ul>
<p>DictDB supports a subset of mongodb operators:</p>
<div class="highlight-python"><div class="highlight"><pre>$lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists
</pre></div>
</div>
<div class="section" id="classes">
<h2>4 Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="IPython.parallel.controller.dictdb.CompositeFilter">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.dictdb.</tt><tt class="descname">CompositeFilter</tt><big>(</big><em>dikt</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.CompositeFilter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="http://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<p>Composite filter for matching multiple properties.</p>
<dl class="method">
<dt id="IPython.parallel.controller.dictdb.CompositeFilter.__init__">
<tt class="descname">__init__</tt><big>(</big><em>dikt</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.CompositeFilter.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="IPython.parallel.controller.dictdb.BaseDB">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.dictdb.</tt><tt class="descname">BaseDB</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.BaseDB" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="IPython.config.configurable.html#IPython.config.configurable.LoggingConfigurable" title="IPython.config.configurable.LoggingConfigurable"><tt class="xref py py-class docutils literal"><span class="pre">IPython.config.configurable.LoggingConfigurable</span></tt></a></p>
<p>Empty Parent class so traitlets work on DB.</p>
</dd></dl>

<dl class="class">
<dt id="IPython.parallel.controller.dictdb.DictDB">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.dictdb.</tt><tt class="descname">DictDB</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#IPython.parallel.controller.dictdb.BaseDB" title="IPython.parallel.controller.dictdb.BaseDB"><tt class="xref py py-class docutils literal"><span class="pre">IPython.parallel.controller.dictdb.BaseDB</span></tt></a></p>
<p>Basic in-memory dict-based object for saving Task Records.</p>
<p>This is the first object to present the DB interface
for logging tasks out of memory.</p>
<p>The interface is based on MongoDB, so adding a MongoDB
backend should be straightforward.</p>
<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.add_record">
<tt class="descname">add_record</tt><big>(</big><em>msg_id</em>, <em>rec</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.add_record" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a new Task Record, by msg_id.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.drop_matching_records">
<tt class="descname">drop_matching_records</tt><big>(</big><em>check</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.drop_matching_records" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove a record from the DB.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.drop_record">
<tt class="descname">drop_record</tt><big>(</big><em>msg_id</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.drop_record" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove a record from the DB.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.find_records">
<tt class="descname">find_records</tt><big>(</big><em>check</em>, <em>keys=None</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.find_records" title="Permalink to this definition">¶</a></dt>
<dd><p>Find records matching a query dict, optionally extracting subset of keys.</p>
<p>Returns dict keyed by msg_id of matching records.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>check: dict</strong></p>
<blockquote>
<div><p>mongodb-style query argument</p>
</div></blockquote>
<p><strong>keys: list of strs [optional]</strong></p>
<blockquote class="last">
<div><p>if specified, the subset of keys to extract.  msg_id will <em>always</em> be
included.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.get_history">
<tt class="descname">get_history</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.get_history" title="Permalink to this definition">¶</a></dt>
<dd><p>get all msg_ids, ordered by time submitted.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.get_record">
<tt class="descname">get_record</tt><big>(</big><em>msg_id</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.get_record" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a specific Task Record, by msg_id.</p>
</dd></dl>

<dl class="method">
<dt id="IPython.parallel.controller.dictdb.DictDB.update_record">
<tt class="descname">update_record</tt><big>(</big><em>msg_id</em>, <em>rec</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.DictDB.update_record" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the data in an existing record.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="IPython.parallel.controller.dictdb.NoDB">
<em class="property">class </em><tt class="descclassname">IPython.parallel.controller.dictdb.</tt><tt class="descname">NoDB</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.parallel.controller.dictdb.NoDB" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#IPython.parallel.controller.dictdb.BaseDB" title="IPython.parallel.controller.dictdb.BaseDB"><tt class="xref py py-class docutils literal"><span class="pre">IPython.parallel.controller.dictdb.BaseDB</span></tt></a></p>
<p>A blackhole db backend that actually stores no information.</p>
<p>Provides the full DB interface, but raises KeyErrors on any
method that tries to access the records.  This can be used to
minimize the memory footprint of the Hub when its record-keeping
functionality is not required.</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.heartmonitor.html" title="Module: parallel.controller.heartmonitor"
             >next</a> |</li>
        <li class="right" >
          <a href="IPython.parallel.controller.dependency.html" title="Module: parallel.controller.dependency"
             >previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" >The IPython API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright The IPython Development Team.
      Last updated on Jul 14, 2015.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>