Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1ba4a7a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
asogaard committed Nov 16, 2023
1 parent a68b8c9 commit 641fe67
Show file tree
Hide file tree
Showing 64 changed files with 590 additions and 581 deletions.
11 changes: 9 additions & 2 deletions _modules/graphnet/data/dataconverter.html
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,22 @@ <h1 id="modules-graphnet-data-dataconverter--page-root">Source code for graphnet
<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>

<span class="nd">@final</span>
<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directories</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">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">directories</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="n">recursive</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Convert I3-files in `directories.</span>

<span class="sd"> Args:</span>
<span class="sd"> directories: One or more directories, the I3 files within which</span>
<span class="sd"> should be converted to an intermediate file format.</span>
<span class="sd"> recursive: Whether or not to search the directories recursively.</span>
<span class="sd"> """</span>
<span class="c1"># Find all I3 and GCD files in the specified directories.</span>
<span class="n">i3_files</span><span class="p">,</span> <span class="n">gcd_files</span> <span class="o">=</span> <span class="n">find_i3_files</span><span class="p">(</span><span class="n">directories</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gcd_rescue</span><span class="p">)</span>
<span class="n">i3_files</span><span class="p">,</span> <span class="n">gcd_files</span> <span class="o">=</span> <span class="n">find_i3_files</span><span class="p">(</span>
<span class="n">directories</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gcd_rescue</span><span class="p">,</span> <span class="n">recursive</span>
<span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">i3_files</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="sa">f</span><span class="s2">"No files found in </span><span class="si">{</span><span class="n">directories</span><span class="si">}</span><span class="s2">."</span><span class="p">)</span>
<span class="k">return</span>
Expand Down
2 changes: 0 additions & 2 deletions _modules/graphnet/models/gnn/dynedge_kaggle_tito.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ <h1 id="modules-graphnet-models-gnn-dynedge-kaggle-tito--page-root">Source code
<span class="kn">from</span> <span class="nn">torch_scatter</span> <span class="kn">import</span> <span class="n">scatter_max</span><span class="p">,</span> <span class="n">scatter_mean</span><span class="p">,</span> <span class="n">scatter_min</span><span class="p">,</span> <span class="n">scatter_sum</span>

<span class="kn">from</span> <span class="nn">graphnet.models.components.layers</span> <span class="kn">import</span> <span class="n">DynTrans</span>
<span class="kn">from</span> <span class="nn">graphnet.utilities.config</span> <span class="kn">import</span> <span class="n">save_model_config</span>
<span class="kn">from</span> <span class="nn">graphnet.models.gnn.gnn</span> <span class="kn">import</span> <span class="n">GNN</span>
<span class="kn">from</span> <span class="nn">graphnet.models.utils</span> <span class="kn">import</span> <span class="n">calculate_xyzt_homophily</span>

Expand All @@ -358,7 +357,6 @@ <h1 id="modules-graphnet-models-gnn-dynedge-kaggle-tito--page-root">Source code
<span class="k">class</span> <span class="nc">DynEdgeTITO</span><span class="p">(</span><span class="n">GNN</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""DynEdgeTITO (dynamical edge convolutional with Transformer) model."""</span>

<span class="nd">@save_model_config</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">nb_inputs</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
Expand Down
3 changes: 0 additions & 3 deletions _modules/graphnet/models/standard_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ <h1 id="modules-graphnet-models-standard-model--page-root">Source code for graph
<span class="n">max_epochs</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span>
<span class="n">gpus</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="n">List</span><span class="p">[</span><span class="nb">int</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">callbacks</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="n">Callback</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">ckpt_path</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">logger</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">LightningLogger</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">log_every_n_steps</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
<span class="n">gradient_clip_val</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>
Expand All @@ -419,7 +418,6 @@ <h1 id="modules-graphnet-models-standard-model--page-root">Source code for graph
<span class="n">logger</span><span class="o">=</span><span class="n">logger</span><span class="p">,</span>
<span class="n">gradient_clip_val</span><span class="o">=</span><span class="n">gradient_clip_val</span><span class="p">,</span>
<span class="n">strategy</span><span class="o">=</span><span class="n">distribution_strategy</span><span class="p">,</span>
<span class="n">default_root_dir</span><span class="o">=</span><span class="n">ckpt_path</span><span class="p">,</span>
<span class="o">**</span><span class="n">trainer_kwargs</span><span class="p">,</span>
<span class="p">)</span>

Expand Down Expand Up @@ -458,7 +456,6 @@ <h1 id="modules-graphnet-models-standard-model--page-root">Source code for graph
<span class="n">max_epochs</span><span class="o">=</span><span class="n">max_epochs</span><span class="p">,</span>
<span class="n">gpus</span><span class="o">=</span><span class="n">gpus</span><span class="p">,</span>
<span class="n">callbacks</span><span class="o">=</span><span class="n">callbacks</span><span class="p">,</span>
<span class="n">ckpt_path</span><span class="o">=</span><span class="n">ckpt_path</span><span class="p">,</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logger</span><span class="p">,</span>
<span class="n">log_every_n_steps</span><span class="o">=</span><span class="n">log_every_n_steps</span><span class="p">,</span>
<span class="n">gradient_clip_val</span><span class="o">=</span><span class="n">gradient_clip_val</span><span class="p">,</span>
Expand Down
12 changes: 9 additions & 3 deletions _modules/graphnet/utilities/filesys.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ <h1 id="modules-graphnet-utilities-filesys--page-root">Source code for graphnet.
<div class="viewcode-block" id="find_i3_files">
<a class="viewcode-back" href="../../../api/graphnet.utilities.filesys.html#graphnet.utilities.filesys.find_i3_files">[docs]</a>
<span class="k">def</span> <span class="nf">find_i3_files</span><span class="p">(</span>
<span class="n">directories</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="n">gcd_rescue</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="n">directories</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="n">gcd_rescue</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">recursive</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</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">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]:</span>
<span class="w"> </span><span class="sd">"""Find I3 files and corresponding GCD files in `directories`.</span>

Expand All @@ -378,6 +380,7 @@ <h1 id="modules-graphnet-utilities-filesys--page-root">Source code for graphnet.
<span class="sd"> directories: Directories to search recursively for I3 files.</span>
<span class="sd"> gcd_rescue: Path to the GCD that will be default if no GCD is present</span>
<span class="sd"> in the directory.</span>
<span class="sd"> recursive: Whether or not to search the directories recursively.</span>

<span class="sd"> Returns:</span>
<span class="sd"> i3_list: Paths to I3 files in `directories`</span>
Expand All @@ -392,11 +395,14 @@ <h1 id="modules-graphnet-utilities-filesys--page-root">Source code for graphnet.

<span class="k">for</span> <span class="n">directory</span> <span class="ow">in</span> <span class="n">directories</span><span class="p">:</span>

<span class="c1"># Recursively find all I3-like files in `directory`.</span>
<span class="c1"># Find all I3-like files in `directory`, may or may not be recursively.</span>
<span class="n">paths</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">i3_patterns</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"*.bz2"</span><span class="p">,</span> <span class="s2">"*.zst"</span><span class="p">,</span> <span class="s2">"*.gz"</span><span class="p">]</span>
<span class="k">for</span> <span class="n">i3_pattern</span> <span class="ow">in</span> <span class="n">i3_patterns</span><span class="p">:</span>
<span class="n">paths</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span><span class="o">.</span><span class="n">rglob</span><span class="p">(</span><span class="n">i3_pattern</span><span class="p">)))</span>
<span class="k">if</span> <span class="n">recursive</span><span class="p">:</span>
<span class="n">paths</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span><span class="o">.</span><span class="n">rglob</span><span class="p">(</span><span class="n">i3_pattern</span><span class="p">)))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">paths</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">i3_pattern</span><span class="p">)))</span>

<span class="c1"># Loop over all folders containing such I3-like files.</span>
<span class="n">folders</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">([</span><span class="n">path</span><span class="o">.</span><span class="n">parent</span> <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="n">paths</span><span class="p">]))</span>
Expand Down
Loading

0 comments on commit 641fe67

Please sign in to comment.