Skip to content

Commit

Permalink
Merge pull request #385 from oturns/sedafix
Browse files Browse the repository at this point in the history
expose store_blocks_2020
  • Loading branch information
knaaptime authored Dec 11, 2023
2 parents d76a9c4 + 3a1cb0f commit e990564
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
5 changes: 3 additions & 2 deletions geosnap/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def seda(
by default "gcs"
accept_eula : bool, optional
pass True to accept the terms of the SEDA End User License Agreeement.
The data and its agreement can be viewed at <https://purl.stanford.edu/db586ns4974>
The data and its agreement can be viewed at
<https://exhibits.stanford.edu/data/catalog/db586ns4974>
"""
eula = """
DATA USE AGREEMENT:
Expand Down Expand Up @@ -379,7 +380,7 @@ def blocks_2020(self, states=None, fips=None):
msg = (
"Unable to locate local census 2020 block data. Streaming instead.\n"
"If you plan to use census data repeatedly you can store it locally "
"with the io.store_blocks_2010 function for better performance"
"with the io.store_blocks_2020 function for better performance"
)
if isinstance(states, (str, int)):
states = [states]
Expand Down
5 changes: 1 addition & 4 deletions geosnap/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
store_acs,
store_blocks_2000,
store_blocks_2010,
store_blocks_2020,
store_census,
store_ejscreen,
store_ltdb,
Expand All @@ -16,8 +17,4 @@
)
from .util import (
adjust_inflation,
convert_census_gdb,
get_census_gdb,
get_lehd,
process_acs,
)
26 changes: 13 additions & 13 deletions geosnap/tests/test_add_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ def test_store_ncdb():
assert datasets.ncdb().shape == (328633, 76)


def test_get_lehd_v7():
def test_get_lodes_wac_v7():
wac = io.get_lodes(datasets, state_fips=['11'], years=[2015], version=7)
assert wac.shape == (6507, 57)

wac = io.get_lehd(version=7)
rac = io.get_lehd("rac", version=7)
def test_get_lodes_rac_v7():
rac = io.get_lodes(datasets, dataset="rac", state_fips=['11'], years=[2015], version=7)
assert rac.shape == (6507, 47)

assert wac.shape == (3074, 52)
assert rac.shape == (4382, 42)

def test_get_lehd_v8():

wac = io.get_lehd(version=8)
rac = io.get_lehd("rac", version=8)

assert wac.shape == (3269, 52)
assert rac.shape == (4553, 42)
def test_get_lodes_wac_v8():
wac = io.get_lodes(datasets, state_fips=['11'], years=[2015], version=7)
assert wac.shape == (6507, 57)

def test_get_lodes_rac_v8():
rac = io.get_lodes(datasets, dataset="rac", state_fips=['11'], years=[2015], version=8)
assert rac.shape == (6012, 49)


def test_store_acs():
io.store_acs(2012)
assert os.path.exists(PurePath(datasets.show_data_dir(), "acs", "acs_2012_tract.parquet"))

0 comments on commit e990564

Please sign in to comment.