Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
capmar00 committed Jun 24, 2024
1 parent 1e886dd commit d8903f6
Showing 1 changed file with 9 additions and 47 deletions.
56 changes: 9 additions & 47 deletions notebooks/test-ipywidget.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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: <bound method CachingFileManager.__del__ of CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/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: <bound method CachingFileManager.__del__ of CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/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: <bound method CachingFileManager.__del__ of CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit d8903f6

Please sign in to comment.