Skip to content

Commit

Permalink
Deploying to gh-pages from @ ecd17d6 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Nov 21, 2023
1 parent b120a66 commit c82d335
Show file tree
Hide file tree
Showing 27 changed files with 478 additions and 400 deletions.
2 changes: 1 addition & 1 deletion _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../authors.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changes.html">Changelog</a></li>
</ul>

</div>
Expand Down
22 changes: 8 additions & 14 deletions _modules/xdatasets/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../changes.html">Changelog</a></li>
</ul>

</div>
Expand Down Expand Up @@ -205,11 +205,10 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">logging.config</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">,</span> <span class="n">Union</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Union</span>

<span class="kn">import</span> <span class="nn">geopandas</span> <span class="k">as</span> <span class="nn">gpd</span>
<span class="kn">import</span> <span class="nn">intake</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">xarray</span> <span class="k">as</span> <span class="nn">xr</span>

<span class="kn">from</span> <span class="nn">.scripting</span> <span class="kn">import</span> <span class="n">LOGGING_CONFIG</span>
Expand Down Expand Up @@ -330,8 +329,7 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="n">averaging</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">unique_id</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Resolves and validates user-provided space params</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Resolves and validates user-provided space params.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
Expand All @@ -345,7 +343,6 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="sd"> unique_id : str, optional</span>
<span class="sd"> a column name, if gdf.DataFrame is provided, to identify each unique geometry</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">space</span> <span class="o">=</span> <span class="nb">locals</span><span class="p">()</span>
<span class="n">space</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;self&quot;</span><span class="p">)</span>

Expand Down Expand Up @@ -376,14 +373,13 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="n">timezone</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">minimum_duration</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Resolves and validates user-provided time params</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Resolves and validates user-provided time params.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> timestep : str, optional</span>
<span class="sd"> In which time step should the data be returned</span>
<span class="sd"> Possible values : http://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases</span>
<span class="sd"> Possible values: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases</span>
<span class="sd"> aggregation : Dict[str, callable], optional</span>
<span class="sd"> Mapping that associates a variable name with the aggregation function</span>
<span class="sd"> to be applied to it. Function which can be called in the form</span>
Expand All @@ -404,9 +400,8 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="sd"> https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568</span>
<span class="sd"> minimum_duration : str, optional</span>
<span class="sd"> Minimum duration of a time series (id) in order to be kept</span>
<span class="sd"> Possible values : http://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases</span>
<span class="sd"> Possible values: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">space</span> <span class="o">=</span> <span class="nb">locals</span><span class="p">()</span>
<span class="n">space</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;self&quot;</span><span class="p">)</span>

Expand Down Expand Up @@ -443,7 +438,7 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="c1"># Load data for each dataset</span>
<span class="n">dsets</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">dataset_name</span> <span class="ow">in</span> <span class="n">datasets_name</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="kc">None</span>
<span class="c1"># data = None</span>
<span class="n">kwargs</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">variables_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">datasets</span><span class="p">[</span><span class="n">dataset_name</span><span class="p">][</span><span class="s2">&quot;variables&quot;</span><span class="p">]</span>
Expand Down Expand Up @@ -492,7 +487,7 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="s2">&quot;data&quot;</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;data&quot;</span><span class="p">]</span>

<span class="k">if</span> <span class="n">data</span> <span class="o">!=</span> <span class="kc">None</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">xr</span><span class="o">.</span><span class="n">Dataset</span><span class="p">):</span>
<span class="k">if</span> <span class="n">data</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">xr</span><span class="o">.</span><span class="n">Dataset</span><span class="p">):</span>
<span class="n">dataset_category</span> <span class="o">=</span> <span class="s2">&quot;user-provided&quot;</span>

<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dataset_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
Expand Down Expand Up @@ -525,7 +520,6 @@ <h1>Source code for xdatasets.core</h1><div class="highlight"><pre>
<div class="viewcode-block" id="Query.bbox_clip">
<a class="viewcode-back" href="../../apidoc/xdatasets.html#xdatasets.core.Query.bbox_clip">[docs]</a>
<span class="k">def</span> <span class="nf">bbox_clip</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ds</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">ds</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="o">~</span><span class="n">ds</span><span class="o">.</span><span class="n">isnull</span><span class="p">(),</span> <span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions _modules/xdatasets/spatial.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../changes.html">Changelog</a></li>
</ul>

</div>
Expand Down Expand Up @@ -337,7 +337,7 @@ <h1>Source code for xdatasets.spatial</h1><div class="highlight"><pre>
<span class="c1"># TODO : adapt logic for coordinate names</span>

