Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9735f51 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
asogaard committed Feb 22, 2024
1 parent 8428d3a commit 75e428f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
16 changes: 10 additions & 6 deletions _modules/graphnet/data/dataconverter.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,14 @@ <h1 id="modules-graphnet-data-dataconverter--page-root">Source code for graphnet
<span class="c1"># in the directory</span>
<span class="n">input_files</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_file_reader</span><span class="o">.</span><span class="n">find_files</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="n">input_dir</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_launch_jobs</span><span class="p">(</span><span class="n">input_files</span><span class="o">=</span><span class="n">input_files</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_output_files</span> <span class="o">=</span> <span class="n">glob</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_output_files</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_output_dir</span><span class="p">,</span> <span class="sa">f</span><span class="s2">"*</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_save_method</span><span class="o">.</span><span class="n">file_extension</span><span class="si">}</span><span class="s2">"</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_output_dir</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_create_file_name</span><span class="p">(</span><span class="n">file</span><span class="p">)</span>
<span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_save_method</span><span class="o">.</span><span class="n">file_extension</span><span class="p">,</span>
<span class="p">)</span>
<span class="p">)</span>
<span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">input_files</span>
<span class="p">]</span>

<span class="nd">@final</span>
<span class="k">def</span> <span class="nf">_launch_jobs</span><span class="p">(</span>
Expand Down Expand Up @@ -488,9 +491,10 @@ <h1 id="modules-graphnet-data-dataconverter--page-root">Source code for graphnet
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_file_path</span><span class="p">,</span> <span class="n">I3FileSet</span><span class="p">):</span>
<span class="n">input_file_path</span> <span class="o">=</span> <span class="n">input_file_path</span><span class="o">.</span><span class="n">i3_file</span>
<span class="n">file_name</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">input_file_path</span><span class="p">)</span>
<span class="n">index_of_dot</span> <span class="o">=</span> <span class="n">file_name</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="s2">"."</span><span class="p">)</span>
<span class="n">file_name_without_extension</span> <span class="o">=</span> <span class="n">file_name</span><span class="p">[:</span><span class="n">index_of_dot</span><span class="p">]</span>
<span class="k">return</span> <span class="n">file_name_without_extension</span>
<span class="k">for</span> <span class="n">ext</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_file_reader</span><span class="o">.</span><span class="n">_accepted_file_extensions</span><span class="p">:</span>
<span class="k">if</span> <span class="n">file_name</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="n">ext</span><span class="p">):</span>
<span class="n">file_name_without_extension</span> <span class="o">=</span> <span class="n">file_name</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">ext</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
<span class="k">return</span> <span class="n">file_name_without_extension</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">".i3"</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>

<span class="nd">@final</span>
<span class="k">def</span> <span class="nf">_assign_event_no</span><span class="p">(</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ <h1 id="modules-graphnet-data-extractors-icecube-i3genericextractor--page-root">
<span class="bp">self</span><span class="p">,</span>
<span class="n">keys</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">exclude_keys</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">extractor_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">GENERIC_EXTRACTOR_NAME</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">"""Construct I3GenericExtractor.</span>

Expand Down Expand Up @@ -398,7 +399,7 @@ <h1 id="modules-graphnet-data-extractors-icecube-i3genericextractor--page-root">
<span class="bp">self</span><span class="o">.</span><span class="n">_exclude_keys</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="n">exclude_keys</span>

<span class="c1"># Base class constructor</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">GENERIC_EXTRACTOR_NAME</span><span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">extractor_name</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_get_keys</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">frame</span><span class="p">:</span> <span class="s2">"icetray.I3Frame"</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">"""Get the list of keys to be queried from `frame`.</span>
Expand Down Expand Up @@ -496,6 +497,12 @@ <h1 id="modules-graphnet-data-extractors-icecube-i3genericextractor--page-root">
<span class="c1"># Flatten all other objects</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_flatten_result</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span>
<span class="nb">isinstance</span><span class="p">(</span><span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">)</span>
<span class="ow">and</span> <span class="s2">"value"</span> <span class="ow">in</span> <span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
<span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">])</span> <span class="o">==</span> <span class="mi">1</span>
<span class="p">):</span>
<span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">results</span><span class="p">[</span><span class="n">key</span><span class="p">][</span><span class="s2">"value"</span><span class="p">]</span>

<span class="c1"># Serialise list of iterables to JSON</span>
<span class="n">results</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">serialise</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">results</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
Expand Down
1 change: 1 addition & 0 deletions _modules/graphnet/data/writers/sqlite_writer.html
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ <h1 id="modules-graphnet-data-writers-sqlite-writer--page-root">Source code for
<span class="n">database_path</span><span class="o">=</span><span class="n">database_path</span><span class="p">,</span>
<span class="n">index_column</span><span class="o">=</span><span class="n">primary_key</span><span class="p">,</span>
<span class="n">integer_primary_key</span><span class="o">=</span><span class="n">integer_primary_key</span><span class="p">,</span>
<span class="n">default_type</span><span class="o">=</span><span class="s2">"FLOAT"</span><span class="p">,</span>
<span class="p">)</span>

<span class="c1"># Update row counts if needed</span>
Expand Down
3 changes: 2 additions & 1 deletion api/graphnet.data.extractors.icecube.i3genericextractor.html
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
<p>I3Extractor class(es) for generic data extraction.</p>
<dl class="py class">
<dt class="sig sig-object py" id="graphnet.data.extractors.icecube.i3genericextractor.I3GenericExtractor">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">graphnet.data.extractors.icecube.i3genericextractor.</span></span><span class="sig-name descname"><span class="pre">I3GenericExtractor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">keys</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_keys</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/graphnet/data/extractors/icecube/i3genericextractor.html#I3GenericExtractor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#graphnet.data.extractors.icecube.i3genericextractor.I3GenericExtractor" title="Link to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">graphnet.data.extractors.icecube.i3genericextractor.</span></span><span class="sig-name descname"><span class="pre">I3GenericExtractor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">keys</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_keys</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extractor_name</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/graphnet/data/extractors/icecube/i3genericextractor.html#I3GenericExtractor"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#graphnet.data.extractors.icecube.i3genericextractor.I3GenericExtractor" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="graphnet.data.extractors.icecube.i3extractor.html#graphnet.data.extractors.icecube.i3extractor.I3Extractor" title="graphnet.data.extractors.icecube.i3extractor.I3Extractor"><code class="xref py py-class docutils literal notranslate"><span class="pre">I3Extractor</span></code></a></p>
<p>Dynamically and generically extract information from frames.</p>
<p>This class parses all keys in the I3Frame objects it is called on, and
Expand All @@ -633,6 +633,7 @@
<dd class="field-odd"><ul class="simple">
<li><p><strong>keys</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>], <code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code>]</span>, default: <code class="docutils literal notranslate"><span class="pre">None</span></code>) – List of keys in <cite>I3Frame</cite> to be parsed. Defaults to all keys.</p></li>
<li><p><strong>exclude_keys</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>], <code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code>]</span>, default: <code class="docutils literal notranslate"><span class="pre">None</span></code>) – List of keys in <cite>I3Frame</cite> to exclude while parsing.</p></li>
<li><p><strong>extractor_name</strong> (<em>str</em>) – </p></li>
</ul>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 75e428f

Please sign in to comment.