Skip to content

Commit fb017af

Browse files
committedAug 30, 2024
Update documentation
1 parent 8645a90 commit fb017af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎_modules/kerchunk/grib2.html

+3
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,10 @@ <h1>Source code for kerchunk.grib2</h1><div class="highlight"><pre>
928928
<span class="c1"># grib idx is fortran indexed (from one not zero)</span>
929929
<span class="nb">list</span><span class="p">(</span>
930930
<span class="nb">filter</span><span class="p">(</span>
931+
<span class="c1"># filtering out the cfgrib metadata dataframe in case it is None</span>
931932
<span class="k">lambda</span> <span class="n">item</span><span class="p">:</span> <span class="n">item</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">,</span>
932933
<span class="p">[</span>
934+
<span class="c1"># extracting the metadata from a single message</span>
933935
<span class="n">_extract_single_group</span><span class="p">(</span><span class="n">mapper</span><span class="p">(</span><span class="n">group</span><span class="p">),</span> <span class="n">i</span><span class="p">)</span>
934936
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">group</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span>
935937
<span class="n">scan_grib</span><span class="p">(</span><span class="n">fname</span><span class="p">,</span> <span class="n">storage_options</span><span class="o">=</span><span class="n">storage_options</span><span class="p">),</span> <span class="n">start</span><span class="o">=</span><span class="mi">1</span>
@@ -941,6 +943,7 @@ <h1>Source code for kerchunk.grib2</h1><div class="highlight"><pre>
941943

942944

943945
<span class="k">def</span> <span class="nf">_extract_single_group</span><span class="p">(</span><span class="n">grib_group</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">idx</span><span class="p">:</span> <span class="nb">int</span><span class="p">):</span>
946+
<span class="c1"># This function, returns the grib metadata as a dataframe, on a per message basis.</span>
944947
<span class="kn">import</span> <span class="nn">datatree</span>
945948

946949
<span class="n">grib_tree_store</span> <span class="o">=</span> <span class="n">grib_tree</span><span class="p">(</span>

0 commit comments

Comments
 (0)