From 956c24b8eeffb54edf3f0b9bd96365c96b704ca8 Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Mon, 5 Feb 2024 16:50:53 +0100 Subject: [PATCH] delete error output --- ...model_with_different_dataset_on_CRIB.ipynb | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/docs/notebooks/run_model_with_different_dataset_on_CRIB.ipynb b/docs/notebooks/run_model_with_different_dataset_on_CRIB.ipynb index 41d1ca1f..3bb31f77 100644 --- a/docs/notebooks/run_model_with_different_dataset_on_CRIB.ipynb +++ b/docs/notebooks/run_model_with_different_dataset_on_CRIB.ipynb @@ -218,37 +218,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# setup the model\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m config_path \u001b[38;5;241m=\u001b[39m model\u001b[38;5;241m.\u001b[39msetup(\n\u001b[1;32m 3\u001b[0m Location\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(61.8474, 24.2948)\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 4\u001b[0m StartTime\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m2014-01-01T00:00\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 5\u001b[0m EndTime\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m2014-01-15T00:00\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 6\u001b[0m )\n\u001b[1;32m 8\u001b[0m \u001b[38;5;66;03m# new config file genertaed to run the model \u001b[39;00m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNew config file \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mconfig_path\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/stemmus_scope.py:189\u001b[0m, in \u001b[0;36mStemmusScope.setup\u001b[0;34m(self, WorkDir, Location, StartTime, EndTime)\u001b[0m\n\u001b[1;32m 185\u001b[0m _, _, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcfg_file \u001b[38;5;241m=\u001b[39m config_io\u001b[38;5;241m.\u001b[39mcreate_io_dir(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_config)\n\u001b[1;32m 187\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_config \u001b[38;5;241m=\u001b[39m config_io\u001b[38;5;241m.\u001b[39mread_config(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcfg_file)\n\u001b[0;32m--> 189\u001b[0m \u001b[43mforcing_io\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprepare_forcing\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_config\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 190\u001b[0m soil_io\u001b[38;5;241m.\u001b[39mprepare_soil_data(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_config)\n\u001b[1;32m 191\u001b[0m soil_io\u001b[38;5;241m.\u001b[39mprepare_soil_init(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_config)\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/forcing_io.py:263\u001b[0m, in \u001b[0;36mprepare_forcing\u001b[0;34m(config)\u001b[0m\n\u001b[1;32m 257\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mStartTime\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNA\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mEndTime\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNA\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 259\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mNA\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m as start or end time is not supported in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mglobal\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m mode. Please \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 260\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mspecify a start and end time.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 261\u001b[0m )\n\u001b[0;32m--> 263\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mread_forcing_data_global\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 264\u001b[0m \u001b[43m \u001b[49m\u001b[43mglobal_data_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mForcingPath\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 265\u001b[0m \u001b[43m \u001b[49m\u001b[43mlat\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m# type: ignore\u001b[39;49;00m\n\u001b[1;32m 266\u001b[0m \u001b[43m \u001b[49m\u001b[43mlon\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m# type: ignore\u001b[39;49;00m\n\u001b[1;32m 267\u001b[0m \u001b[43m \u001b[49m\u001b[43mstart_time\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdatetime64\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mStartTime\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 268\u001b[0m \u001b[43m \u001b[49m\u001b[43mend_time\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdatetime64\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mEndTime\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 269\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 270\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 271\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/forcing_io.py:134\u001b[0m, in \u001b[0;36mread_forcing_data_global\u001b[0;34m(global_data_dir, lat, lon, start_time, end_time, timestep)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mread_forcing_data_global\u001b[39m( \u001b[38;5;66;03m# noqa:PLR0913 (too many arguments)\u001b[39;00m\n\u001b[1;32m 113\u001b[0m global_data_dir: Path,\n\u001b[1;32m 114\u001b[0m lat: \u001b[38;5;28mfloat\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 118\u001b[0m timestep: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1800S\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 119\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Dict:\n\u001b[1;32m 120\u001b[0m \u001b[38;5;124;03m\"\"\"Read forcing data for a certain location, based on global datasets.\u001b[39;00m\n\u001b[1;32m 121\u001b[0m \n\u001b[1;32m 122\u001b[0m \u001b[38;5;124;03m Args:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[38;5;124;03m Dictionary containing the forcing data.\u001b[39;00m\n\u001b[1;32m 133\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 134\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mglobal_data\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcollect_datasets\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 135\u001b[0m \u001b[43m \u001b[49m\u001b[43mglobal_data_dir\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mglobal_data_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 136\u001b[0m \u001b[43m \u001b[49m\u001b[43mlatlon\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mlat\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlon\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 137\u001b[0m \u001b[43m \u001b[49m\u001b[43mtime_range\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mstart_time\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_time\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 138\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimestep\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimestep\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 139\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/global_data/global_data_selection.py:39\u001b[0m, in \u001b[0;36mcollect_datasets\u001b[0;34m(global_data_dir, latlon, time_range, timestep)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;124;03m\"\"\"Collect and merge all the global datasets into one.\u001b[39;00m\n\u001b[1;32m 21\u001b[0m \n\u001b[1;32m 22\u001b[0m \u001b[38;5;124;03mArgs:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[38;5;124;03m Dictionary containing the variables extracted from the global datasets.\u001b[39;00m\n\u001b[1;32m 31\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 32\u001b[0m data: Dict[\u001b[38;5;28mstr\u001b[39m, Any] \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 33\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtime\u001b[39m\u001b[38;5;124m\"\u001b[39m: xr\u001b[38;5;241m.\u001b[39mDataArray(\n\u001b[1;32m 34\u001b[0m pd\u001b[38;5;241m.\u001b[39mdate_range(\u001b[38;5;28mstr\u001b[39m(time_range[\u001b[38;5;241m0\u001b[39m]), \u001b[38;5;28mstr\u001b[39m(time_range[\u001b[38;5;241m1\u001b[39m]), freq\u001b[38;5;241m=\u001b[39mtimestep)\u001b[38;5;241m.\u001b[39mrename(\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 37\u001b[0m )\n\u001b[1;32m 38\u001b[0m }\n\u001b[0;32m---> 39\u001b[0m era5_data \u001b[38;5;241m=\u001b[39m \u001b[43mgd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mera5\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve_era5_data\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 40\u001b[0m \u001b[43m \u001b[49m\u001b[43mglobal_data_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 41\u001b[0m \u001b[43m \u001b[49m\u001b[43mlatlon\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 42\u001b[0m \u001b[43m \u001b[49m\u001b[43mtime_range\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 43\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimestep\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 44\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 46\u001b[0m data \u001b[38;5;241m=\u001b[39m {\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mdata, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mera5_data}\n\u001b[1;32m 48\u001b[0m data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mco2_conv\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 49\u001b[0m vc\u001b[38;5;241m.\u001b[39mco2_mass_fraction_to_kg_per_m3(\n\u001b[1;32m 50\u001b[0m gd\u001b[38;5;241m.\u001b[39mcams_co2\u001b[38;5;241m.\u001b[39mretrieve_co2_data(\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m1e6\u001b[39m\n\u001b[1;32m 58\u001b[0m ) \u001b[38;5;66;03m# kg/m3 -> mg/m3\u001b[39;00m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/global_data/era5.py:50\u001b[0m, in \u001b[0;36mretrieve_era5_data\u001b[0;34m(global_data_dir, latlon, time_range, timestep)\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(files_era5_land) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mFileNotFoundError\u001b[39;00m(\n\u001b[1;32m 47\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo netCDF files found in the folder \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mglobal_data_dir \u001b[38;5;241m/\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mera5-land\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 48\u001b[0m )\n\u001b[0;32m---> 50\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mload_era5_data\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 51\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles_era5\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 52\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles_era5_land\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 53\u001b[0m \u001b[43m \u001b[49m\u001b[43mlatlon\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 54\u001b[0m \u001b[43m \u001b[49m\u001b[43mtime_range\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 55\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimestep\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 56\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/global_data/era5.py:80\u001b[0m, in \u001b[0;36mload_era5_data\u001b[0;34m(files_era5, files_era5_land, latlon, time_range, timestep)\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_era5_data\u001b[39m(\n\u001b[1;32m 60\u001b[0m files_era5: List[Path],\n\u001b[1;32m 61\u001b[0m files_era5_land: List[Path],\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 64\u001b[0m timestep: \u001b[38;5;28mstr\u001b[39m,\n\u001b[1;32m 65\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Dict:\n\u001b[1;32m 66\u001b[0m \u001b[38;5;124;03m\"\"\"Extract and convert the required variables from the ERA5 data.\u001b[39;00m\n\u001b[1;32m 67\u001b[0m \n\u001b[1;32m 68\u001b[0m \u001b[38;5;124;03m Args:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[38;5;124;03m Dictionary containing the variables extracted from ERA5.\u001b[39;00m\n\u001b[1;32m 78\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m 79\u001b[0m ds \u001b[38;5;241m=\u001b[39m xr\u001b[38;5;241m.\u001b[39mmerge(\n\u001b[0;32m---> 80\u001b[0m [\n\u001b[1;32m 81\u001b[0m get_era5_dataset(\n\u001b[1;32m 82\u001b[0m files\u001b[38;5;241m=\u001b[39mfiles,\n\u001b[1;32m 83\u001b[0m name\u001b[38;5;241m=\u001b[39mname, \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[1;32m 84\u001b[0m latlon\u001b[38;5;241m=\u001b[39mlatlon,\n\u001b[1;32m 85\u001b[0m time_range\u001b[38;5;241m=\u001b[39mtime_range,\n\u001b[1;32m 86\u001b[0m timestep\u001b[38;5;241m=\u001b[39mtimestep,\n\u001b[1;32m 87\u001b[0m )\n\u001b[1;32m 88\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m (name, files) \u001b[38;5;129;01min\u001b[39;00m [(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mERA5\u001b[39m\u001b[38;5;124m\"\u001b[39m, files_era5), (\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mERA5-land\u001b[39m\u001b[38;5;124m\"\u001b[39m, files_era5_land)]\n\u001b[1;32m 89\u001b[0m ]\n\u001b[1;32m 90\u001b[0m )\n\u001b[1;32m 92\u001b[0m data \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 93\u001b[0m data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwind_speed\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m (ds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mu10\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m \u001b[38;5;241m+\u001b[39m ds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv10\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m0.5\u001b[39m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/global_data/era5.py:81\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_era5_data\u001b[39m(\n\u001b[1;32m 60\u001b[0m files_era5: List[Path],\n\u001b[1;32m 61\u001b[0m files_era5_land: List[Path],\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 64\u001b[0m timestep: \u001b[38;5;28mstr\u001b[39m,\n\u001b[1;32m 65\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Dict:\n\u001b[1;32m 66\u001b[0m \u001b[38;5;124;03m\"\"\"Extract and convert the required variables from the ERA5 data.\u001b[39;00m\n\u001b[1;32m 67\u001b[0m \n\u001b[1;32m 68\u001b[0m \u001b[38;5;124;03m Args:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[38;5;124;03m Dictionary containing the variables extracted from ERA5.\u001b[39;00m\n\u001b[1;32m 78\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m 79\u001b[0m ds \u001b[38;5;241m=\u001b[39m xr\u001b[38;5;241m.\u001b[39mmerge(\n\u001b[1;32m 80\u001b[0m [\n\u001b[0;32m---> 81\u001b[0m \u001b[43mget_era5_dataset\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 82\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 83\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m# type: ignore\u001b[39;49;00m\n\u001b[1;32m 84\u001b[0m \u001b[43m \u001b[49m\u001b[43mlatlon\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlatlon\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 85\u001b[0m \u001b[43m \u001b[49m\u001b[43mtime_range\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtime_range\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 86\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimestep\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimestep\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 87\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 88\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m (name, files) \u001b[38;5;129;01min\u001b[39;00m [(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mERA5\u001b[39m\u001b[38;5;124m\"\u001b[39m, files_era5), (\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mERA5-land\u001b[39m\u001b[38;5;124m\"\u001b[39m, files_era5_land)]\n\u001b[1;32m 89\u001b[0m ]\n\u001b[1;32m 90\u001b[0m )\n\u001b[1;32m 92\u001b[0m data \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 93\u001b[0m data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwind_speed\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m (ds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mu10\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m \u001b[38;5;241m+\u001b[39m ds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv10\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m0.5\u001b[39m\n", - "File \u001b[0;32m~/.local/lib/python3.8/site-packages/PyStemmusScope/global_data/era5.py:151\u001b[0m, in \u001b[0;36mget_era5_dataset\u001b[0;34m(files, name, latlon, time_range, timestep)\u001b[0m\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m err\n\u001b[1;32m 150\u001b[0m ds \u001b[38;5;241m=\u001b[39m ds\u001b[38;5;241m.\u001b[39mdrop_vars([\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlatitude\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlongitude\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[0;32m--> 151\u001b[0m ds \u001b[38;5;241m=\u001b[39m \u001b[43mds\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 152\u001b[0m ds \u001b[38;5;241m=\u001b[39m ds\u001b[38;5;241m.\u001b[39mresample(time\u001b[38;5;241m=\u001b[39mtimestep)\u001b[38;5;241m.\u001b[39minterpolate(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlinear\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 153\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\u001b[38;5;241m.\u001b[39msel(time\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mslice\u001b[39m(time_range[\u001b[38;5;241m0\u001b[39m], time_range[\u001b[38;5;241m1\u001b[39m]))\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/xarray/core/dataset.py:900\u001b[0m, in \u001b[0;36mDataset.compute\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 881\u001b[0m \u001b[38;5;124;03m\"\"\"Manually trigger loading and/or computation of this dataset's data\u001b[39;00m\n\u001b[1;32m 882\u001b[0m \u001b[38;5;124;03mfrom disk or a remote source into memory and return a new dataset.\u001b[39;00m\n\u001b[1;32m 883\u001b[0m \u001b[38;5;124;03mUnlike load, the original dataset is left unaltered.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 897\u001b[0m \u001b[38;5;124;03mdask.compute\u001b[39;00m\n\u001b[1;32m 898\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 899\u001b[0m new \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcopy(deep\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[0;32m--> 900\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mnew\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/xarray/core/dataset.py:734\u001b[0m, in \u001b[0;36mDataset.load\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 731\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdask\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01marray\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mda\u001b[39;00m\n\u001b[1;32m 733\u001b[0m \u001b[38;5;66;03m# evaluate all the dask arrays simultaneously\u001b[39;00m\n\u001b[0;32m--> 734\u001b[0m evaluated_data \u001b[38;5;241m=\u001b[39m \u001b[43mda\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mlazy_data\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 736\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, data \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(lazy_data, evaluated_data):\n\u001b[1;32m 737\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvariables[k]\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m=\u001b[39m data\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/dask/base.py:600\u001b[0m, in \u001b[0;36mcompute\u001b[0;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[1;32m 597\u001b[0m keys\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_keys__())\n\u001b[1;32m 598\u001b[0m postcomputes\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_postcompute__())\n\u001b[0;32m--> 600\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[43mschedule\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsk\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 601\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m repack([f(r, \u001b[38;5;241m*\u001b[39ma) \u001b[38;5;28;01mfor\u001b[39;00m r, (f, a) \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(results, postcomputes)])\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/dask/threaded.py:89\u001b[0m, in \u001b[0;36mget\u001b[0;34m(dsk, keys, cache, num_workers, pool, **kwargs)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(pool, multiprocessing\u001b[38;5;241m.\u001b[39mpool\u001b[38;5;241m.\u001b[39mPool):\n\u001b[1;32m 87\u001b[0m pool \u001b[38;5;241m=\u001b[39m MultiprocessingPoolExecutor(pool)\n\u001b[0;32m---> 89\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[43mget_async\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 90\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msubmit\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 91\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_max_workers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 92\u001b[0m \u001b[43m \u001b[49m\u001b[43mdsk\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 93\u001b[0m \u001b[43m \u001b[49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 94\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 95\u001b[0m \u001b[43m \u001b[49m\u001b[43mget_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_thread_get_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 96\u001b[0m \u001b[43m \u001b[49m\u001b[43mpack_exception\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpack_exception\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 97\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 98\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 100\u001b[0m \u001b[38;5;66;03m# Cleanup pools associated to dead threads\u001b[39;00m\n\u001b[1;32m 101\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m pools_lock:\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/dask/local.py:500\u001b[0m, in \u001b[0;36mget_async\u001b[0;34m(submit, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, chunksize, **kwargs)\u001b[0m\n\u001b[1;32m 498\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwaiting\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;129;01mor\u001b[39;00m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mready\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;129;01mor\u001b[39;00m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrunning\u001b[39m\u001b[38;5;124m\"\u001b[39m]:\n\u001b[1;32m 499\u001b[0m fire_tasks(chunksize)\n\u001b[0;32m--> 500\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, res_info, failed \u001b[38;5;129;01min\u001b[39;00m \u001b[43mqueue_get\u001b[49m\u001b[43m(\u001b[49m\u001b[43mqueue\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mresult():\n\u001b[1;32m 501\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m failed:\n\u001b[1;32m 502\u001b[0m exc, tb \u001b[38;5;241m=\u001b[39m loads(res_info)\n", - "File \u001b[0;32m/usr/local/lib/python3.8/dist-packages/dask/local.py:137\u001b[0m, in \u001b[0;36mqueue_get\u001b[0;34m(q)\u001b[0m\n\u001b[1;32m 136\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mqueue_get\u001b[39m(q):\n\u001b[0;32m--> 137\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mq\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m/usr/lib/python3.8/queue.py:170\u001b[0m, in \u001b[0;36mQueue.get\u001b[0;34m(self, block, timeout)\u001b[0m\n\u001b[1;32m 168\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 169\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_qsize():\n\u001b[0;32m--> 170\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnot_empty\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwait\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 171\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m timeout \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 172\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtimeout\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m must be a non-negative number\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "File \u001b[0;32m/usr/lib/python3.8/threading.py:302\u001b[0m, in \u001b[0;36mCondition.wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 300\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m: \u001b[38;5;66;03m# restore state no matter what (e.g., KeyboardInterrupt)\u001b[39;00m\n\u001b[1;32m 301\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 302\u001b[0m \u001b[43mwaiter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 303\u001b[0m gotit \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 304\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " - ] - } - ], + "outputs": [], "source": [ "# setup the model\n", "config_path = model.setup(\n",