Skip to content

Commit 24bdb4a

Browse files
authored
point nybb dataset to archive (#9)
* point nybb dataset to archive * update tests using nybb
1 parent 0be0529 commit 24bdb4a

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

geodatasets/json/database.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -747,18 +747,18 @@
747747

748748
"ny": {
749749
"bb": {
750-
"url": "https://data.cityofnewyork.us/api/geospatial/tqmj-j8zm?method=export&format=Original",
750+
"url": "https://www.nyc.gov/assets/planning/download/zip/data-maps/open-data/nybb_16a.zip",
751751
"license": "NA",
752752
"attribution": "Department of City Planning (DCP)",
753753
"name": "ny.bb",
754-
"description": "The borough boundaries of New York City clipped to the shoreline at mean high tide.",
754+
"description": "The borough boundaries of New York City clipped to the shoreline at mean high tide for 2016.",
755755
"geometry_type": "Polygon",
756756
"details": "https://data.cityofnewyork.us/City-Government/Borough-Boundaries/tqmj-j8zm",
757757
"nrows": 5,
758758
"ncols": 5,
759-
"hash": "26257f5a3c06765557b302f36774d4d21acb257aa8f9d4a4694d436432160051",
760-
"filename": "nybb_22c.zip",
761-
"members": ["nybb_22c/nybb.shp", "nybb_22c/nybb.shx", "nybb_22c/nybb.dbf", "nybb_22c/nybb.prj"]
759+
"hash": "a303be17630990455eb079777a6b31980549e9096d66d41ce0110761a7e2f92a",
760+
"filename": "nybb_16a.zip",
761+
"members": ["nybb_16a/nybb.shp", "nybb_16a/nybb.shx", "nybb_16a/nybb.dbf", "nybb_16a/nybb.prj"]
762762
}
763763
},
764764

geodatasets/tests/test_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def test_get_url():
1010
url = geodatasets.get_url("nybb")
1111
assert (
1212
url
13-
== "https://data.cityofnewyork.us/api/geospatial/tqmj-j8zm?method=export&format=Original" # noqa
13+
== "https://www.nyc.gov/assets/planning/download/zip/data-maps/open-data/nybb_16a.zip" # noqa
1414
)
1515

1616

1717
@pytest.mark.request
1818
def test_get_path():
19-
in_cache = pooch.os_cache("geodatasets").joinpath("nybb_22c.zip")
19+
in_cache = pooch.os_cache("geodatasets").joinpath("nybb_16a.zip")
2020
if Path(in_cache).exists():
2121
os.remove(in_cache)
2222

@@ -29,20 +29,20 @@ def test_get_path():
2929
@pytest.mark.request
3030
def test_fetch():
3131
# clear cache
32-
for data in ["airbnb.zip", "nybb_22c.zip", "nyc_neighborhoods.zip"]:
32+
for data in ["airbnb.zip", "nybb_16a.zip", "nyc_neighborhoods.zip"]:
3333
in_cache = pooch.os_cache("geodatasets").joinpath(data)
3434
if Path(in_cache).exists():
3535
os.remove(in_cache)
3636

3737
geodatasets.fetch("nybb")
38-
assert pooch.os_cache("geodatasets").joinpath("nybb_22c.zip").exists()
38+
assert pooch.os_cache("geodatasets").joinpath("nybb_16a.zip").exists()
3939

4040
geodatasets.fetch(["geoda airbnb", "geoda atlanta"])
4141

4242
for data in ["airbnb.zip", "atlanta_hom.zip"]:
4343
assert pooch.os_cache("geodatasets").joinpath(data).exists()
4444

4545
# cleanup
46-
for data in ["airbnb.zip", "nybb_22c.zip", "atlanta_hom.zip"]:
46+
for data in ["airbnb.zip", "nybb_16a.zip", "atlanta_hom.zip"]:
4747
in_cache = pooch.os_cache("geodatasets").joinpath(data)
4848
os.remove(in_cache)

geodatasets/tests/test_lib.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_dir(data1):
4141

4242

4343
def test_expect_name_url_attribution():
44-
4544
with pytest.raises(AttributeError, match="`name`, `url`, `hash`, `filename`"):
4645
Dataset({})
4746
with pytest.raises(AttributeError, match="`url`, `hash`, `filename`"):
@@ -104,7 +103,7 @@ def test_callable():
104103
# check that original item dict is not modified
105104
assert (
106105
data.ny.bb["hash"]
107-
== "26257f5a3c06765557b302f36774d4d21acb257aa8f9d4a4694d436432160051"
106+
== "a303be17630990455eb079777a6b31980549e9096d66d41ce0110761a7e2f92a"
108107
)
109108

110109

0 commit comments

Comments
 (0)