Skip to content

Commit

Permalink
Update Snyk dependencies for documentation pip requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlittlejohns committed Oct 30, 2023
1 parent 854522e commit 53c87f4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
29 changes: 13 additions & 16 deletions examples/job_stac.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
"source": [
"import sys\n",
"sys.path.append('..')\n",
"\n",
"!{sys.executable} -m pip install -q -r ../requirements/examples.txt\n",
"\n",
"# Install harmony-py requirements. Not necessary if you ran `pip install harmony-py` in your kernel \n",
"!{sys.executable} -m pip install -q -r ../requirements/core.txt\n",
"\n",
"from harmony import BBox, Client, Collection, Request, Environment\n"
"from harmony import BBox, Client, Collection, Request, Environment"
]
},
{
Expand All @@ -37,7 +38,7 @@
"metadata": {},
"outputs": [],
"source": [
" harmony_client = Client(env=Environment.UAT) # assumes .netrc usage\n",
"harmony_client = Client(env=Environment.UAT) # assumes .netrc usage\n",
"\n",
"collection = Collection(id='C1234088182-EEDTEST')\n",
"request = Request(\n",
Expand All @@ -47,7 +48,7 @@
")\n",
"\n",
"job_id = harmony_client.submit(request)\n",
"job_id\n"
"job_id"
]
},
{
Expand All @@ -63,7 +64,7 @@
"metadata": {},
"outputs": [],
"source": [
"stac_catalog_url = harmony_client.stac_catalog_url(job_id, show_progress=True)\n"
"stac_catalog_url = harmony_client.stac_catalog_url(job_id, show_progress=True)"
]
},
{
Expand All @@ -81,16 +82,17 @@
"source": [
"from urllib.parse import urlparse\n",
"import requests\n",
"from pystac import STAC_IO\n",
"from pystac import stac_io\n",
"\n",
"\n",
"def requests_read_method(uri):\n",
" parsed = urlparse(uri)\n",
" if parsed.hostname.startswith('harmony.') or parsed.hostname.startswith('localhost'):\n",
" return harmony_client.read_text(uri)\n",
" else:\n",
" return STAC_IO.default_read_text_method(uri)\n",
" return stac_io.default_read_text_method(uri)\n",
"\n",
"STAC_IO.read_text_method = requests_read_method"
"stac_io.read_text_method = requests_read_method"
]
},
{
Expand All @@ -107,19 +109,14 @@
"outputs": [],
"source": [
"from pystac import Catalog\n",
"cat = Catalog.from_file(stac_catalog_url)\n",
"\n",
"\n",
"cat = Catalog.from_file(stac_catalog_url)\n",
"print(cat.title)\n",
"\n",
"for item in cat.get_all_items():\n",
" print(item.datetime, item.properties.get('expires'), [asset.href for asset in item.assets.values()])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -138,7 +135,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
18 changes: 9 additions & 9 deletions requirements/examples.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
boto3 ~= 1.17
ipyplot ~= 1.1
ipywidgets ~= 7.6
jupyterlab ~= 3.0
matplotlib ~= 3.3
pystac ~= 1.7.3
rasterio ~= 1.2
boto3 ~= 1.28
intake-stac ~= 0.4.0
netCDF4
numpy
ipyplot ~= 1.1
ipywidgets ~= 8.1
jupyterlab ~= 4.0
matplotlib ~= 3.8
netCDF4 ~= 1.6
numpy ~= 1.26
pystac ~= 1.9.0
rasterio ~= 1.3

0 comments on commit 53c87f4

Please sign in to comment.