Skip to content

Commit

Permalink
update docs (#43)
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
knaaptime authored Jan 2, 2020
2 parents 537995b + dc86eec commit 466ab35
Show file tree
Hide file tree
Showing 20 changed files with 438 additions and 98 deletions.
48 changes: 37 additions & 11 deletions docs/_modules/tobler/area_weighted/area_weighted.html

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions docs/_modules/tobler/dasymetric/masked_area_interpolate.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h1>Source code for tobler.dasymetric.masked_area_interpolate</h1><div class="hi
<div class="viewcode-block" id="masked_area_interpolate"><a class="viewcode-back" href="../../../generated/tobler.dasymetric.masked_area_interpolate.html#tobler.dasymetric.masked_area_interpolate">[docs]</a><span class="k">def</span> <span class="nf">masked_area_interpolate</span><span class="p">(</span>
<span class="n">source_df</span><span class="p">,</span>
<span class="n">target_df</span><span class="p">,</span>
<span class="n">raster_path</span><span class="o">=</span><span class="s2">&quot;nlcd_2011&quot;</span><span class="p">,</span>
<span class="n">raster</span><span class="o">=</span><span class="s2">&quot;nlcd_2011&quot;</span><span class="p">,</span>
<span class="n">codes</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">force_crs_match</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">extensive_variables</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
Expand All @@ -135,7 +135,7 @@ <h1>Source code for tobler.dasymetric.masked_area_interpolate</h1><div class="hi
<span class="sd"> source data to be converted to another geometric representation.</span>
<span class="sd"> target_df : geopandas.GeoDataFrame</span>
<span class="sd"> target geometries that will form the new representation of the input data</span>
<span class="sd"> raster_path : str</span>
<span class="sd"> raster : str</span>
<span class="sd"> path to raster file that contains ancillary data. </span>
<span class="sd"> alternatively a user can pass `ncld_2001` or `nlcd_2011` to use built-in data from the</span>
<span class="sd"> National Land Cover Database</span>
Expand All @@ -161,17 +161,19 @@ <h1>Source code for tobler.dasymetric.masked_area_interpolate</h1><div class="hi
<span class="sd"> variables as the columns</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">codes</span><span class="p">:</span>
<span class="n">codes</span> <span class="o">=</span> <span class="p">[</span><span class="mi">21</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">24</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">raster</span><span class="p">:</span>
<span class="n">raster</span> <span class="o">=</span> <span class="s1">&#39;nlcd_2011&#39;</span>

<span class="k">if</span> <span class="ow">not</span> <span class="n">tables</span><span class="p">:</span>
<span class="n">tables</span> <span class="o">=</span> <span class="n">area_tables_raster</span><span class="p">(</span>
<span class="n">source_df</span><span class="p">,</span>
<span class="n">target_df</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span>
<span class="n">raster_path</span><span class="o">=</span><span class="n">raster_path</span><span class="p">,</span>
<span class="n">raster_path</span><span class="o">=</span><span class="n">raster</span><span class="p">,</span>
<span class="n">codes</span><span class="o">=</span><span class="n">codes</span><span class="p">,</span>
<span class="n">force_crs_match</span><span class="o">=</span><span class="n">force_crs_match</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">codes</span><span class="p">:</span>
<span class="n">codes</span> <span class="o">=</span> <span class="p">[</span><span class="mi">21</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">24</span><span class="p">]</span>

<span class="c1"># In area_interpolate, the resulting variable has same length as target_df</span>
<span class="n">interpolation</span> <span class="o">=</span> <span class="n">_slow_area_interpolate</span><span class="p">(</span>
Expand Down
159 changes: 129 additions & 30 deletions docs/_modules/tobler/dasymetric/models.html

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions docs/_modules/tobler/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@

<h1>Source code for tobler.data</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">urllib.parse</span> <span class="kn">import</span> <span class="n">unquote</span><span class="p">,</span> <span class="n">urlparse</span>
<span class="kn">from</span> <span class="nn">warnings</span> <span class="kn">import</span> <span class="n">warn</span>
<span class="kn">from</span> <span class="nn">requests.exceptions</span> <span class="kn">import</span> <span class="n">Timeout</span>

<span class="kn">import</span> <span class="nn">quilt3</span>

Expand Down Expand Up @@ -153,12 +155,12 @@ <h1>Source code for tobler.data</h1><div class="highlight"><pre>

<span class="n">full_path</span> <span class="o">=</span> <span class="n">unquote</span><span class="p">(</span><span class="n">nlcd</span><span class="p">[</span><span class="n">path</span> <span class="o">+</span> <span class="s2">&quot;.tif&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">())</span>
<span class="n">full_path</span> <span class="o">=</span> <span class="n">urlparse</span><span class="p">(</span><span class="n">full_path</span><span class="p">)</span><span class="o">.</span><span class="n">path</span>

<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">IOError</span><span class="p">(</span>
<span class="n">warn</span><span class="p">(</span>
<span class="s2">&quot;Unable to locate local raster data. If you would like to use &quot;</span>
<span class="s2">&quot;raster data from the National Land Cover Database, you can &quot;</span>
<span class="s2">&quot;store it locally using the `data.store_rasters()` function&quot;</span>
<span class="p">)</span>
<span class="s2">&quot;store it locally using the `data.store_rasters()` function&quot;</span><span class="p">)</span>

<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">path</span>
Expand Down
3 changes: 2 additions & 1 deletion docs/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ variables being assigned to the target
.. autosummary::
:toctree: generated/

linear_model
glm
glm_pixel_adjusted
masked_area_interpolate


Expand Down
6 changes: 6 additions & 0 deletions docs/_sources/generated/tobler.dasymetric.glm.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tobler.dasymetric.glm
=====================

.. currentmodule:: tobler.dasymetric

.. autofunction:: glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tobler.dasymetric.glm\_pixel\_adjusted
======================================

.. currentmodule:: tobler.dasymetric

.. autofunction:: glm_pixel_adjusted

This file was deleted.

9 changes: 6 additions & 3 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,13 @@ <h2>Dasymetric<a class="headerlink" href="#dasymetric" title="Permalink to this
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/tobler.dasymetric.linear_model.html#tobler.dasymetric.linear_model" title="tobler.dasymetric.linear_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">linear_model</span></code></a>([source_df, target_df, raster, …])</p></td>
<td><p>Interpolate data between two polygonal datasets using an auxiliary raster to as inut to a linear regression model.</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/tobler.dasymetric.glm.html#tobler.dasymetric.glm" title="tobler.dasymetric.glm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">glm</span></code></a>([source_df, target_df, raster, …])</p></td>
<td><p>Estimate interpolated values using raster data as input to a generalized linear model.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/tobler.dasymetric.masked_area_interpolate.html#tobler.dasymetric.masked_area_interpolate" title="tobler.dasymetric.masked_area_interpolate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">masked_area_interpolate</span></code></a>(source_df, target_df)</p></td>
<tr class="row-even"><td><p><a class="reference internal" href="generated/tobler.dasymetric.glm_pixel_adjusted.html#tobler.dasymetric.glm_pixel_adjusted" title="tobler.dasymetric.glm_pixel_adjusted"><code class="xref py py-obj docutils literal notranslate"><span class="pre">glm_pixel_adjusted</span></code></a>([source_df, target_df, …])</p></td>
<td><p>Estimate interpolated values using raster data as input to a generalized linear model, then apply an adjustmnent factor based on pixel values.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/tobler.dasymetric.masked_area_interpolate.html#tobler.dasymetric.masked_area_interpolate" title="tobler.dasymetric.masked_area_interpolate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">masked_area_interpolate</span></code></a>(source_df, target_df)</p></td>
<td><p>Interpolate data between two polygonal datasets using an auxiliary raster to mask out uninhabited land.</p></td>
</tr>
</tbody>
Expand Down
12 changes: 6 additions & 6 deletions docs/generated/tobler.area_weighted.area_interpolate.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@
<h1>tobler.area_weighted.area_interpolate<a class="headerlink" href="#tobler-area-weighted-area-interpolate" title="Permalink to this headline"></a></h1>
<dl class="function">
<dt id="tobler.area_weighted.area_interpolate">
<code class="sig-prename descclassname">tobler.area_weighted.</code><code class="sig-name descname">area_interpolate</code><span class="sig-paren">(</span><em class="sig-param">source_df</em>, <em class="sig-param">target_df</em>, <em class="sig-param">extensive_variables=[]</em>, <em class="sig-param">intensive_variables=[]</em>, <em class="sig-param">table=None</em>, <em class="sig-param">allocate_total=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tobler/area_weighted/area_weighted.html#area_interpolate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tobler.area_weighted.area_interpolate" title="Permalink to this definition"></a></dt>
<code class="sig-prename descclassname">tobler.area_weighted.</code><code class="sig-name descname">area_interpolate</code><span class="sig-paren">(</span><em class="sig-param">source_df</em>, <em class="sig-param">target_df</em>, <em class="sig-param">extensive_variables=None</em>, <em class="sig-param">intensive_variables=None</em>, <em class="sig-param">table=None</em>, <em class="sig-param">allocate_total=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tobler/area_weighted/area_weighted.html#area_interpolate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tobler.area_weighted.area_interpolate" title="Permalink to this definition"></a></dt>
<dd><p>Area interpolation for extensive and intensive variables.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+27.g1a0376c)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>target_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+27.g1a0376c)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>target_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>extensive_variables</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><code class="docutils literal notranslate"><span class="pre">list</span></code></a></span></dt><dd><p>columns in dataframes for extensive variables</p>
</dd>
<dt><strong>intensive_variables</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><code class="docutils literal notranslate"><span class="pre">list</span></code></a></span></dt><dd><p>columns in dataframes for intensive variables</p>
</dd>
<dt><strong>table</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.dok_matrix.html#scipy.sparse.dok_matrix" title="(in SciPy v1.3.3)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scipy.sparse.dok_matrix</span></code></a></span></dt><dd></dd>
<dt><strong>table</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.dok_matrix.html#scipy.sparse.dok_matrix" title="(in SciPy v1.4.1)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scipy.sparse.dok_matrix</span></code></a></span></dt><dd></dd>
<dt><strong>allocate_total</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values" title="(in Python v3.8)"><span class="xref std std-ref">bool</span></a></span></dt><dd><p>True if total value of source area should be allocated.
False if denominator is area of i. Note that the two cases
would be identical when the area of the source polygon is
Expand All @@ -140,8 +140,8 @@ <h1>tobler.area_weighted.area_interpolate<a class="headerlink" href="#tobler-are
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl>
<dt><strong>estimates</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)"><code class="docutils literal notranslate"><span class="pre">tuple</span></code></a> (2)</span></dt><dd><p>(extensive variable array, intensive variables array)
Each is of shape n,v where n is number of target units and v is the number of variables for each variable type.</p>
<dt><strong>estimates</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>new geodaraframe with interpolated variables as columns and target_df geometry
as output geometry</p>
</dd>
</dl>
</dd>
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/tobler.area_weighted.area_tables.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ <h1>tobler.area_weighted.area_tables<a class="headerlink" href="#tobler-area-wei
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+27.g1a0376c)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>target_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+27.g1a0376c)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
<dt><strong>target_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd></dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/tobler.area_weighted.area_tables_binning.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ <h1>tobler.area_weighted.area_tables_binning<a class="headerlink" href="#tobler-
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+27.g1a0376c)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>GeoDataFrame containing input data and polygons</p>
<dt><strong>source_df</strong><span class="classifier"><a class="reference external" href="https://geopandas.readthedocs.io/en/latest/reference/geopandas.GeoDataFrame.html#geopandas.GeoDataFrame" title="(in GeoPandas v0.6.1+30.g0da3a7d)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a></span></dt><dd><p>GeoDataFrame containing input data and polygons</p>
</dd>
<dt><strong>target_df</strong><span class="classifier"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geopandas.GeoDataFramee</span></code></span></dt><dd><p>GeoDataFrame defining the output geometries</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl>
<dt><strong>tables</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.dok_matrix.html#scipy.sparse.dok_matrix" title="(in SciPy v1.3.3)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scipy.sparse.dok_matrix</span></code></a></span></dt><dd></dd>
<dt><strong>tables</strong><span class="classifier"><a class="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.dok_matrix.html#scipy.sparse.dok_matrix" title="(in SciPy v1.4.1)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">scipy.sparse.dok_matrix</span></code></a></span></dt><dd></dd>
</dl>
</dd>
</dl>
Expand Down
Loading

0 comments on commit 466ab35

Please sign in to comment.