Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joss_Edits #13

Merged
merged 11 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Harris_County/Documentation/Harris_County_2018_bg_config.xlsx
Binary file not shown.
4,282 changes: 2,141 additions & 2,141 deletions Harris_County/SVIs/Harris_County_2018_bg_config_svi.csv

Large diffs are not rendered by default.

Binary file modified Harris_County/SVIs/Harris_County_2018_bg_config_svi.gpkg
Binary file not shown.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Data License

With regards to the US Census American Community Survey data provided with this package for use in the examples, the following statement comes from the US Census on its use:

"All U.S. Census Bureau materials, regardless of the media, are entirely in the public domain. There are no user fees, site licenses, or any special agreements etc for the public or private use, and or reuse of any census title. As tax funded product, it's all in the public record."
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ SVInsight can then be imported into python:

>>> from svinsight import SVInsight as svi

SVInsight has dependencies that rely on gdal, which may require it's own prior installation based on your operating system and coding environment.

For example:

* On macOS:

brew install gdal

* On Ubuntu:

sudo apt-get install gdal-bin libgdal-dev

* On Windows:

pip install gdal==<version> --find-links https://www.lfd.uci.edu/~gohlke/pythonlibs/



## Quick Guide:

In its simplest form the SVInsight workflow takes 5 lines of code:
Expand All @@ -47,7 +65,7 @@ Some typical compute times that can be expected to run the workflow for various


