Skip to content

Commit

Permalink
ENH: ScienceBase do not require instantiation. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Taher Chegini committed Jan 4, 2024
1 parent e0ab049 commit 3b07472
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pynhd/nhdplus_derived.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ def enhd_attrs(
else:
output = get_parquet(parquet_path)

sb = ScienceBase()
url = sb.get_file_urls("63cb311ed34e06fef14f40a3").loc["enhd_nhdplusatts.parquet"].url
url = ScienceBase.get_file_urls("63cb311ed34e06fef14f40a3").loc["enhd_nhdplusatts.parquet"].url
fname = ogc.streaming_download(url, file_extention=".parquet")

enhd = pd.read_parquet(fname)
Expand Down Expand Up @@ -342,8 +341,7 @@ def nhdplus_h12pp(gpkg_path: Path | str | None = None) -> pd.DataFrame:
geopandas.GeoDataFrame
A geodataframe of HUC12 pour points.
"""
sb = ScienceBase()
files = sb.get_file_urls("60cb5edfd34e86b938a373f4").loc["102020wbd_outlets.gpkg"].url
files = ScienceBase.get_file_urls("60cb5edfd34e86b938a373f4").loc["102020wbd_outlets.gpkg"].url
gpkg_path = Path("cache", "102020wbd_outlets.gpkg") if gpkg_path is None else Path(gpkg_path)
_ = ogc.streaming_download(files, fnames=gpkg_path)
h12pp = gpd.read_file(gpkg_path, engine="pyogrio")
Expand Down

0 comments on commit 3b07472

Please sign in to comment.