Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4ffa0f1 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
asogaard committed Mar 13, 2024
1 parent 1fc8fdb commit c7e876a
Show file tree
Hide file tree
Showing 100 changed files with 13,582 additions and 498 deletions.
15 changes: 14 additions & 1 deletion _modules/graphnet/data/dataclasses.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
<h1 id="modules-graphnet-data-dataclasses--page-root">Source code for graphnet.data.dataclasses</h1><div class="highlight"><pre>
<span></span><span class="sd">"""Module containing experiment-specific dataclasses."""</span>


<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Any</span>
<span class="kn">from</span> <span class="nn">dataclasses</span> <span class="kn">import</span> <span class="n">dataclass</span>


Expand All @@ -335,6 +335,19 @@ <h1 id="modules-graphnet-data-dataclasses--page-root">Source code for graphnet.d
<span class="n">i3_file</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">gcd_file</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="Settings">
<a class="viewcode-back" href="../../../api/graphnet.data.dataclasses.html#graphnet.data.dataclasses.Settings">[docs]</a>
<span class="nd">@dataclass</span>
<span class="k">class</span> <span class="nc">Settings</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Dataclass for workers in I3Deployer."""</span>

<span class="n">i3_files</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="n">gcd_file</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">output_folder</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">modules</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Any</span><span class="p">]</span></div>

</pre></div>

</article>
Expand Down
24 changes: 24 additions & 0 deletions _modules/graphnet/data/dataset/dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,21 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn



<div class="viewcode-block" id="parse_labels">
<a class="viewcode-back" href="../../../../api/graphnet.data.dataset.dataset.html#graphnet.data.dataset.dataset.parse_labels">[docs]</a>
<span class="k">def</span> <span class="nf">parse_labels</span><span class="p">(</span><span class="n">cfg</span><span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Label</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">"""Construct Label from DatasetConfig."""</span>
<span class="k">assert</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span>

<span class="n">labels</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">labels</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">load_module</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">][</span><span class="n">key</span><span class="p">][</span><span class="s2">"class_name"</span><span class="p">])(</span>
<span class="o">**</span><span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">][</span><span class="n">key</span><span class="p">][</span><span class="s2">"arguments"</span><span class="p">]</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">labels</span></div>



<div class="viewcode-block" id="Dataset">
<a class="viewcode-back" href="../../../../api/graphnet.data.dataset.dataset.html#graphnet.data.dataset.dataset.Dataset">[docs]</a>
<span class="k">class</span> <span class="nc">Dataset</span><span class="p">(</span>
Expand Down Expand Up @@ -468,6 +483,8 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn
<span class="n">cfg</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">dict</span><span class="p">()</span>
<span class="k">if</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">"graph_definition"</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">cfg</span><span class="p">[</span><span class="s2">"graph_definition"</span><span class="p">]</span> <span class="o">=</span> <span class="n">parse_graph_definition</span><span class="p">(</span><span class="n">cfg</span><span class="p">)</span>
<span class="k">if</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">cfg</span><span class="p">[</span><span class="s2">"labels"</span><span class="p">]</span> <span class="o">=</span> <span class="n">parse_labels</span><span class="p">(</span><span class="n">cfg</span><span class="p">)</span>
<span class="k">return</span> <span class="n">source</span><span class="o">.</span><span class="n">_dataset_class</span><span class="p">(</span><span class="o">**</span><span class="n">cfg</span><span class="p">)</span></div>


Expand Down Expand Up @@ -554,6 +571,7 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn
<span class="n">loss_weight_column</span><span class="p">:</span> <span class="n">Optional</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">loss_weight_default_value</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">seed</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">labels</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">"""Construct Dataset.</span>

Expand Down Expand Up @@ -600,6 +618,7 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn
<span class="sd"> `"10000 random events ~ event_no % 5 &gt; 0"` or `"20% random</span>
<span class="sd"> events ~ event_no % 5 &gt; 0"`).</span>
<span class="sd"> graph_definition: Method that defines the graph representation.</span>
<span class="sd"> labels: Dictionary of labels to be added to the dataset.</span>
<span class="sd"> """</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">name</span><span class="o">=</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">class_name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)</span>
Expand All @@ -624,6 +643,7 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn
<span class="bp">self</span><span class="o">.</span><span class="n">_truth_table</span> <span class="o">=</span> <span class="n">truth_table</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_loss_weight_default_value</span> <span class="o">=</span> <span class="n">loss_weight_default_value</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_graph_definition</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">graph_definition</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_labels</span> <span class="o">=</span> <span class="n">labels</span>

<span class="k">if</span> <span class="n">node_truth</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node_truth_table</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span>
Expand Down Expand Up @@ -673,6 +693,10 @@ <h1 id="modules-graphnet-data-dataset-dataset--page-root">Source code for graphn
<span class="n">seed</span><span class="o">=</span><span class="n">seed</span><span class="p">,</span>
<span class="p">)</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_labels</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_labels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_label</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_labels</span><span class="p">[</span><span class="n">key</span><span class="p">])</span>

<span class="c1"># Implementation-specific initialisation.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_init</span><span class="p">()</span>

Expand Down
Loading

0 comments on commit c7e876a

Please sign in to comment.