## Contributing
We welcome contributions to SVInsight. Please open an issue or a pull request if there is functionality you would like to see or propose. Refer to our [contributing guide](https://mdp0023.github.io/SVInsight/Contributions/contributions.htmll) for more information.
We welcome contributions to SVInsight. Please open an issue or a pull request if there is functionality you would like to see or propose. Refer to our [contributing guide](https://mdp0023.github.io/SVInsight/Contributions/contributions.html) for more information.


## Citing
Expand Down
Binary file added SETx_SVI/Boundaries/SETx_SVI_2021_bg.gpkg
Binary file not shown.
365 changes: 365 additions & 0 deletions SETx_SVI/Data/SETx_SVI_2021_bg_rawdata.csv

Large diffs are not rendered by default.

Binary file added SETx_SVI/Data/SETx_SVI_2021_bg_rawdata.gpkg
Binary file not shown.
Binary file not shown.
365 changes: 365 additions & 0 deletions SETx_SVI/SVIs/SETx_SVI_2021_bg_config_file_svi.csv

Large diffs are not rendered by default.

Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2013_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2014_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2015_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2016_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2017_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2018_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2019_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2020_bg_SVI.xlsx
Binary file not shown.
Binary file modified Travis_County/Documentation/Travis_County_2021_bg_SVI.xlsx
Binary file not shown.
1,152 changes: 576 additions & 576 deletions Travis_County/SVIs/Travis_County_2013_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2013_bg_SVI_svi.gpkg
Binary file not shown.
1,152 changes: 576 additions & 576 deletions Travis_County/SVIs/Travis_County_2014_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2014_bg_SVI_svi.gpkg
Binary file not shown.
1,152 changes: 576 additions & 576 deletions Travis_County/SVIs/Travis_County_2015_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2015_bg_SVI_svi.gpkg
Binary file not shown.
1,152 changes: 576 additions & 576 deletions Travis_County/SVIs/Travis_County_2016_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2016_bg_SVI_svi.gpkg
Binary file not shown.
1,152 changes: 576 additions & 576 deletions Travis_County/SVIs/Travis_County_2017_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2017_bg_SVI_svi.gpkg
Binary file not shown.
1,150 changes: 575 additions & 575 deletions Travis_County/SVIs/Travis_County_2018_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2018_bg_SVI_svi.gpkg
Binary file not shown.
1,148 changes: 574 additions & 574 deletions Travis_County/SVIs/Travis_County_2019_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2019_bg_SVI_svi.gpkg
Binary file not shown.
1,518 changes: 759 additions & 759 deletions Travis_County/SVIs/Travis_County_2020_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2020_bg_SVI_svi.gpkg
Binary file not shown.
1,518 changes: 759 additions & 759 deletions Travis_County/SVIs/Travis_County_2021_bg_SVI_svi.csv

Large diffs are not rendered by default.

Binary file modified Travis_County/SVIs/Travis_County_2021_bg_SVI_svi.gpkg
Binary file not shown.
23 changes: 20 additions & 3 deletions doc/Getting_Started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,37 @@ Install
Installation via *pip*
----------------------


To *pip*-install this package use the following command:

.. code-block:: console

$ pip install SVInsight


`SVInsight` can then be imported into python:

.. doctest::
.. code-block:: python

>>> from svinsight import SVInsight as svi

SVInsight has dependencies that rely on gdal, which may require its own prior installation based on your operating system and coding environment. For example:

* On macOS:

.. code-block:: console

brew install gdal

* On Ubuntu:

.. code-block:: console

sudo apt-get install gdal-bin libgdal-dev

* On Windows:

.. code-block:: console

pip install gdal==<version> --find-links https://www.lfd.uci.edu/~gohlke/pythonlibs/

Installation via *conda*
------------------------
Expand Down
27 changes: 16 additions & 11 deletions examples/SVInsight_example_SETx.ipynb

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions examples/svinsight_example_Harris_County.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import sys
import os

# This package comes with initial Census boundaries and data for Harris County, TX
# With overwrite=False, the package will not download the data again
# Therefore, an empty api_key will work for this example
# However, to download the data, you will need to get an API key from the US Census Bureau

# Get the directory that contains this file
this_directory = os.path.dirname(os.path.abspath(__file__))

Expand All @@ -18,8 +23,9 @@

# set variables
project_name = 'Harris_County'
file_path = "/Users/matthewpreisser/Documents/Research/Codes/SVInsight"
api_key = os.environ.get('API_KEY')
file_path = dir1
# api_key = os.environ.get('API_KEY')
api_key = ''
geoids = ['48201']

# create instance
Expand All @@ -34,7 +40,7 @@
config_file = 'config'

# extract shapefile
export = test.boundaries_data(boundary, year)
export = test.boundaries_data(boundary, year, overwrite=False)

# extract raw census data
test.census_data(boundary,
Expand Down
11 changes: 9 additions & 2 deletions examples/svinsight_example_Travis_County.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import sys
import os

# This package comes with initial Census boundaries and data for Travis County, TX
# With overwrite=False, the package will not download the data again
# Therefore, an empty api_key will work for this example
# However, to download the data, you will need to get an API key from the US Census Bureau


# Get the directory that contains this file
this_directory = os.path.dirname(os.path.abspath(__file__))

Expand All @@ -21,8 +27,9 @@

# set variables
project_name = 'Travis_County'
file_path = "/Users/matthewpreisser/Documents/Research/Codes/SVInsight"
api_key = os.environ.get('API_KEY')
file_path = dir1
# api_key = os.environ.get('API_KEY')
api_key=''
geoids = ['48453']

# create instance
Expand Down
35 changes: 34 additions & 1 deletion joss/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ @Article{Spielman_2020
@Article{Tate_2021,
author = {Eric Tate and Md Asif Rahman and Christopher T. Emrich and Christopher C. Sampson},
journal = {Natural Hazards},
title = {Flood exposure and social vulnerability in the {United States},
title = {Flood exposure and social vulnerability in the {United States}},
year = {2021},
month = {jan},
number = {1},
Expand All @@ -219,3 +219,36 @@ @Article{Peacock_2010
groups = {SVI},
publisher = {Texas A&M University},
}

@article{VanZandt_2012,
title={Mapping social vulnerability to enhance housing and neighborhood resilience},
author={Van Zandt, Shannon and Peacock, Walter Gillis and Henry, Dustin W and Grover, Himanshu and Highfield, Wesley E and Brody, Samuel D},
journal={Housing Policy Debate},
volume={22},
number={1},
pages={29--55},
year={2012},
publisher={Taylor \& Francis}
}

@article{Xu_2024,
title={findSVI: an R package to calculate the Social Vulnerability Index at multiple geographical levels},
author={Xu, Heli and Li, Ran and Bilal, Usama},
journal={Journal of open source software},
volume={9},
number={99},
pages={6525},
year={2024}
}


@article{Cutter_2008,
title={Temporal and spatial changes in social vulnerability to natural hazards},
author={Cutter, Susan L and Finch, Christina},
journal={Proceedings of the national academy of sciences},
volume={105},
number={7},
pages={2301--2306},
year={2008},
publisher={National Acad Sciences}
}
6 changes: 5 additions & 1 deletion joss/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ The exposure of communities to environmental hazards, their sensitivity to such


# Statement of need
Generic social vulnerability indices for large regions can be lacking in their ability to identify at risk populations [@Tate_2012; @Nelson_2015; @Tellman_2020]. Furthermore, not all vulnerability indices are created equal, and users, researchers, and developers should clearly state the objectives and structure of their index in order to accurately present their findings [@Bakkensen_2016]. *SVInsight* is an accessible and open-source tool to quickly calculate SVIs for a user-defined region using either custom or a research supported pre-set list of social and demographic variables. *SVInsight* calculates SVIs built on data from the Census Bureau's 5-Year American Community Survey using the two leading methods for calculating such metrics: a composite score using a data reduction methodology [@Cutter_2003] and a ranking method [@Flanagan_2011].
Generic social vulnerability indices for large regions can be lacking in their ability to identify at risk populations [@Tate_2012; @Nelson_2015; @Tellman_2020]. Furthermore, not all vulnerability indices are created equal, and users, researchers, and developers should clearly state the objectives and structure of their index in order to accurately present their findings [@Bakkensen_2016]. Research utilizing SVIs has historically been limited to either existing national or regional databases [@Cutter_2003; @Flanagan_2011; VanZandt_2012; Bixler_2021a]. Researchers that want to incorporate social vulnerability information into their research are therefore limited to these existing databases and their pre-determined variable choices, or developing their own index from scratch. Furthermore, researchers’ understanding of what contributes to vulnerability is variable in both time and space [@Cutter_2008]. Therefore, it is necessary to tailor SVIs to the context in which they are being applied.

*SVInsight* is an accessible and open-source tool to quickly calculate SVIs for a user-defined region using either custom or a research supported pre-set list of social and demographic variables. This package creates a pipeline between extensively large datasets and easily customizable SVIs, allowing researchers to experiment and manipulate various indices (e.g., general vulnerability, economic, race/ethnicity, etc.) built on a variety of variables more efficiently and effectively.*SVInsight* calculates SVIs built on data from the Census Bureau's 5-Year American Community Survey using the two leading methods for calculating such metrics: a composite score using a data reduction methodology [@Cutter_2003] and a ranking method [@Flanagan_2011]. There is a recently published package in R that is capable of calculating the Rank Method SVI [@Xu_2024], but to the best of the author’s knowledge there is no open source factor analysis based SVI package.




# Background
Expand Down
21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ readme = "long_desc.md"

[tool.poetry.dependencies]
python = "^3.9"
census = "*"
factor_analyzer = "*"
geopandas = "*"
numpy = "*"
pandas = "*"
PyYAML = "*"
scikit_learn = "*"
openpyxl = "*"
matplotlib = "*"
census = ">=0.8.22"
factor_analyzer = ">=0.5.1"
geopandas = ">=1.0.1"
numpy = ">=2.1"
pandas = ">=2.2.3"
PyYAML = ">=6.0.2"
scikit_learn = ">=1.5.2"
openpyxl = ">=3.1.5"
matplotlib = ">=3.9.2"
setuptools = ">=75.3"

[tool.poetry.dev-dependencies]
# Add your development dependencies here
pytest = ">=8.3.3"
jupyterlab = ">=3.0.0"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading