Browse Source

Add of utils functions

Jérôme BUISINE 2 years ago
parent
commit
4650c42497

BIN
docs/build/doctrees/environment.pickle


BIN
docs/build/doctrees/ipfml/ipfml.utils.doctree


+ 1 - 1
docs/build/html/.buildinfo

@@ -1,4 +1,4 @@
 # Sphinx build info version 1
 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 166ca7333fd29b7f14d55e560d83c099
+config: 9cc5ffaae73bff096a40a243083d6a12
 tags: 645f666f9bcd5a90fca523b33c5a78b7

+ 2 - 2
docs/build/html/_modules/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Overview: module code &mdash; IPFML v0.3.3 documentation</title>
+  <title>Overview: module code &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/filters/noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/iqa/fr.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.iqa.fr &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.iqa.fr &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 48 - 4
docs/build/html/_modules/ipfml/utils.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.utils &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.utils &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           
@@ -254,7 +254,7 @@
     <span class="sd">&quot;&quot;&quot;Returns area under curves from provided data points using Trapezium rule</span>
 
 <span class="sd">    Args:</span>
-<span class="sd">        points: array of point coordinates</span>
+<span class="sd">        y_values: y values of curve</span>
 <span class="sd">        dx: number of unit for x axis</span>
 
 <span class="sd">    Returns:</span>
@@ -277,7 +277,7 @@
     <span class="sd">&quot;&quot;&quot;Returns area under curves from provided data points using Simpsons rule</span>
 
 <span class="sd">    Args:</span>
-<span class="sd">        points: array of point coordinates</span>
+<span class="sd">        y_values: y values of curve</span>
 <span class="sd">        dx: number of unit for x axis</span>
 
 <span class="sd">    Returns:</span>
@@ -294,6 +294,50 @@
 <span class="sd">    &quot;&quot;&quot;</span>
 
     <span class="k">return</span> <span class="n">simps</span><span class="p">(</span><span class="n">y_values</span><span class="p">,</span> <span class="n">dx</span><span class="o">=</span><span class="n">dx</span><span class="p">)</span></div>
