Skip to content

Commit

Permalink
update documentation for plotting method and required packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mdp0023 committed Apr 22, 2024
1 parent 3d16bcf commit 1598171
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 17 deletions.
Binary file modified SVInsight/__pycache__/svi.cpython-312.pyc
Binary file not shown.
12 changes: 5 additions & 7 deletions SVInsight/svi.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,10 @@ def plot_svi(self, plot_option: int, geopackages: list):
A single figure of a single SVI estimate. The geopackage parameter must be in the format [year, boundary, config, variable] where:
-Year: SVI estimate year (int)
-Boundary: Boundary of interest ('bg' or 'tract', str)
-Config: Which config file was used to create the SVI estimate (str)
-Variable: Which SVI variable to plot (i.e., the attributes of the SVI geopackages created, str).
- Year: SVI estimate year (int)
- Boundary: Boundary of interest ('bg' or 'tract', str)
- Config: Which config file was used to create the SVI estimate (str)
- Variable: Which SVI variable to plot (i.e., the attributes of the SVI geopackages created, str).
**Plot Option 2: Simple Comparative Plot**
Expand All @@ -794,9 +794,7 @@ def plot_svi(self, plot_option: int, geopackages: list):
A more detailed plotting option, that will produce a comparison plot and calculate a linear regression. Because the difference map and linear regression require the same set of input geoids (i.e., the same locations in the geopackage), it is currently required that the variables come from the same geopackage but compare different rank methodologies. The geopackages input should be formated as follows: [year, boundary, config]. If a variable option is passed it is ignored. The additional plots show the following information:
- Difference plot: Shows the The FA_SVI_Rank minus the RM_SVI_Rank to highlight areas where the factor analysis method is under (negative) and over (positive) predicting SVI rank when compared to the rank method.
-Linear Regression: Shows linear correlation betweeen factor analysis and rank method SVI estimates and automatically computes an r-squared value with p-value, 95% confidence interval, and 95% prediction interval.
- Linear Regression: Shows linear correlation betweeen factor analysis and rank method SVI estimates and automatically computes an r-squared value with p-value, 95% confidence interval, and 95% prediction interval.
"""
# ADD CHECKS TO VARIABLE INPUTS
Expand Down
Binary file modified doc/_build/doctrees/apiref/apiref.doctree
Binary file not shown.
Binary file modified doc/_build/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -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: 84e8fb852c4885a901327cb14ccc00a0
config: 6b2bd8b92764ff171da02403603cbf26
tags: 645f666f9bcd5a90fca523b33c5a78b7
37 changes: 32 additions & 5 deletions doc/_build/html/apiref/apiref.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,38 @@
<dl class="py method">
<dt class="sig sig-object py" id="SVInsight.svi.SVInsight.plot_svi">
<span class="sig-name descname"><span class="pre">plot_svi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">plot_option</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">geopackages</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#SVInsight.svi.SVInsight.plot_svi" title="Link to this definition">#</a></dt>
<dd><p>Method to plot SVI and SVI comparisons
Option 1: Single plot
Option 2: Two side by side plots
Option 3: Comparison plots
geopackage: [year, boundary, config, variable]</p>
<dd><p>Simple plotting method to quickly map an SVI variable or compare two SVIs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>plot_option</strong> (<em>int</em>) – Which plot method to use: Either 1 (single SVI map), 2 (two side by side maps), or 3 (full comparison figure).</p></li>
<li><p><strong>geopackages</strong> (<em>list</em>) – The required information for plotting, must be format: [year, boundary, config, variable]. Nested list if plot_option 2.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>matplotlib figure object</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>ValueError</strong> – If the boundary type is invalid or the year is not between 2010 and 2022,</p>
</dd>
</dl>
<p>This method quickly creates an example SVI plot either by itself or in a comparative format. The plot options and their required information can be found below.</p>
<p><strong>Plot Option 1: Single Plot</strong></p>
<p>A single figure of a single SVI estimate. The geopackage parameter must be in the format [year, boundary, config, variable] where:</p>
<ul class="simple">
<li><p>Year: SVI estimate year (int)</p></li>
<li><p>Boundary: Boundary of interest (‘bg’ or ‘tract’, str)</p></li>
<li><p>Config: Which config file was used to create the SVI estimate (str)</p></li>
<li><p>Variable: Which SVI variable to plot (i.e., the attributes of the SVI geopackages created, str).</p></li>
</ul>
<p><strong>Plot Option 2: Simple Comparative Plot</strong></p>
<p>A simple two by one figure to visually compare two differnet SVI estimates. These estimates can be from the same or different geopackages. The geopackages parameter should be a nested list of the same variables as described in plot option 1: [[year, boundary, config, variable],[year, boundary, config, variable]].</p>
<p><strong>Plot Option 1: Complete Comparative Plot</strong></p>
<p>A more detailed plotting option, that will produce a comparison plot and calculate a linear regression. Because the difference map and linear regression require the same set of input geoids (i.e., the same locations in the geopackage), it is currently required that the variables come from the same geopackage but compare different rank methodologies. The geopackages input should be formated as follows: [year, boundary, config]. If a variable option is passed it is ignored. The additional plots show the following information:</p>
<ul class="simple">
<li><p>Difference plot: Shows the The FA_SVI_Rank minus the RM_SVI_Rank to highlight areas where the factor analysis method is under (negative) and over (positive) predicting SVI rank when compared to the rank method.</p></li>
<li><p>Linear Regression: Shows linear correlation betweeen factor analysis and rank method SVI estimates and automatically computes an r-squared value with p-value, 95% confidence interval, and 95% prediction interval.</p></li>
</ul>
</dd></dl>

<dl class="py method">
Expand Down
2 changes: 1 addition & 1 deletion doc/_build/html/searchindex.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@
#html_theme = 'alabaster'
#html_theme = 'pydata_sphinx_theme'
html_theme = 'furo'
html_theme_options ={"color_scheme": "light"}
#html_theme_options ={"color_scheme": "light"}

html_context = {
# ...
"default_mode": "light"
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ dependencies = [
"pandas>=2.2.2",
"PyYAML>=6.0.1",
"scikit_learn>=1.3.0",
"openpyxl>=3.0.10"
"openpyxl>=3.0.10",
"matplotlib"
]
requires-python = ">=3.8"
authors = [
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pytest>=8.1.1
PyYAML>=6.0.1
scikit_learn>=1.3.0
setuptools==68.2.2
openpyxl>=3.0.10
openpyxl>=3.0.10
matplotlib

0 comments on commit 1598171

Please sign in to comment.