Skip to content

Commit

Permalink
rebuilt docs
Browse files Browse the repository at this point in the history
  • Loading branch information
achael committed Jun 25, 2024
1 parent 7f0baeb commit 7b922d9
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 31 deletions.
7 changes: 5 additions & 2 deletions _modules/ehtim/array.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,15 @@ <h1>Source code for ehtim.array</h1><div class="highlight"><pre>
<span class="sd"> matplotlib.axes</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># sites</span>
<span class="k">if</span> <span class="n">sites</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;all&#39;</span> <span class="ow">or</span> <span class="s1">&#39;All&#39;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">sites</span> <span class="o">==</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">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="n">sites</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;all&#39;</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">tkey</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">]</span>

<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sites</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">tkey</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>

<span class="n">keys</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">tkey</span><span class="p">[</span><span class="n">site</span><span class="p">]</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">sites</span><span class="p">]</span>

<span class="n">axes</span> <span class="o">=</span> <span class="n">plot_tarr_dterms</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">tarr</span><span class="p">,</span> <span class="n">keys</span><span class="o">=</span><span class="n">keys</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">legend</span><span class="o">=</span><span class="n">legend</span><span class="p">,</span> <span class="n">clist</span><span class="o">=</span><span class="n">clist</span><span class="p">,</span>
Expand Down
4 changes: 2 additions & 2 deletions _modules/ehtim/calibrating/network_cal.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ <h1>Source code for ehtim.calibrating.network_cal</h1><div class="highlight"><pr
<span class="n">zbl</span><span class="p">,</span> <span class="n">sites</span><span class="p">,</span> <span class="n">cluster_data</span><span class="p">,</span> <span class="n">obs</span><span class="o">.</span><span class="n">polrep</span><span class="p">,</span> <span class="n">pol</span><span class="p">,</span>
<span class="n">method</span><span class="p">,</span> <span class="n">pad_amp</span><span class="p">,</span> <span class="n">gain_tol</span><span class="p">,</span>
<span class="n">caltable</span><span class="p">,</span> <span class="n">show_solution</span><span class="p">,</span> <span class="n">debias</span><span class="p">,</span> <span class="n">msgtype</span>
<span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">))]),</span>
<span class="n">dtype</span><span class="o">=</span><span class="nb">object</span><span class="p">)</span>
<span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">))]))</span>
<span class="c1">#dtype=object)</span>
<span class="k">else</span><span class="p">:</span> <span class="c1"># without multiprocessing</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">)):</span>
<span class="n">obsh</span><span class="o">.</span><span class="n">prog_msg</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">),</span> <span class="n">msgtype</span><span class="o">=</span><span class="n">msgtype</span><span class="p">,</span> <span class="n">nscan_last</span><span class="o">=</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
Expand Down
4 changes: 2 additions & 2 deletions _modules/ehtim/calibrating/self_cal.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ <h1>Source code for ehtim.calibrating.self_cal</h1><div class="highlight"><pre>
<span class="n">show_solution</span><span class="p">,</span> <span class="n">pad_amp</span><span class="p">,</span> <span class="n">gain_tol</span><span class="p">,</span>
<span class="n">debias</span><span class="p">,</span> <span class="n">caltable</span><span class="p">,</span> <span class="n">msgtype</span><span class="p">,</span>
<span class="n">use_grad</span>
<span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">))]),</span>
<span class="n">dtype</span><span class="o">=</span><span class="nb">object</span><span class="p">)</span>
<span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">))]))</span>
<span class="c1">#dtype=object)</span>

<span class="k">else</span><span class="p">:</span> <span class="c1"># run on a single core</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">scans</span><span class="p">)):</span>
Expand Down
23 changes: 16 additions & 7 deletions _modules/ehtim/caltable.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,15 @@ <h1>Source code for ehtim.caltable</h1><div class="highlight"><pre>
<span class="sd"> matplotlib.axes</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># sites</span>
<span class="k">if</span> <span class="n">sites</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;all&#39;</span> <span class="ow">or</span> <span class="s1">&#39;All&#39;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">sites</span> <span class="o">==</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">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="n">sites</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;all&#39;</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">]</span>


<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sites</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>

<span class="n">keys</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">tkey</span><span class="p">[</span><span class="n">site</span><span class="p">]</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">sites</span><span class="p">]</span>

<span class="n">axes</span> <span class="o">=</span> <span class="n">plot_tarr_dterms</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">tarr</span><span class="p">,</span> <span class="n">keys</span><span class="o">=</span><span class="n">keys</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">,</span> <span class="n">legend</span><span class="o">=</span><span class="n">legend</span><span class="p">,</span> <span class="n">clist</span><span class="o">=</span><span class="n">clist</span><span class="p">,</span>
Expand Down Expand Up @@ -280,12 +283,15 @@ <h1>Source code for ehtim.caltable</h1><div class="highlight"><pre>
<span class="n">x</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_subplot</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>

<span class="c1"># sites</span>
<span class="k">if</span> <span class="n">sites</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;all&#39;</span> <span class="ow">or</span> <span class="s1">&#39;All&#39;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">sites</span> <span class="o">==</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">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="n">sites</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;all&#39;</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">]</span>

<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sites</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span>

<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">markersize</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">markersize</span> <span class="o">=</span> <span class="n">markersize</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">ones</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">sites</span><span class="p">))</span>

Expand Down Expand Up @@ -1015,12 +1021,15 @@ <h1>Source code for ehtim.caltable</h1><div class="highlight"><pre>
<span class="n">caltab2</span> <span class="o">=</span> <span class="n">caltab2</span><span class="o">.</span><span class="n">scan_avg</span><span class="p">(</span><span class="n">obs</span><span class="p">,</span> <span class="n">incoherent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="c1"># sites</span>
<span class="k">if</span> <span class="n">sites</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;all&#39;</span> <span class="ow">or</span> <span class="s1">&#39;All&#39;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">sites</span> <span class="o">==</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">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="n">sites</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;all&#39;</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">caltab1</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">caltab2</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sites</span><span class="p">,</span><span class="nb">str</span><span class="p">):</span>
<span class="n">sites</span> <span class="o">=</span> <span class="p">[</span><span class="n">sites</span><span class="p">]</span>

<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sites</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
<span class="n">sites</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">caltab1</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">caltab2</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span>

<span class="k">if</span> <span class="n">site_name_dict</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;hi&#39;</span><span class="p">)</span>
<span class="n">site_name_dict</span> <span class="o">=</span> <span class="p">{}</span>
Expand Down
Loading

0 comments on commit 7b922d9

Please sign in to comment.