Skip to content

Commit

Permalink
exlude rendered notebooks and use awscli v2
Browse files Browse the repository at this point in the history
  • Loading branch information
betolink committed Jun 6, 2023
1 parent 87da0bd commit 01d74e5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,14 @@ jobs:
with:
version: 1.1.251

- name: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 2 # default
verbose: false # default
arch: amd64 # allowed values: amd64, arm64

- name: "Execute notebooks with Quarto"
env:
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
shell: bash -l {0}
run: |
jupyter kernelspec list
find notebooks -type f -name "*.ipynb" | xargs -I F quarto render "F" --execute --execute-daemon
find notebooks -type f -name "*.ipynb" -not -path '*\.ipynb_checkpoints/*' -not -path '*endered*' | xargs -I F quarto render "F" --execute --execute-daemon
win-osx:
name: Runtime (${{ matrix.os }}, micromamba)
Expand Down
56 changes: 35 additions & 21 deletions notebooks/SnowEx_ASO_MODIS_Snow/Snow-tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import os\n",
Expand Down Expand Up @@ -144,7 +146,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"polygon_filepath = str(os.getcwd() + '/Data/nsidc-polygon.json') # Note: A shapefile or other vector-based spatial data format could be substituted here.\n",
Expand Down Expand Up @@ -173,7 +177,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"temporal = '2017-01-01T00:00:00Z,2017-12-31T23:59:59Z' # Set temporal range"
Expand All @@ -191,7 +197,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"data_dict = { 'snowex': {'short_name': 'SNEX17_GPR','version': '2','polygon': polygon,'temporal':temporal},\n",
Expand All @@ -212,7 +220,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"for k, v in data_dict.items(): fn.granule_info(data_dict[k])"
Expand All @@ -230,7 +240,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"search_df = fn.time_overlap(data_dict)\n",
Expand All @@ -253,7 +265,8 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
"scrolled": true,
"tags": []
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -299,7 +312,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"bounds = poly.bounds # Get polygon bounds to be used as bounding box input\n",
Expand All @@ -324,7 +339,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"base_url = 'https://n5eil02u.ecs.nsidc.org/egi/request' # Set NSIDC data access base URL\n",
Expand All @@ -349,19 +366,14 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"path = str(os.getcwd() + '/Data')\n",
"if not os.path.exists(path):\n",
" os.mkdir(path)\n",
"os.chdir(path)\n",
"#fn.cmr_download(urls)\n",
"#fn.cmr_download(api_request)\n",
"\n",
"\n",
"os.chdir(\"Data\")\n",
"# pull data from staged bucket for demonstration\n",
"!aws --no-sign-request s3 cp s3://snowex-aso-modis-tutorial-data/ ./ --recursive #access data in staged directory"
"!awscliv2 --no-sign-request s3 cp s3://snowex-aso-modis-tutorial-data/ ./ --recursive #access data in staged directory"
]
},
{
Expand All @@ -377,7 +389,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"snowex_path = './SnowEx17_GPR_Version2_Week1.csv' # Define local filepath\n",
Expand Down Expand Up @@ -756,7 +770,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@
"\n",
"\n",
"# pull data from staged bucket for demonstration\n",
"!aws --no-sign-request s3 cp s3://snowex-aso-modis-tutorial-data/ ./ --recursive #access data in staged directory"
"!awscliv2 --no-sign-request s3 cp s3://snowex-aso-modis-tutorial-data/ ./ --recursive #access data in staged directory"
]
},
{
Expand Down

0 comments on commit 01d74e5

Please sign in to comment.