From 7d789b43783b714a99647ecdd662c6a46eb76e28 Mon Sep 17 00:00:00 2001 From: Junho Choi Date: Mon, 11 Apr 2022 22:09:02 +0000 Subject: [PATCH] cleared non-essential outputs; removed reference to older paths; isort+black --- .../create-SLIIDERS-ECON.ipynb | 448 ++---------------- .../download-sliiders-econ-input-data.ipynb | 21 +- 2 files changed, 47 insertions(+), 422 deletions(-) diff --git a/notebooks/create-SLIIDERS-ECON/create-SLIIDERS-ECON.ipynb b/notebooks/create-SLIIDERS-ECON/create-SLIIDERS-ECON.ipynb index a2af991..ce775d6 100644 --- a/notebooks/create-SLIIDERS-ECON/create-SLIIDERS-ECON.ipynb +++ b/notebooks/create-SLIIDERS-ECON/create-SLIIDERS-ECON.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -35,18 +35,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/srv/conda/envs/notebook/lib/python3.9/site-packages/dask_gateway/client.py:21: FutureWarning: format_bytes is deprecated and will be removed in a future release. Please use dask.utils.format_bytes instead.\n", - " from distributed.utils import LoopRunner, format_bytes\n" - ] - } - ], + "outputs": [], "source": [ "from collections import OrderedDict\n", "\n", @@ -81,22 +72,6 @@ "from sliiders.spatial import coastlen_poly, get_great_circle_nearest_index" ] }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "from pathlib import Path\n", - "\n", - "PATH_COUNTRY_LEVEL_EXPOSURE_PROJ = Path(\n", - " \"/gcs/rhg-data/impactlab-rhg/coastal/sliiders/int/exposure/ypk/archive/old_version/gdp_gdppc_pop_capital_proj_2010_2100.parquet\"\n", - ")\n", - "PATH_COUNTRY_LEVEL_EXPOSURE = Path(\n", - " \"/gcs/rhg-data/impactlab-rhg/coastal/sliiders/int/exposure/ypk/archive/old_version/gdp_gdppc_pop_capital_1950_2020.parquet\"\n", - ")" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -113,24 +88,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "3065940ee08a4549b19bfe60151cb6e9", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "VBox(children=(HTML(value='

GatewayCluster

'), HBox(children=(HTML(value='\\n
\\n\n\n \n \n \n
Workers 120
Cores 120
Memory 780.00 GiB
\n
\n" - } - }, - "cfb27d5560ff45738e55a7ad26f08431": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "d2f0efe2b24f4e5f8529d69c61423478": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HBoxModel", - "state": { - "children": [ - "IPY_MODEL_18a48615da394b8586b202571e3ae606", - "IPY_MODEL_63f4177e86974faba94bdd8d8b14c5f4" - ], - "layout": "IPY_MODEL_dbce31e163d848ad8d7f805e7dc24f95" - } - }, - "d5c065cab6fa4896a799405955891e9c": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "d8be0c0a34a24773a3274783ab3c0ce9": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "d95b66a3b65447a9bc26941f640fb90f": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "dbce31e163d848ad8d7f805e7dc24f95": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "dd2ab61c5f064d7e8040cebcf6b64d84": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": {} - }, - "e41545dbe83344ebb620afc28c2f6b81": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HBoxModel", - "state": { - "children": [ - "IPY_MODEL_c037fd0f59574a6086be229aee9ac51a", - "IPY_MODEL_203fe7bed06347be93b1a474ecdefa8e" - ], - "layout": "IPY_MODEL_d95b66a3b65447a9bc26941f640fb90f" - } - }, - "fc9c5e7767ea411dbc3b93c352692d8b": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "IntTextModel", - "state": { - "description": "Maximum", - "layout": "IPY_MODEL_4da70bf3adba4d06aec5e115d7d1000e", - "step": 1, - "style": "IPY_MODEL_a4f30213b3d44c85930fb3873aa6e851" - } - }, - "fe12eb8a64b6407da8e2f6c86f2d9b34": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "min_width": "500px" - } - } - }, + "state": {}, "version_major": 2, "version_minor": 0 } diff --git a/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb b/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb index 7a8c4e7..f33d2eb 100644 --- a/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb +++ b/notebooks/create-SLIIDERS-ECON/download-sliiders-econ-input-data.ipynb @@ -16,19 +16,10 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "517784ca-badd-41fe-a88c-7b4370260e5c", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/srv/conda/envs/notebook/lib/python3.9/site-packages/dask_gateway/client.py:21: FutureWarning: format_bytes is deprecated and will be removed in a future release. Please use dask.utils.format_bytes instead.\n", - " from distributed.utils import LoopRunner, format_bytes\n" - ] - } - ], + "outputs": [], "source": [ "import os\n", "import ssl\n", @@ -52,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "19fc306c-cfca-44dd-9044-0d8c6bf1d2c3", "metadata": {}, "outputs": [], @@ -533,7 +524,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "9cb05b93-c8cc-4f9e-9e99-ce5b7d511d16", "metadata": {}, "outputs": [], @@ -587,12 +578,12 @@ "outputs": [], "source": [ "URL_GADM = \"https://biogeo.ucdavis.edu/data/gadm3.6/gadm36_levels_gpkg.zip\"\n", - "PATH_GADM_ZIP = sset.DIR_GADM / URL_GADM.split('/')[-1]\n", + "PATH_GADM_ZIP = sset.DIR_GADM / URL_GADM.split(\"/\")[-1]\n", "urequest.urlretrieve(URL_GADM, PATH_GADM_ZIP)\n", "\n", "sset.PATH_GADM.parent.mkdir(exist_ok=True)\n", "\n", - "with zipfile.ZipFile(PATH_GADM_ZIP, mode='r') as z:\n", + "with zipfile.ZipFile(PATH_GADM_ZIP, mode=\"r\") as z:\n", " z.extractall(sset.PATH_GADM.parent)" ] },