Skip to content

Commit

Permalink
⚡ Improved by 100% the extraction performance
Browse files Browse the repository at this point in the history
Appended only the class blocks to the Gps and Spectrum classes. The levels, timestamp and gps data are only extracted inside those classes as demanded using fastcore's L methods
  • Loading branch information
ronaldokun committed Jan 11, 2022
1 parent 69284fd commit 2644411
Show file tree
Hide file tree
Showing 13 changed files with 448 additions and 372 deletions.
12 changes: 6 additions & 6 deletions docs/blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ <h2 id="DType51" class="doc_header"><code>class</code> <code>DType51</code><a hr
<span class="k">return</span> <span class="n">bin2int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">])</span>

<span class="nd">@cached</span>
<span class="k">def</span> <span class="nf">real_time_bw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">bw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">BYTES_51</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span><span class="o">.</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">desclen</span> <span class="o">+</span> <span class="mi">6</span>
<span class="n">stop</span> <span class="o">=</span> <span class="n">start</span> <span class="o">+</span> <span class="mi">4</span>
<span class="k">return</span> <span class="n">bin2int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">])</span>
Expand Down Expand Up @@ -2336,10 +2336,10 @@ <h2 id="DType63" class="doc_header"><code>class</code> <code>DType63</code><a hr
<span class="bp">self</span><span class="o">.</span><span class="n">start_mega</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">stop_mega</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ndata</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span>
<span class="p">)</span>

<span class="nd">@cached</span>
<span class="k">def</span> <span class="nf">bw</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">int</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;Retorna o RBW calculado a partir de STARTMEGA, STOPMEGA e NDATA.&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">int</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">stop_mega</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">start_mega</span><span class="p">)</span> <span class="o">*</span> <span class="mi">1000</span> <span class="o">/</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ndata</span> <span class="o">-</span> <span class="mi">1</span><span class="p">))</span>
<span class="c1"># @cached</span>
<span class="c1"># def bw(self) -&gt; int:</span>
<span class="c1"># &quot;&quot;&quot;Retorna o RBW calculado a partir de STARTMEGA, STOPMEGA e NDATA.&quot;&quot;&quot;</span>
<span class="c1"># return int((self.stop_mega - self.start_mega) * 1000 / (self.ndata - 1))</span>

<span class="nd">@cached</span>
<span class="k">def</span> <span class="nf">tunning</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">:</span>
Expand Down Expand Up @@ -2763,7 +2763,7 @@ <h2 id="DType66" class="doc_header"><code>class</code> <code>DType66</code><a hr
<span class="k">return</span> <span class="n">bin2int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">])</span>

<span class="nd">@cached</span>
<span class="k">def</span> <span class="nf">real_time_bw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">bw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">BYTES_V5</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span><span class="o">.</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">desclen</span> <span class="o">+</span> <span class="mi">6</span>
<span class="n">stop</span> <span class="o">=</span> <span class="n">start</span> <span class="o">+</span> <span class="mi">4</span>
<span class="k">return</span> <span class="n">bin2int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">start</span><span class="p">:</span><span class="n">stop</span><span class="p">])</span>
Expand Down
3 changes: 1 addition & 2 deletions docs/constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ <h3 id="Variables-Used-in-parser.py">Variables Used in <code>parser.py</code><a
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">KEY_ATTRS</span> <span class="o">=</span> <span class="p">{</span>
<span class="mi">3</span><span class="p">:</span> <span class="p">(),</span>
<span class="mi">4</span><span class="p">:</span> <span class="p">(</span>
<span class="s2">&quot;type&quot;</span><span class="p">,</span>
<span class="s2">&quot;thread_id&quot;</span><span class="p">,</span>
Expand Down Expand Up @@ -287,7 +288,6 @@ <h3 id="Variables-Used-in-parser.py">Variables Used in <code>parser.py</code><a
<span class="s2">&quot;stop_mega&quot;</span><span class="p">,</span>
<span class="s2">&quot;dtype&quot;</span><span class="p">,</span>
<span class="s2">&quot;ndata&quot;</span><span class="p">,</span>
<span class="s2">&quot;bw&quot;</span><span class="p">,</span>
<span class="s2">&quot;processing&quot;</span><span class="p">,</span>
<span class="s2">&quot;antuid&quot;</span><span class="p">,</span>
<span class="p">),</span>
Expand All @@ -301,7 +301,6 @@ <h3 id="Variables-Used-in-parser.py">Variables Used in <code>parser.py</code><a
<span class="s2">&quot;stop_mega&quot;</span><span class="p">,</span>
<span class="s2">&quot;dtype&quot;</span><span class="p">,</span>
<span class="s2">&quot;ndata&quot;</span><span class="p">,</span>
<span class="s2">&quot;bw&quot;</span><span class="p">,</span>
<span class="s2">&quot;processing&quot;</span><span class="p">,</span>
<span class="s2">&quot;antuid&quot;</span><span class="p">,</span>
<span class="p">),</span>
Expand Down
Loading

0 comments on commit 2644411

Please sign in to comment.