From d8903f61e29f01cf71c2fa0301cbe4e66c4179b8 Mon Sep 17 00:00:00 2001 From: CapMar00 Date: Mon, 24 Jun 2024 06:46:27 +0200 Subject: [PATCH] minor changes --- notebooks/test-ipywidget.ipynb | 56 ++++++---------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) diff --git a/notebooks/test-ipywidget.ipynb b/notebooks/test-ipywidget.ipynb index 69d1a94..e575857 100644 --- a/notebooks/test-ipywidget.ipynb +++ b/notebooks/test-ipywidget.ipynb @@ -77,47 +77,10 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "eacead0a-88f3-4ef6-84a8-cfe94faa540a", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Exception ignored in: , '/data1/drought_dataset/spei/spei12/SPEI12_genlogistic_global_era5_moda_ref1991to2020_198301.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'})>\n", - "Traceback (most recent call last):\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 244, in __del__\n", - " self.close(needs_lock=False)\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 222, in close\n", - " file.close()\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2624, in netCDF4._netCDF4.Dataset.close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2587, in netCDF4._netCDF4.Dataset._close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2028, in netCDF4._netCDF4._ensure_nc_success\n", - "RuntimeError: NetCDF: Not a valid ID\n", - "Exception ignored in: , '/data1/drought_dataset/spei/spei12/SPEI12_genlogistic_global_era5_moda_ref1991to2020_200701.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'})>\n", - "Traceback (most recent call last):\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 244, in __del__\n", - " self.close(needs_lock=False)\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 222, in close\n", - " file.close()\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2624, in netCDF4._netCDF4.Dataset.close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2587, in netCDF4._netCDF4.Dataset._close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2028, in netCDF4._netCDF4._ensure_nc_success\n", - "RuntimeError: NetCDF: Not a valid ID\n", - "Exception ignored in: , '/data1/drought_dataset/spei/spei12/SPEI12_genlogistic_global_era5_moda_ref1991to2020_201501.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'})>\n", - "Traceback (most recent call last):\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 244, in __del__\n", - " self.close(needs_lock=False)\n", - " File \"/home/marina/tales-of-drought/lib64/python3.6/site-packages/xarray/backends/file_manager.py\", line 222, in close\n", - " file.close()\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2624, in netCDF4._netCDF4.Dataset.close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2587, in netCDF4._netCDF4.Dataset._close\n", - " File \"src/netCDF4/_netCDF4.pyx\", line 2028, in netCDF4._netCDF4._ensure_nc_success\n", - "RuntimeError: NetCDF: Not a valid ID\n" - ] - } - ], + "outputs": [], "source": [ "# Data structure for country to subareas mapping\n", "# https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country\n", @@ -327,7 +290,6 @@ "metadata": {}, "outputs": [], "source": [ - "# Update the function to handle changes\n", "def update_subarea_selector(*args):\n", " country = country_selector.value\n", " bounds = get_country_bounds(country) # Fetch bounds when a country is selected\n", @@ -1820,20 +1782,20 @@ " xaxis_title='Years',\n", " yaxis_title='Mean SPEI12 Index',\n", " height=600,\n", - " plot_bgcolor='white', # Sets the plotting area background color\n", - " paper_bgcolor='white', # Sets the overall background color of the chart\n", + " plot_bgcolor='white',\n", + " paper_bgcolor='white',\n", " xaxis=dict(\n", - " showgrid=True, # Enable grid (default)\n", - " gridcolor='lightgray', # Set grid color\n", - " linecolor='lightgray', # Set axis line color\n", + " showgrid=True,\n", + " gridcolor='lightgray',\n", + " linecolor='lightgray',\n", " ),\n", " yaxis=dict(\n", " showgrid=True,\n", " gridcolor='lightgray',\n", " linecolor='lightgray',\n", - " zeroline=True, # Ensure the zero line is visible\n", + " zeroline=True,\n", " zerolinewidth=1,\n", - " zerolinecolor='black' # Change zero line color to blue\n", + " zerolinecolor='black'\n", " )\n", ")\n", "\n",