Skip to content

Commit

Permalink
fix de-duping
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMount committed Feb 16, 2023
1 parent 6a2f0e9 commit 447920b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ wvu/util.py 324 7 98%
TOTAL 328 7 98%


============================= 16 passed in 10.38s ==============================
============================== 16 passed in 9.81s ==============================
2 changes: 1 addition & 1 deletion pkg/build/lib/wvu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def threshold_statistics(
if sorted_frame.shape[0] > 1:
want_row = [True] + list(
numpy.array(sorted_frame["threshold"][range(sorted_frame.shape[0]-1)])
!= numpy.array(sorted_frame["threshold"][range(1, sorted_frame.shape[0])])
< numpy.array(sorted_frame["threshold"][range(1, sorted_frame.shape[0])])
)
sorted_frame = sorted_frame.loc[want_row, :].reset_index(drop=True, inplace=False)
return sorted_frame
Expand Down
Binary file modified pkg/dist/wvu-0.3.9-py3-none-any.whl
Binary file not shown.
Binary file modified pkg/dist/wvu-0.3.9.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions pkg/docs/wvu/util.html
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ <h1 class="modulename">
</span><span id="L-788"><a href="#L-788"><span class="linenos">788</span></a> <span class="k">if</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
</span><span id="L-789"><a href="#L-789"><span class="linenos">789</span></a> <span class="n">want_row</span> <span class="o">=</span> <span class="p">[</span><span class="kc">True</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span>
</span><span id="L-790"><a href="#L-790"><span class="linenos">790</span></a> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="mi">1</span><span class="p">)])</span>
</span><span id="L-791"><a href="#L-791"><span class="linenos">791</span></a> <span class="o">!=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])])</span>
</span><span id="L-791"><a href="#L-791"><span class="linenos">791</span></a> <span class="o">&lt;</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])])</span>
</span><span id="L-792"><a href="#L-792"><span class="linenos">792</span></a> <span class="p">)</span>
</span><span id="L-793"><a href="#L-793"><span class="linenos">793</span></a> <span class="n">sorted_frame</span> <span class="o">=</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">want_row</span><span class="p">,</span> <span class="p">:]</span><span class="o">.</span><span class="n">reset_index</span><span class="p">(</span><span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span><span id="L-794"><a href="#L-794"><span class="linenos">794</span></a> <span class="k">return</span> <span class="n">sorted_frame</span>
Expand Down Expand Up @@ -2578,7 +2578,7 @@ <h6 id="returns">Returns</h6>
</span><span id="threshold_statistics-789"><a href="#threshold_statistics-789"><span class="linenos">789</span></a> <span class="k">if</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
</span><span id="threshold_statistics-790"><a href="#threshold_statistics-790"><span class="linenos">790</span></a> <span class="n">want_row</span> <span class="o">=</span> <span class="p">[</span><span class="kc">True</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span>
</span><span id="threshold_statistics-791"><a href="#threshold_statistics-791"><span class="linenos">791</span></a> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="mi">1</span><span class="p">)])</span>
</span><span id="threshold_statistics-792"><a href="#threshold_statistics-792"><span class="linenos">792</span></a> <span class="o">!=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])])</span>
</span><span id="threshold_statistics-792"><a href="#threshold_statistics-792"><span class="linenos">792</span></a> <span class="o">&lt;</span> <span class="n">numpy</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">sorted_frame</span><span class="p">[</span><span class="s2">&quot;threshold&quot;</span><span class="p">][</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])])</span>
</span><span id="threshold_statistics-793"><a href="#threshold_statistics-793"><span class="linenos">793</span></a> <span class="p">)</span>
</span><span id="threshold_statistics-794"><a href="#threshold_statistics-794"><span class="linenos">794</span></a> <span class="n">sorted_frame</span> <span class="o">=</span> <span class="n">sorted_frame</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">want_row</span><span class="p">,</span> <span class="p">:]</span><span class="o">.</span><span class="n">reset_index</span><span class="p">(</span><span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span><span id="threshold_statistics-795"><a href="#threshold_statistics-795"><span class="linenos">795</span></a> <span class="k">return</span> <span class="n">sorted_frame</span>
Expand Down
2 changes: 1 addition & 1 deletion pkg/wvu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def threshold_statistics(
if sorted_frame.shape[0] > 1:
want_row = [True] + list(
numpy.array(sorted_frame["threshold"][range(sorted_frame.shape[0]-1)])
!= numpy.array(sorted_frame["threshold"][range(1, sorted_frame.shape[0])])
< numpy.array(sorted_frame["threshold"][range(1, sorted_frame.shape[0])])
)
sorted_frame = sorted_frame.loc[want_row, :].reset_index(drop=True, inplace=False)
return sorted_frame
Expand Down

0 comments on commit 447920b

Please sign in to comment.