-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd0314a
commit 94047bd
Showing
2 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -515,9 +515,9 @@ | |
<h1>Source code for icefit.peakfit</h1><div class="highlight"><pre> | ||
<span></span><span class="c1"># Tag & Probe efficiency (and scale factor) estimation.</span> | ||
<span class="c1"># Multiprocessing via Ray.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># </span> | ||
<span class="c1"># Notes:</span> | ||
<span class="c1"># </span> | ||
<span class="c1"># </span> | ||
<span class="c1"># - Keep all pdf functions normalized in the steering yml normalized,</span> | ||
<span class="c1"># otherwise not consistent (norm: True)</span> | ||
<span class="c1"># </span> | ||
|
@@ -553,9 +553,10 @@ <h1>Source code for icefit.peakfit</h1><div class="highlight"><pre> | |
|
||
<span class="kn">import</span> <span class="nn">ray</span> | ||
|
||
<span class="n">__VERSION__</span> <span class="o">=</span> <span class="mf">0.05</span> | ||
<span class="n">__VERSION__</span> <span class="o">=</span> <span class="mf">0.06</span> | ||
<span class="n">__AUTHOR__</span> <span class="o">=</span> <span class="s1">'[email protected]'</span> | ||
|
||
|
||
<span class="c1"># ========================================================================</span> | ||
<span class="c1"># Input processing</span> | ||
|
||
|
@@ -1213,12 +1214,15 @@ <h1>Source code for icefit.peakfit</h1><div class="highlight"><pre> | |
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--inputfile'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s1">'configs/peakfit/tune2.yml'</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Steering input YAML file"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
|
||
<span class="c1"># Override (optional)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--input_path'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Input path"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--output_name'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Output name"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--fit_type'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Fit type"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--num_cpus'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Number of CPUs"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--rng_seed'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Random seed"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--loss_type'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Loss type"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--input_path'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Input path"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--output_name'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Output name"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--fit_type'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Fit type"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--num_cpus'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Number of CPUs (0 for automatic)"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--rng_seed'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Random seed"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--loss_type'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Loss type"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--trials'</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Trials"</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">'?'</span><span class="p">)</span> | ||
|
||
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">'--draw_mnmatrix'</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">"Draw 2D MINOS profiles"</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">"store_true"</span><span class="p">)</span> | ||
|
||
<span class="n">args</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse_args</span><span class="p">()</span> | ||
<span class="nb">print</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> | ||
|
@@ -1250,8 +1254,14 @@ <h1>Source code for icefit.peakfit</h1><div class="highlight"><pre> | |
|
||
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">loss_type</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">p</span><span class="p">[</span><span class="s1">'techno'</span><span class="p">][</span><span class="s1">'loss_type'</span><span class="p">]</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">loss_type</span> | ||
<span class="c1"># -------------------------------------------------</span> | ||
|
||
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">trials</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">p</span><span class="p">[</span><span class="s1">'techno'</span><span class="p">][</span><span class="s1">'trials'</span><span class="p">]</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">trials</span> | ||
|
||
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">draw_mnmatrix</span><span class="p">:</span> | ||
<span class="n">p</span><span class="p">[</span><span class="s1">'techno'</span><span class="p">][</span><span class="s1">'draw_mnmatrix'</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span> | ||
<span class="c1"># -------------------------------------------------</span> | ||
|
||
<span class="nb">print</span><span class="p">(</span><span class="s1">'-----------------------------'</span><span class="p">)</span> | ||
<span class="n">cprint</span><span class="p">(</span><span class="sa">f</span><span class="s1">'peakfit </span><span class="si">{</span><span class="n">__VERSION__</span><span class="si">}</span><span class="s1"> (</span><span class="si">{</span><span class="n">__AUTHOR__</span><span class="si">}</span><span class="s1">)'</span><span class="p">,</span> <span class="s1">'magenta'</span><span class="p">)</span> | ||
<span class="nb">print</span><span class="p">(</span><span class="s1">''</span><span class="p">)</span> | ||
|
Binary file not shown.