From b6c9ef5de6953e456a9046433c6ec48c70db2172 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Tue, 7 Mar 2023 13:20:42 -0800 Subject: [PATCH] swap to platformdirs --- .ci/310.yml | 3 ++- .ci/38.yml | 3 ++- .ci/39.yml | 3 ++- docs/data.rst | 2 +- environment.yml | 2 +- geosnap/_data.py | 2 +- geosnap/io/storage.py | 4 ++-- geosnap/io/util.py | 2 +- requirements.txt | 2 +- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.ci/310.yml b/.ci/310.yml index 6d634180..acb866c9 100644 --- a/.ci/310.yml +++ b/.ci/310.yml @@ -13,7 +13,7 @@ dependencies: - scikit-learn - seaborn - pyarrow >=0.14.1 - - appdirs + - platformdirs - dash - dash-bootstrap-components - palettable @@ -29,6 +29,7 @@ dependencies: - versioneer - pyproj >=3 - pandana + - pooch # testing - jupyter diff --git a/.ci/38.yml b/.ci/38.yml index be9be189..600b123c 100644 --- a/.ci/38.yml +++ b/.ci/38.yml @@ -13,7 +13,7 @@ dependencies: - scikit-learn - seaborn - pyarrow >=0.14.1 - - appdirs + - platformdirs - dash - dash-bootstrap-components - palettable @@ -29,6 +29,7 @@ dependencies: - versioneer - pyproj >=3 - pandana + - pooch # testing - jupyter diff --git a/.ci/39.yml b/.ci/39.yml index 14de33fd..70edb23b 100644 --- a/.ci/39.yml +++ b/.ci/39.yml @@ -13,7 +13,7 @@ dependencies: - seaborn - hdbscan - pyarrow >=0.14.1 - - appdirs + - platformdirs - dash - dash-bootstrap-components - palettable @@ -29,6 +29,7 @@ dependencies: - versioneer - pyproj >=3 - pandana + - pooch # testing - jupyter diff --git a/docs/data.rst b/docs/data.rst index 86ad9524..14b3c87f 100644 --- a/docs/data.rst +++ b/docs/data.rst @@ -16,7 +16,7 @@ This means that streaming data is relatively fast and efficient. If you plan to make repeated queries, or you need offline access to the data, ``geosnap`` also has functions for caching all the data locally (see the `Getting Started `_ tutorial). -Since we store everything in parquet, local storage is still highly efficient, and ``geosnap`` will use `appdirs `_ +Since we store everything in parquet, local storage is still highly efficient, and ``geosnap`` will use `platformdirs `_ to determine the best place to store the data on your machine. diff --git a/environment.yml b/environment.yml index c6ca49bf..215f0d93 100644 --- a/environment.yml +++ b/environment.yml @@ -12,7 +12,7 @@ dependencies: - scikit-learn - seaborn - pyarrow >=0.14.1 - - appdirs + - platformdirs - pip - tqdm - quilt3 >=3.6 diff --git a/geosnap/_data.py b/geosnap/_data.py index 91c195b6..d6c59ed1 100644 --- a/geosnap/_data.py +++ b/geosnap/_data.py @@ -6,7 +6,7 @@ import geopandas as gpd import pandas as pd -from appdirs import user_data_dir +from platformdirs import user_data_dir def _fetcher(local_path, remote_path, warning_msg): diff --git a/geosnap/io/storage.py b/geosnap/io/storage.py index e4bfe3d1..4d67a8fd 100644 --- a/geosnap/io/storage.py +++ b/geosnap/io/storage.py @@ -8,7 +8,7 @@ import geopandas as gpd import pandas as pd import quilt3 -from appdirs import user_data_dir +from platformdirs import user_data_dir from .._data import DataStore from .util import adjust_inflation @@ -40,7 +40,7 @@ def store_seda(data_dir="auto", accept_eula=False): ---------- data_dir : str, optional path to desired storage location. If "auto", geosnap will use its default data - directory provided by appdirs, by default "auto" + directory provided by platformdirs, by default "auto" accept_eula : bool, optional Whether the accept the EULA from SEDA, by default False """ diff --git a/geosnap/io/util.py b/geosnap/io/util.py index 2b1287f6..99f3d28b 100644 --- a/geosnap/io/util.py +++ b/geosnap/io/util.py @@ -41,7 +41,7 @@ def get_census_gdb(years=None, geom_level="blockgroup", output_dir="."): fn = f"{year}_ACS_5YR_{geom_level.capitalize()}.gdb.zip" out_fn = f"ACS_{year}_5YR_{levels[geom_level].upper()}.gdb.zip" pth = pathlib.PurePath(output_dir, out_fn) - url = f"https://www2.census.gov/geo/tiger/TIGER_DP/{year}ACS/{fn}" + url = f"ftp://ftp2.census.gov/geo/tiger/TIGER_DP/{year}ACS/{fn}" pooch.retrieve(url, None, progressbar=True, path=pth) def reformat_acs_vars(col): diff --git a/requirements.txt b/requirements.txt index eb86346c..16d529dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ mapclassify giddy>=2.2.1 xlrd cenpy -appdirs +platformdirs tqdm quilt3>=3.6 pyarrow>=0.14.1