<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Spatial operations: processing points with </span><span class="si">{</span><span class="n">dataset_name</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Spatial operations: processing points with </span><span class="si">{</span><span class="n">dataset_name</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="n">lat</span><span class="p">,</span> <span class="n">lon</span> <span class="o">=</span> <span class="nb">zip</span><span class="p">(</span><span class="o">*</span><span class="n">space</span><span class="p">[</span><span class="s2">&quot;geometry&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">subset_gridpoint</span><span class="p">(</span>
Expand Down
10 changes: 4 additions & 6 deletions _modules/xdatasets/temporal.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../changes.html">Changelog</a></li>
</ul>

</div>
Expand Down Expand Up @@ -245,7 +245,7 @@ <h1>Source code for xdatasets.temporal</h1><div class="highlight"><pre>
<span class="n">operation</span> <span class="o">=</span> <span class="n">operation</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">operation</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="k">else</span> <span class="p">[</span><span class="n">operation</span><span class="p">]</span>
<span class="n">oper_list</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">oper</span> <span class="ow">in</span> <span class="n">operation</span><span class="p">:</span>
<span class="n">var_name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">var</span><span class="si">}</span><span class="s2">_</span><span class="si">{</span><span class="n">oper</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="c1"># var_name = f&quot;{var}_{oper.__name__}&quot;</span>
<span class="n">da</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">ds</span><span class="p">[</span><span class="n">var</span><span class="p">]</span>
<span class="o">.</span><span class="n">resample</span><span class="p">(</span><span class="n">time</span><span class="o">=</span><span class="n">time</span><span class="p">[</span><span class="s2">&quot;timestep&quot;</span><span class="p">])</span>
Expand Down Expand Up @@ -287,19 +287,17 @@ <h1>Source code for xdatasets.temporal</h1><div class="highlight"><pre>
<div class="viewcode-block" id="ajust_dates">
<a class="viewcode-back" href="../../apidoc/xdatasets.html#xdatasets.temporal.ajust_dates">[docs]</a>
<span class="k">def</span> <span class="nf">ajust_dates</span><span class="p">(</span><span class="n">ds</span><span class="p">,</span> <span class="n">time</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot; &quot;&quot;&quot;</span>

<span class="n">start</span> <span class="o">=</span> <span class="n">time</span><span class="p">[</span><span class="s2">&quot;start&quot;</span><span class="p">]</span>
<span class="n">end</span> <span class="o">=</span> <span class="n">time</span><span class="p">[</span><span class="s2">&quot;end&quot;</span><span class="p">]</span>

<span class="k">if</span> <span class="n">start</span> <span class="o">!=</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">start</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">ds</span><span class="p">[</span><span class="s2">&quot;start_date&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">xr</span><span class="o">.</span><span class="n">where</span><span class="p">(</span>
<span class="n">ds</span><span class="o">.</span><span class="n">start_date</span> <span class="o">&lt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">Timestamp</span><span class="p">(</span><span class="n">start</span><span class="p">),</span>
<span class="n">np</span><span class="o">.</span><span class="n">datetime64</span><span class="p">(</span><span class="n">start</span><span class="p">),</span>
<span class="n">ds</span><span class="o">.</span><span class="n">start_date</span><span class="p">,</span>
<span class="p">)</span>

<span class="k">if</span> <span class="n">end</span> <span class="o">!=</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">end</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">ds</span><span class="p">[</span><span class="s2">&quot;end_date&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">xr</span><span class="o">.</span><span class="n">where</span><span class="p">(</span>
<span class="n">ds</span><span class="o">.</span><span class="n">end_date</span> <span class="o">&gt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">Timestamp</span><span class="p">(</span><span class="n">end</span><span class="p">),</span>
<span class="n">np</span><span class="o">.</span><span class="n">datetime64</span><span class="p">(</span><span class="n">end</span><span class="p">),</span>
Expand Down
10 changes: 2 additions & 8 deletions _modules/xdatasets/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../changes.html">Changelog</a></li>
</ul>

</div>
Expand Down Expand Up @@ -207,13 +207,7 @@ <h1>Source code for xdatasets.tutorial</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">html</span> <span class="kn">import</span> <span class="n">escape</span>

<span class="kn">from</span> <span class="nn">IPython.core.display</span> <span class="kn">import</span> <span class="n">HTML</span>
<span class="kn">from</span> <span class="nn">xarray.core.formatting_html</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">_icon</span><span class="p">,</span>
<span class="n">_load_static_files</span><span class="p">,</span>
<span class="n">_mapping_section</span><span class="p">,</span>
<span class="n">_obj_repr</span><span class="p">,</span>
<span class="n">format_dims</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">xarray.core.formatting_html</span> <span class="kn">import</span> <span class="n">_icon</span><span class="p">,</span> <span class="n">_mapping_section</span><span class="p">,</span> <span class="n">_obj_repr</span>

<span class="n">catalog_path</span> <span class="o">=</span> <span class="s2">&quot;https://raw.githubusercontent.com/hydrocloudservices/catalogs/main/catalogs/main.yaml&quot;</span>

Expand Down
Loading

0 comments on commit c82d335

Please sign in to comment.