From 837a54b748368f358863eb9918bc726262237c6f Mon Sep 17 00:00:00 2001 From: "pin.jin@ga.gov.au" Date: Sun, 18 Dec 2022 23:47:45 +0000 Subject: [PATCH 1/3] fix s2 notebook --- notebooks/Sentinel_2.ipynb | 14 ++++++++++---- tests/test_notebooks.py | 2 -- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/notebooks/Sentinel_2.ipynb b/notebooks/Sentinel_2.ipynb index 018c4ed..5e6547b 100644 --- a/notebooks/Sentinel_2.ipynb +++ b/notebooks/Sentinel_2.ipynb @@ -157,10 +157,11 @@ "outputs": [], "source": [ "import sys\n", + "sys.path.insert(1, '../utils/')\n", "import datacube\n", "\n", - "from notebooks.utils.deafrica_datahandling import load_ard\n", - "from notebooks.utils.deafrica_plotting import rgb" + "from utils.deafrica_datahandling import load_ard\n", + "from utils.deafrica_plotting import rgb" ] }, { @@ -498,7 +499,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -512,7 +513,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.8.15 | packaged by conda-forge | (default, Nov 22 2022, 08:49:35) \n[GCC 10.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "36f1ec0750f296e3257d4c290a6c8ed00b14af3513565f9d7fc44fe655b3805b" + } }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/tests/test_notebooks.py b/tests/test_notebooks.py index f6cc552..1cf8f0b 100644 --- a/tests/test_notebooks.py +++ b/tests/test_notebooks.py @@ -18,8 +18,6 @@ def test_esri_land_cover(tb): def test_nasadem(tb): assert True # ok -@pytest.mark.skip() -@pytest.mark.xfail(reason="Index error") @testbook(f'{NB_DIR}/notebooks/Sentinel_2.ipynb', execute=True, timeout=180) def test_sentinel_2(tb): assert True # ok \ No newline at end of file From f602f0631dceabf070141aea80341b5c67860027 Mon Sep 17 00:00:00 2001 From: "pin.jin@ga.gov.au" Date: Mon, 19 Dec 2022 00:22:28 +0000 Subject: [PATCH 2/3] unmount utils from docker-compose --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e8409dd..f2accc1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,6 @@ services: volumes: - ./notebooks:/notebooks - ./tests:/tests - - ./utils:/utils - ./products.csv:/products.csv restart: always checkdb: From 600121052b356043982d4e34a50dff7d541c25bd Mon Sep 17 00:00:00 2001 From: "pin.jin@ga.gov.au" Date: Mon, 19 Dec 2022 03:56:11 +0000 Subject: [PATCH 3/3] fix s2 notebook --- notebooks/Sentinel_2.ipynb | 11 +++++++++-- tests/test_notebooks.py | 10 +++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/notebooks/Sentinel_2.ipynb b/notebooks/Sentinel_2.ipynb index 5e6547b..32461fd 100644 --- a/notebooks/Sentinel_2.ipynb +++ b/notebooks/Sentinel_2.ipynb @@ -157,9 +157,16 @@ "outputs": [], "source": [ "import sys\n", - "sys.path.insert(1, '../utils/')\n", + "sys.path.insert(1, '../utils/')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "import datacube\n", - "\n", "from utils.deafrica_datahandling import load_ard\n", "from utils.deafrica_plotting import rgb" ] diff --git a/tests/test_notebooks.py b/tests/test_notebooks.py index 1cf8f0b..ccfcdb4 100644 --- a/tests/test_notebooks.py +++ b/tests/test_notebooks.py @@ -18,6 +18,14 @@ def test_esri_land_cover(tb): def test_nasadem(tb): assert True # ok -@testbook(f'{NB_DIR}/notebooks/Sentinel_2.ipynb', execute=True, timeout=180) +@testbook(f'{NB_DIR}/notebooks/Sentinel_2.ipynb',timeout=180) def test_sentinel_2(tb): + tb.execute_cell(1) + tb.inject( + """ + import sys + sys.path.insert(1, '/notebooks/') + """ + ) + tb.execute_cell(slice(3, 10)) assert True # ok \ No newline at end of file