+
+
+<div class="viewcode-block" id="get_indices_of_highest_values"><a class="viewcode-back" href="../../ipfml/ipfml.utils.html#ipfml.utils.get_indices_of_highest_values">[docs]</a><span class="k">def</span> <span class="nf">get_indices_of_highest_values</span><span class="p">(</span><span class="n">arr</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;Returns indices of n highest values from list or 1D numpy array</span>
+
+<span class="sd">    Args:</span>
+<span class="sd">        arr: List of numpy array</span>
+<span class="sd">        n: number of highest elements wanted</span>
+
+<span class="sd">    Returns:</span>
+<span class="sd">        `n` indices of highest values</span>
+
+<span class="sd">    Example:</span>
+
+<span class="sd">    &gt;&gt;&gt; from ipfml import utils</span>
+<span class="sd">    &gt;&gt;&gt; import numpy as np</span>
+<span class="sd">    &gt;&gt;&gt; arr = np.arange(10)</span>
+<span class="sd">    &gt;&gt;&gt; indices = utils.get_indices_of_highest_values(arr, 2)</span>
+<span class="sd">    &gt;&gt;&gt; indices</span>
+<span class="sd">    array([9, 8])</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">arr</span><span class="p">)</span><span class="o">.</span><span class="n">argsort</span><span class="p">()[</span><span class="o">-</span><span class="n">n</span><span class="p">:][::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
+
+
+<div class="viewcode-block" id="get_indices_of_lowest_values"><a class="viewcode-back" href="../../ipfml/ipfml.utils.html#ipfml.utils.get_indices_of_lowest_values">[docs]</a><span class="k">def</span> <span class="nf">get_indices_of_lowest_values</span><span class="p">(</span><span class="n">arr</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;Returns indices of n highest values from list or 1D numpy array</span>
+
+<span class="sd">    Args:</span>
+<span class="sd">        arr: List of numpy array</span>
+<span class="sd">        n: number of highest elements wanted</span>
+
+<span class="sd">    Returns:</span>
+<span class="sd">        `n` indices of highest values</span>
+
+<span class="sd">    Example:</span>
+
+<span class="sd">    &gt;&gt;&gt; from ipfml import utils</span>
+<span class="sd">    &gt;&gt;&gt; import numpy as np</span>
+<span class="sd">    &gt;&gt;&gt; arr = np.arange(10)</span>
+<span class="sd">    &gt;&gt;&gt; indices = utils.get_indices_of_lowest_values(arr, 2)</span>
+<span class="sd">    &gt;&gt;&gt; indices</span>
+<span class="sd">    array([0, 1])</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">arr</span><span class="p">)</span><span class="o">.</span><span class="n">argsort</span><span class="p">()[::</span><span class="o">-</span><span class="mi">1</span><span class="p">][</span><span class="o">-</span><span class="n">n</span><span class="p">:][::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div>
 </pre></div>
 
            </div>

+ 2 - 0
docs/build/html/_sources/ipfml/ipfml.utils.rst.txt

@@ -9,6 +9,8 @@ ipfml.utils
 
    .. autosummary::
    
+      get_indices_of_highest_values
+      get_indices_of_lowest_values
       integral_area_simps
       integral_area_trapz
       normalize_2D_arr

+ 1 - 1
docs/build/html/_static/documentation_options.js

@@ -1,6 +1,6 @@
 var DOCUMENTATION_OPTIONS = {
     URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
-    VERSION: 'v0.3.3',
+    VERSION: 'v0.3.4',
     LANGUAGE: 'None',
     COLLAPSE_INDEX: false,
     FILE_SUFFIX: '.html',

+ 2 - 2
docs/build/html/contributing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Contributing &mdash; IPFML v0.3.3 documentation</title>
+  <title>Contributing &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/description.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Description &mdash; IPFML v0.3.3 documentation</title>
+  <title>Description &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/examples.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Examples &mdash; IPFML v0.3.3 documentation</title>
+  <title>Examples &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 8 - 4
docs/build/html/genindex.html

@@ -9,7 +9,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Index &mdash; IPFML v0.3.3 documentation</title>
+  <title>Index &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           
@@ -202,6 +202,10 @@
       <li><a href="ipfml/ipfml.filters.noise.html#ipfml.filters.noise.gaussian_noise">gaussian_noise() (in module ipfml.filters.noise)</a>
 </li>
       <li><a href="ipfml/ipfml.metrics.html#ipfml.metrics.get_bits_img">get_bits_img() (in module ipfml.metrics)</a>
+</li>
+      <li><a href="ipfml/ipfml.utils.html#ipfml.utils.get_indices_of_highest_values">get_indices_of_highest_values() (in module ipfml.utils)</a>
+</li>
+      <li><a href="ipfml/ipfml.utils.html#ipfml.utils.get_indices_of_lowest_values">get_indices_of_lowest_values() (in module ipfml.utils)</a>
 </li>
       <li><a href="ipfml/ipfml.metrics.html#ipfml.metrics.get_LAB">get_LAB() (in module ipfml.metrics)</a>
 </li>
@@ -216,11 +220,11 @@
       <li><a href="ipfml/ipfml.processing.html#ipfml.processing.get_LAB_L_SVD_s">get_LAB_L_SVD_s() (in module ipfml.processing)</a>
 </li>
       <li><a href="ipfml/ipfml.processing.html#ipfml.processing.get_LAB_L_SVD_U">get_LAB_L_SVD_U() (in module ipfml.processing)</a>
-</li>
-      <li><a href="ipfml/ipfml.processing.html#ipfml.processing.get_LAB_L_SVD_V">get_LAB_L_SVD_V() (in module ipfml.processing)</a>
 </li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="ipfml/ipfml.processing.html#ipfml.processing.get_LAB_L_SVD_V">get_LAB_L_SVD_V() (in module ipfml.processing)</a>
+</li>
       <li><a href="ipfml/ipfml.metrics.html#ipfml.metrics.get_low_bits_img">get_low_bits_img() (in module ipfml.metrics)</a>
 </li>
       <li><a href="ipfml/ipfml.metrics.html#ipfml.metrics.get_SVD">get_SVD() (in module ipfml.metrics)</a>

+ 2 - 2
docs/build/html/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Image Processing For Machine Learning &mdash; IPFML v0.3.3 documentation</title>
+  <title>Image Processing For Machine Learning &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Documentation &mdash; IPFML v0.3.3 documentation</title>
+  <title>Documentation &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.filters.noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.iqa.fr.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.iqa.fr &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.iqa.fr &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 70 - 4
docs/build/html/ipfml/ipfml.utils.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.utils &mdash; IPFML v0.3.3 documentation</title>
+  <title>ipfml.utils &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           
@@ -174,6 +174,12 @@
 <col width="90%" />
 </colgroup>
 <tbody valign="top">
+<tr class="row-odd"><td><a class="reference internal" href="#ipfml.utils.get_indices_of_highest_values" title="ipfml.utils.get_indices_of_highest_values"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_indices_of_highest_values</span></code></a>(arr,&nbsp;n)</td>
+<td>Returns indices of n highest values from list or 1D numpy array</td>
+</tr>
+<tr class="row-even"><td><a class="reference internal" href="#ipfml.utils.get_indices_of_lowest_values" title="ipfml.utils.get_indices_of_lowest_values"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_indices_of_lowest_values</span></code></a>(arr,&nbsp;n)</td>
+<td>Returns indices of n highest values from list or 1D numpy array</td>
+</tr>
 <tr class="row-odd"><td><a class="reference internal" href="#ipfml.utils.integral_area_simps" title="ipfml.utils.integral_area_simps"><code class="xref py py-obj docutils literal notranslate"><span class="pre">integral_area_simps</span></code></a>(y_values,&nbsp;dx)</td>
 <td>Returns area under curves from provided data points using Simpsons rule</td>
 </tr>
@@ -191,6 +197,66 @@
 </tr>
 </tbody>
 </table>
+<dl class="function">
+<dt id="ipfml.utils.get_indices_of_highest_values">
+<code class="descclassname">ipfml.utils.</code><code class="descname">get_indices_of_highest_values</code><span class="sig-paren">(</span><em>arr</em>, <em>n</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/utils.html#get_indices_of_highest_values"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.utils.get_indices_of_highest_values" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns indices of n highest values from list or 1D numpy array</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>arr</strong> – List of numpy array</li>
+<li><strong>n</strong> – number of highest elements wanted</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><cite>n</cite> indices of highest values</p>
+</td>
+</tr>
+</tbody>
+</table>
+<p>Example:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">utils</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">indices</span> <span class="o">=</span> <span class="n">utils</span><span class="o">.</span><span class="n">get_indices_of_highest_values</span><span class="p">(</span><span class="n">arr</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">indices</span>
+<span class="go">array([9, 8])</span>
+</pre></div>
+</div>
+</dd></dl>
+
+<dl class="function">
+<dt id="ipfml.utils.get_indices_of_lowest_values">
+<code class="descclassname">ipfml.utils.</code><code class="descname">get_indices_of_lowest_values</code><span class="sig-paren">(</span><em>arr</em>, <em>n</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/utils.html#get_indices_of_lowest_values"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.utils.get_indices_of_lowest_values" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns indices of n highest values from list or 1D numpy array</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>arr</strong> – List of numpy array</li>
+<li><strong>n</strong> – number of highest elements wanted</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><cite>n</cite> indices of highest values</p>
+</td>
+</tr>
+</tbody>
+</table>
+<p>Example:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">ipfml</span> <span class="k">import</span> <span class="n">utils</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">arr</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">indices</span> <span class="o">=</span> <span class="n">utils</span><span class="o">.</span><span class="n">get_indices_of_lowest_values</span><span class="p">(</span><span class="n">arr</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">indices</span>
+<span class="go">array([0, 1])</span>
+</pre></div>
+</div>
+</dd></dl>
+
 <dl class="function">
 <dt id="ipfml.utils.integral_area_simps">
 <code class="descclassname">ipfml.utils.</code><code class="descname">integral_area_simps</code><span class="sig-paren">(</span><em>y_values</em>, <em>dx</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/ipfml/utils.html#integral_area_simps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ipfml.utils.integral_area_simps" title="Permalink to this definition">¶</a></dt>
@@ -200,7 +266,7 @@
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>points</strong> – array of point coordinates</li>
+<li><strong>y_values</strong> – y values of curve</li>
 <li><strong>dx</strong> – number of unit for x axis</li>
 </ul>
 </td>
@@ -230,7 +296,7 @@
 <col class="field-body" />
 <tbody valign="top">
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
-<li><strong>points</strong> – array of point coordinates</li>
+<li><strong>y_values</strong> – y values of curve</li>
 <li><strong>dx</strong> – number of unit for x axis</li>
 </ul>
 </td>

BIN
docs/build/html/objects.inv


+ 2 - 2
docs/build/html/py-modindex.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Python Module Index &mdash; IPFML v0.3.3 documentation</title>
+  <title>Python Module Index &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -59,7 +59,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

+ 2 - 2
docs/build/html/search.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Search &mdash; IPFML v0.3.3 documentation</title>
+  <title>Search &mdash; IPFML v0.3.4 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.3
+                0.3.4
               </div>
             
           

File diff suppressed because it is too large
+ 1 - 1
docs/build/html/searchindex.js


+ 2 - 2
docs/source/conf.py

@@ -24,9 +24,9 @@ copyright = '2019, Jérôme BUISINE'
 author = 'Jérôme BUISINE'
 
 # The short X.Y version
-version = '0.3.3'
+version = '0.3.4'
 # The full versiabson, including alpha/beta/rc tags
-release = 'v0.3.3'
+release = 'v0.3.4'
 
 
 # -- General configuration ---------------------------------------------------

+ 2 - 0
docs/source/ipfml/ipfml.utils.rst

@@ -9,6 +9,8 @@ ipfml.utils
 
    .. autosummary::
    
+      get_indices_of_highest_values
+      get_indices_of_lowest_values
       integral_area_simps
       integral_area_trapz
       normalize_2D_arr

+ 46 - 2
ipfml/utils.py

@@ -103,7 +103,7 @@ def integral_area_trapz(y_values, dx):
     """Returns area under curves from provided data points using Trapezium rule
 
     Args:
-        points: array of point coordinates
+        y_values: y values of curve
         dx: number of unit for x axis
 
     Returns:
@@ -126,7 +126,7 @@ def integral_area_simps(y_values, dx):
     """Returns area under curves from provided data points using Simpsons rule
 
     Args:
-        points: array of point coordinates
+        y_values: y values of curve
         dx: number of unit for x axis
 
     Returns:
@@ -143,3 +143,47 @@ def integral_area_simps(y_values, dx):
     """
 
     return simps(y_values, dx=dx)
+
+
+def get_indices_of_highest_values(arr, n):
+    """Returns indices of n highest values from list or 1D numpy array
+
+    Args:
+        arr: List of numpy array
+        n: number of highest elements wanted
+
+    Returns:
+        `n` indices of highest values
+
+    Example:
+
+    >>> from ipfml import utils
+    >>> import numpy as np
+    >>> arr = np.arange(10)
+    >>> indices = utils.get_indices_of_highest_values(arr, 2)
+    >>> indices
+    array([9, 8])
+    """
+    return np.array(arr).argsort()[-n:][::-1]
+
+
+def get_indices_of_lowest_values(arr, n):
+    """Returns indices of n highest values from list or 1D numpy array
+
+    Args:
+        arr: List of numpy array
+        n: number of highest elements wanted
+
+    Returns:
+        `n` indices of highest values
+
+    Example:
+
+    >>> from ipfml import utils
+    >>> import numpy as np
+    >>> arr = np.arange(10)
+    >>> indices = utils.get_indices_of_lowest_values(arr, 2)
+    >>> indices
+    array([0, 1])
+    """
+    return np.array(arr).argsort()[::-1][-n:][::-1]

+ 1 - 1
setup.py

@@ -31,7 +31,7 @@ class BuildTestCommand(setuptools.command.build_py.build_py):
 
 setup(
     name='ipfml',
-    version='0.3.3',
+    version='0.3.4',
     description='Image Processing For Machine Learning',
     long_description=readme(),
     classifiers=[