Skip to content

Commit

Permalink
Merge pull request #99 from jGaboardi/transfering_edits
Browse files Browse the repository at this point in the history
Initial edits/updates after repo transfer
  • Loading branch information
jGaboardi committed Oct 1, 2020
2 parents ab16ee6 + a0a8f73 commit eb29478
Show file tree
Hide file tree
Showing 34 changed files with 741 additions and 788 deletions.
File renamed without changes.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
# NHGISXWALK
## Spatio-temporal [NHGIS Crosswalks](https://www.nhgis.org/user-resources/geographic-crosswalks)

[![Documentation](https://img.shields.io/static/v1.svg?label=docs&message=current&color=4ca)](https://jgaboardi.github.io/nhgisxwalk/) [![GitHub release](https://img.shields.io/github/v/tag/jGaboardi/nhgisxwalk?include_prereleases&logo=GitHub)](https://img.shields.io/github/v/tag/jGaboardi/nhgisxwalk?include_prereleases&logo=GitHub) [![unittests](https://github.com/jGaboardi/nhgisxwalk/workflows/.github/workflows/unittests.yml/badge.svg)](https://github.com/jGaboardi/nhgisxwalk/actions?query=workflow%3A.github%2Fworkflows%2Funittests.yml) [![codecov](https://codecov.io/gh/jGaboardi/nhgisxwalk/branch/master/graph/badge.svg)](https://codecov.io/gh/jGaboardi/nhgisxwalk) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jGaboardi/nhgisxwalk/master)
[![Documentation](https://img.shields.io/static/v1.svg?label=docs&message=current&color=4ca)](https://ipums.github.io/nhgisxwalk/) [![GitHub release](https://img.shields.io/github/v/tag/ipums/nhgisxwalk?include_prereleases&logo=GitHub)](https://img.shields.io/github/v/tag/ipums/nhgisxwalk?include_prereleases&logo=GitHub) [![unittests](https://github.com/ipums/nhgisxwalk/workflows/.github/workflows/unittests.yml/badge.svg)](https://github.com/ipums/nhgisxwalk/actions?query=workflow%3A.github%2Fworkflows%2Funittests.yml) [![codecov](https://codecov.io/gh/ipums/nhgisxwalk/branch/master/graph/badge.svg)](https://codecov.io/gh/ipums/nhgisxwalk) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ipums/nhgisxwalk/master)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)

***This project will eventually be transferred to the [`IPUMS`](https://github.com/ipums) project space.***

This pacakge allows for the generation of temporal crosswalks of census geographic data built from the smallest intersecting units (atoms). Each row in a crosswalk represents a single atom and is comprised of a source ID (`geo+year+gj`), a target ID (`geo+year+gj`), and at least one column of weights. An example of a source ID is `bgp1990gj` (block group parts from 1990) and an example of a target ID is `tr1990gj` (tracts from 2010) — see [`notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb`](https://github.com/jGaboardi/nhgisxwalk/blob/master/notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb) for the `nhgis_bgp1990gj_to_tr1990gj` crosswalk extract of Delaware. The weights are the interpolated proportions of source attributes that are are calculated as being within the target units. For a description of the algorithmic workflow see the [General Crosswalk Construction Framework](https://github.com/jGaboardi/nhgisxwalk/blob/master/resources/frameworks/general-crosswalk-construction-framework.pdf). Data from 1990 poses a specific problem due to the US Census Bureau not explicitly including blocks with no population/housing units in the summary files (SF1). For a description of the algorithmic workflow in the 1990 "no data" scenarios see [Handling 1990 No-Data Blocks in Crosswalks](https://github.com/jGaboardi/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no-data-blocks-in-crosswalks.pdf). For more information of the base crosswalks see their [technical details](https://www.nhgis.org/user-resources/geographic-crosswalks#details). For further description see Schroeder (2007).
This pacakge allows for the generation of temporal crosswalks of census geographic data built from the smallest intersecting units (atoms). Each row in a crosswalk represents a single atom and is comprised of a source ID (`geo+year+gj`), a target ID (`geo+year+gj`), and at least one column of weights. An example of a source ID is `bgp1990gj` (block group parts from 1990) and an example of a target ID is `tr1990gj` (tracts from 2010) — see [`notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb`](https://github.com/ipums/nhgisxwalk/blob/master/notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb) for the `nhgis_bgp1990gj_to_tr1990gj` crosswalk extract of Delaware. The weights are the interpolated proportions of source attributes that are are calculated as being within the target units. For a description of the algorithmic workflow see the [General Crosswalk Construction Framework](https://github.com/ipums/nhgisxwalk/blob/master/resources/frameworks/general-crosswalk-construction-framework.pdf). Data from 1990 poses a specific problem due to the US Census Bureau not explicitly including blocks with no population/housing units in the summary files (SF1). For a description of the algorithmic workflow in the 1990 "no data" scenarios see [Handling 1990 No-Data Blocks in Crosswalks](https://github.com/ipums/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no-data-blocks-in-crosswalks.pdf). For more information of the base crosswalks see their [technical details](https://www.nhgis.org/user-resources/geographic-crosswalks#details). For further description see Schroeder (2007).

#### Currently supported crosswalks include:

Expand All @@ -35,41 +33,41 @@ This pacakge allows for the generation of temporal crosswalks of census geograph

## Examples

* [Proportionally-weighted Synthetic Atoms](https://github.com/jGaboardi/nhgisxwalk/blob/master/notebooks/weighted-portion-synthetic-atoms.ipynb)
* [Synthetic Example](https://github.com/jGaboardi/nhgisxwalk/blob/master/notebooks/synthetic-example.ipynb)
* Sample Workflow (see all [here](https://github.com/jGaboardi/nhgisxwalk/blob/master/notebooks)):
* [1990 block group parts to 2010 tracts](https://github.com/jGaboardi/nhgisxwalk/blob/master/notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb)
* [Proportionally-weighted Synthetic Atoms](https://github.com/ipums/nhgisxwalk/blob/master/notebooks/weighted-portion-synthetic-atoms.ipynb)
* [Synthetic Example](https://github.com/ipums/nhgisxwalk/blob/master/notebooks/synthetic-example.ipynb)
* Sample Workflow (see all [here](https://github.com/ipums/nhgisxwalk/blob/master/notebooks)):
* [1990 block group parts to 2010 tracts](https://github.com/ipums/nhgisxwalk/blob/master/notebooks/data-subset-sample-workflow-bgp1990tr2010.ipynb)

## Resources

* [Frequently Asked Questions](https://github.com/jGaboardi/nhgisxwalk/wiki/FAQ-&-Resources)
* [What are "block group parts" and how can I download them?](https://github.com/jGaboardi/nhgisxwalk/wiki/FAQ-&-Resources#what-are-block-group-parts-and-how-can-i-download-them)
* [How are the crosswalks sorted?](https://github.com/jGaboardi/nhgisxwalk/wiki/FAQ-&-Resources#how-are-the-crosswalks-sorted)
* [Frequently Asked Questions](https://github.com/ipums/nhgisxwalk/wiki/FAQ-&-Resources)
* [What are "block group parts" and how can I download them?](https://github.com/ipums/nhgisxwalk/wiki/FAQ-&-Resources#what-are-block-group-parts-and-how-can-i-download-them)
* [How are the crosswalks sorted?](https://github.com/ipums/nhgisxwalk/wiki/FAQ-&-Resources#how-are-the-crosswalks-sorted)

## Installation

Currently `nhgisxwalk` officially supports Python [3.6](https://docs.python.org/3.6/), [3.7](https://docs.python.org/3.7/), and [3.8](https://docs.python.org/3.8/). Please make sure that you are operating in a Python >= 3.6 environment. Install the most current development version of `nhgisxwalk` by running:

```
$ pip install git+https://github.com/jGaboardi/nhgisxwalk
$ pip install git+https://github.com/ipums/nhgisxwalk
```

## Contribute

NHGISXWALK is under active development and contributors are welcome. If you have any suggestions, feature requests, or bug reports, please open new [issues](https://github.com/jGaboardi/nhgisxwalk/issues) on GitHub. To submit patches, please review the `nhgisxwalk` [contributing guidelines](https://github.com/jGaboardi/nhgisxwalk/blob/master/.github/CONTRIBUTING.md) before opening a [pull request](https://github.com/jGaboardi/nhgisxwalk/pulls).
NHGISXWALK is under active development and contributors are welcome. If you have any suggestions, feature requests, or bug reports, please open new [issues](https://github.com/ipums/nhgisxwalk/issues) on GitHub. To submit patches, please review the `nhgisxwalk` [contributing guidelines](https://github.com/ipums/nhgisxwalk/blob/master/.github/CONTRIBUTING.md) before opening a [pull request](https://github.com/ipums/nhgisxwalk/pulls).

## Support

If you are having issues, please [create an issue](https://github.com/jGaboardi/nhgisxwalk/issues).
If you are having issues, please [create an issue](https://github.com/ipums/nhgisxwalk/issues).

## Citations
If you use `nhgisxwalk` in a scientific publication, we would appreciate using the following citations:
* **Steven Manson, Jonathan Schroeder, David Van Riper, and Steven Ruggles**. *IPUMS National Historical Geographic Information System: Version 14.0* [Database]. Minneapolis, MN: IPUMS. 2019. http://doi.org/10.18128/D050.V14.0
* **James Gaboardi**. *[jGaboardi/nhgisxwalk](https://github.com/jGaboardi/nhgisxwalk)*. Zenodo. 2020. [![DOI](https://zenodo.org/badge/259962549.svg)](https://zenodo.org/badge/latestdoi/259962549)
* **James Gaboardi**. *[jGaboardi/nhgisxwalk](https://github.com/ipums/nhgisxwalk)*. Zenodo. 2020. [![DOI](https://zenodo.org/badge/259962549.svg)](https://zenodo.org/badge/latestdoi/259962549)


## License
The package is licensed under the [MPL-2.0 License](https://github.com/jGaboardi/nhgisxwalk/blob/master/LICENSE).
The package is licensed under the [MPL-2.0 License](https://github.com/ipums/nhgisxwalk/blob/master/LICENSE).



Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
- shapely
- watermark
- pip:
- git+https://github.com/jGaboardi/nhgisxwalk.git@master
- git+https://github.com/ipums/nhgisxwalk.git@master
- handcalcs
2 changes: 1 addition & 1 deletion nhgisxwalk/__code_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"""

# ------------------------------------------------------------------------- 2000
# *** NOTE *** The URBRURALA code is added. For more details see, https,//gist.github.com/jGaboardi/36c7640af1f228cdc8a691505262e543
# *** NOTE *** The URBRURALA code is added. For more details see, https,//gist.github.com/ipums/36c7640af1f228cdc8a691505262e543
blk2000 = r"""
GISJOIN, GIS Join Match Code
YEAR, Data File Year
Expand Down
14 changes: 7 additions & 7 deletions nhgisxwalk/geocrosswalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class GeoCrossWalk:
of weights. The weights are the interpolated proportions of source
attributes that are are calculated as being within the target units.
For a description of the algorithmic workflow see the
`General Crosswalk Construction Framework <https://github.com/jGaboardi/nhgisxwalk/blob/master/resources/frameworks/general-crosswalk-construction-framework.pdf>`_.
`General Crosswalk Construction Framework <https://github.com/ipums/nhgisxwalk/blob/master/resources/frameworks/general-crosswalk-construction-framework.pdf>`_.
For a description of the algorithmic workflow
in the 1990 "no data" scenarios see
`Handling 1990 No-Data Blocks in Crosswalks <https://github.com/jGaboardi/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no-data-blocks-in-crosswalks.pdf>`_.
`Handling 1990 No-Data Blocks in Crosswalks <https://github.com/ipums/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no-data-blocks-in-crosswalks.pdf>`_.
For more information of the base crosswalks see their
`technical details <https://www.nhgis.org/user-resources/frameworks/geographic-crosswalks#details>`_
here.
Expand Down Expand Up @@ -215,7 +215,7 @@ class GeoCrossWalk:
-----
For more information see the ``nhgisxwalk`` FAQ
`page <https://github.com/jGaboardi/nhgisxwalk/wiki/FAQ-&-Resources>`_.
`page <https://github.com/ipums/nhgisxwalk/wiki/FAQ-&-Resources>`_.
Examples
--------
Expand Down Expand Up @@ -278,9 +278,9 @@ class GeoCrossWalk:
to build up the source and and target units from the source and and target
years. Currently supported base crosswalks are 1990-2010 blocks and
2000-2010 blocks, which can be downloaded from
`NHGIS <https://github.com/jGaboardi/nhgisxwalk/wiki/FAQ-&-Resources#where-can-i-download-the-base-geographic-crosswalks>`_.
`NHGIS <https://github.com/ipums/nhgisxwalk/wiki/FAQ-&-Resources#where-can-i-download-the-base-geographic-crosswalks>`_.
The versions found within ``nhgisxwalk`` (see
`./testing_data_subsets/ <https://github.com/jGaboardi/nhgisxwalk/tree/master/testing_data_subsets>`_)
`./testing_data_subsets/ <https://github.com/ipums/nhgisxwalk/tree/master/testing_data_subsets>`_)
are single state subsets (Delaware) for testing and demonstration purposes.
>>> subset_data_dir = "./testing_data_subsets/"
Expand Down Expand Up @@ -568,7 +568,7 @@ def join_source_base_tabular(self):

# Special case for 2000 blocks (of 2000 bgp)-- needs Urban/Rural code
# For more details see:
# https://gist.github.com/jGaboardi/36c7640af1f228cdc8a691505262e543
# https://gist.github.com/ipums/36c7640af1f228cdc8a691505262e543
# and
# nhgisxwalk/notebooks/build_subset.ipynb

Expand Down Expand Up @@ -1013,7 +1013,7 @@ def calculate_atoms(

def handle_1990_no_data(geoxwalk, vect, supp_src_tab, drop_supp_col):
"""Step 1 in this workflow is handled as a normal case. See the algorithmic workflow in
`Handling 1990 No-Data Blocks in Crosswalks <https://github.com/jGaboardi/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no
`Handling 1990 No-Data Blocks in Crosswalks <https://github.com/ipums/nhgisxwalk/blob/master/resources/frameworks/handling-1990-no
Parameters
----------
Expand Down
Loading

0 comments on commit eb29478

Please sign in to comment.