Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hydroshare/hsclient into …
Browse files Browse the repository at this point in the history
…65-performance-improvements
  • Loading branch information
pkdash committed May 21, 2024
2 parents 0e029e7 + 7af071f commit f696e81
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
27 changes: 14 additions & 13 deletions docs/examples/Aggregation_Data_Object_Operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@
"# download the time series aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"\n",
"download_to = r\"D:\\Temp\\TimeSeries_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"base_working_dir = \"aggr_objects\"\n",
"download_to = os.path.join(base_working_dir, \"timeseries_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=ts_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -356,8 +357,8 @@
"source": [
"# download the geographic feature aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\GeoFeature_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"geofeature_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gf_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -569,8 +570,8 @@
"source": [
"# download the multidimensional aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\NetCDF_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"netcdf_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=md_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -726,8 +727,8 @@
"source": [
"# download the georaster aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -843,7 +844,7 @@
"# Note: The original raster aggregation may have more than one tif files. The following update will always result in an updated or new aggregation\n",
"# with a single tif file.\n",
"\n",
"output_raster_dir_path = r\"D:\\Temp\\GeoRaster_Testing\\updated_aggr\"\n",
"output_raster_dir_path = os.path.join(base_working_dir, \"georaster_testing\", \"updated_aggr\")\n",
"output_raster_filename = \"out_sample.tif\"\n",
"output_raster_file_path = os.path.join(output_raster_dir_path, output_raster_filename)\n",
"profile = rasterio_ds.profile\n",
Expand Down Expand Up @@ -885,9 +886,9 @@
"# If you have already updated the aggregation as described in the previous cell, then you have to first download the updated aggregation and load the\n",
"# rasterio.DatasetReader object from the downloaded location before you can save the updated raster to a new aggregation in HydroShare as shown below. Otherwise, you can execute the code in the next cell.\n",
"\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"# note the unzip_to directory must exist and be empty\n",
"unzip_to = rf\"{download_to}\\updated_aggr_unzipped\"\n",
"unzip_to = os.path.join(download_to, \"updated_aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")\n",
"\n",
Expand Down Expand Up @@ -920,9 +921,9 @@
"# retrieve the updated georaster aggregation to verify the data was updated\n",
"\n",
"# need to first download this updated/new aggregation\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"# note the unzip_to directory must exist and be empty\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"rasterio_ds = gr_aggr.as_data_object(agg_path=aggr_path)\n",
"# check the raster dimensions of the updated aggregation\n",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hsmodels @ git+https://github.com/hydroshare/hsmodels.git@main
hsmodels >= 1.0.3
pytest == 6.0.2
requests == 2.24.0
email-validator
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

setup(
name='hsclient',
version='1.0.0',
version='1.0.1',
packages=find_packages(include=['hsclient', 'hsclient.*'],
exclude=("tests",)),
install_requires=[
'hsmodels>=1.0.1',
'hsmodels>=1.0.3',
'requests',
'requests_oauthlib',
],
Expand Down

0 comments on commit f696e81

Please sign in to comment.