-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Code session 2 * fix data * fix doc link
- Loading branch information
Showing
9 changed files
with
1,460 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
*.dbf | ||
*.xlsx | ||
*.pickle | ||
*.shp | ||
*.shx | ||
.coverage | ||
data.* | ||
paris*.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unittest | ||
from teachpyx.ext_test_case import ExtTestCase | ||
from teachpyx.datasets import get_naturalearth_cities, get_naturalearth_lowres | ||
|
||
|
||
class TestGpdHelper(ExtTestCase): | ||
def test_get_naturalearth_cities(self): | ||
filenames = get_naturalearth_cities() | ||
for filename in filenames: | ||
self.assertExists(filename) | ||
|
||
def test_get_naturalearth_lowres(self): | ||
filenames = get_naturalearth_lowres() | ||
for filename in filenames: | ||
self.assertExists(filename) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from ..tools.data_helper import download | ||
|
||
|
||
def get_naturalearth_cities(dest: str = ".", timeout: int = 10, verbose: bool = False): | ||
""" | ||
Retrieves file ``naturalearth_cities.shp``, ``naturalearth_cities.shx``, | ||
``naturalearth_cities.dbf`` in | ||
`teachdata/geopandas/data/naturalearth_cities/ | ||
<https://github.com/sdpython/teachdata/blob/main/geopandas/data/naturalearth_cities/>`_. | ||
""" | ||
urls = [ | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_cities/naturalearth_cities.shp", | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_cities/naturalearth_cities.shx", | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_cities/naturalearth_cities.dbf", | ||
] | ||
return [download(url, dest=dest, timeout=timeout, verbose=verbose) for url in urls] | ||
|
||
|
||
def get_naturalearth_lowres(dest: str = ".", timeout: int = 10, verbose: bool = False): | ||
""" | ||
Retrieves files ``naturalearth_lowres.shp``, ``naturalearth_lowres.shx``, | ||
``naturalearth_lowres.dbf`` in | ||
`teachdata/geopandas/data/naturalearth_lowres/ | ||
<https://github.com/sdpython/teachdata/blob/main/geopandas/data/naturalearth_lowres/>`_. | ||
""" | ||
urls = [ | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_lowres/naturalearth_lowres.shp", | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_lowres/naturalearth_lowres.shx", | ||
"https://github.com/sdpython/teachdata/raw/main/geopandas/data/naturalearth_lowres/naturalearth_lowres.dbf", | ||
] | ||
return [download(url, dest=dest, timeout=timeout, verbose=verbose) for url in urls] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters