Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineruzette committed Jul 8, 2024
1 parent be44426 commit a834b2a
Show file tree
Hide file tree
Showing 33 changed files with 1,436 additions and 57 deletions.
31 changes: 29 additions & 2 deletions _modules/goo/cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/blender_on_o2.html">Running Goo on O2</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../user_guide/api.html">Documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Documentation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.cell.html">goo.cell</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.molecule.html">goo.molecule</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.division.html">goo.division</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.force.html">goo.force</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.handler.html">goo.handler</a></li>
Expand Down Expand Up @@ -271,8 +272,9 @@
</div>
<article role="main" id="furo-main-content">
<h1>Source code for goo.cell</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Union</span>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Union</span><span class="p">,</span> <span class="n">Dict</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">defaultdict</span>

<span class="kn">import</span> <span class="nn">bpy</span>
<span class="kn">import</span> <span class="nn">bmesh</span>
Expand All @@ -282,6 +284,8 @@ <h1>Source code for goo.cell</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">goo.force</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">goo.utils</span> <span class="kn">import</span> <span class="o">*</span>

<span class="kn">from</span> <span class="nn">goo.molecule</span> <span class="kn">import</span> <span class="n">Molecule</span>


<div class="viewcode-block" id="Cell">
<a class="viewcode-back" href="../../user_guide/goo.cell.html#goo.cell.Cell">[docs]</a>
Expand Down Expand Up @@ -319,6 +323,9 @@ <h1>Source code for goo.cell</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">_hetero_adhesions</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">AdhesionForce</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_motion_force</span><span class="p">:</span> <span class="n">MotionForce</span> <span class="o">=</span> <span class="kc">None</span>

<span class="c1"># concentrations of molecules in interstitial space</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_molecules_conc</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="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Name of the cell. Also defines the name of related forces and</span>
Expand Down Expand Up @@ -497,6 +504,17 @@ <h1>Source code for goo.cell</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_eigenvector</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span></div>


<div class="viewcode-block" id="Cell.get_radius">
<a class="viewcode-back" href="../../user_guide/goo.cell.html#goo.cell.Cell.get_radius">[docs]</a>
<span class="k">def</span> <span class="nf">get_radius</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Calculate the radius based on the major and minor axes of the cell.&quot;&quot;&quot;</span>
<span class="n">major_axis</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">major_axis</span><span class="p">()</span>
<span class="n">length_major</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">major_axis</span><span class="o">.</span><span class="n">_start</span> <span class="o">-</span> <span class="n">major_axis</span><span class="o">.</span><span class="n">_end</span><span class="p">)</span>
<span class="n">minor_axis</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">minor_axis</span><span class="p">()</span>
<span class="n">length_minor</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">minor_axis</span><span class="o">.</span><span class="n">_start</span> <span class="o">-</span> <span class="n">minor_axis</span><span class="o">.</span><span class="n">_end</span><span class="p">)</span>
<span class="k">return</span> <span class="p">(</span><span class="n">length_major</span> <span class="o">+</span> <span class="n">length_minor</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span></div>


<div class="viewcode-block" id="Cell.divide">
<a class="viewcode-back" href="../../user_guide/goo.cell.html#goo.cell.Cell.divide">[docs]</a>
<span class="k">def</span> <span class="nf">divide</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">division_logic</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">tuple</span><span class="p">[</span><span class="s2">&quot;Cell&quot;</span><span class="p">,</span> <span class="s2">&quot;Cell&quot;</span><span class="p">]:</span>
Expand Down Expand Up @@ -815,7 +833,16 @@ <h1>Source code for goo.cell</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="n">motion_loc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">loc</span> <span class="o">+</span> <span class="nb">dir</span><span class="o">.</span><span class="n">normalized</span><span class="p">()</span> <span class="o">*</span> <span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">major_axis</span><span class="p">()</span><span class="o">.</span><span class="n">length</span><span class="p">())</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_motion_force</span><span class="o">.</span><span class="n">set_loc</span><span class="p">(</span><span class="n">motion_loc</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">loc</span><span class="p">)</span></div>
</div>


<span class="c1"># ----- MOLECULES -----</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">molecules_conc</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_molecules_conc</span>

<span class="nd">@molecules_conc</span><span class="o">.</span><span class="n">setter</span>
<span class="k">def</span> <span class="nf">molecules_conc</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">conc</span><span class="p">:</span> <span class="n">defaultdict</span><span class="p">[</span><span class="nb">float</span><span class="p">]):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_molecules_conc</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">conc</span><span class="p">)</span></div>



Expand Down
1 change: 1 addition & 0 deletions _modules/goo/division.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/blender_on_o2.html">Running Goo on O2</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../user_guide/api.html">Documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Documentation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.cell.html">goo.cell</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.molecule.html">goo.molecule</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.division.html">goo.division</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.force.html">goo.force</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.handler.html">goo.handler</a></li>
Expand Down
1 change: 1 addition & 0 deletions _modules/goo/force.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/blender_on_o2.html">Running Goo on O2</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../user_guide/api.html">Documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Documentation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.cell.html">goo.cell</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.molecule.html">goo.molecule</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.division.html">goo.division</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.force.html">goo.force</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../user_guide/goo.handler.html">goo.handler</a></li>
Expand Down
Loading

0 comments on commit a834b2a

Please sign in to comment.