Skip to content

Commit

Permalink
fixing read
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Bonetti committed Oct 9, 2024
1 parent 082f013 commit 07385c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
27 changes: 13 additions & 14 deletions notebooks/first_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2024-10-09 15:31:06.243530: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"2024-10-09 17:25:33.409107: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
]
}
Expand Down Expand Up @@ -109,29 +109,28 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "dc2b0678-6b9a-4c45-8152-30b293ae434d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<birdy.client.utils.WPSExecution object at 0x7fff67d912d0>\n"
"<birdy.client.utils.WPSExecution object at 0x7fff67da5f10>\n"
]
},
{
"data": {
"text/plain": [
"cycloneResponse(\n",
" output_csv='http://localhost:5000/outputs/c0ccdac4-8624-11ef-a84c-080038c050cd/tcactivity_48_17_20240629_lag2_Sindian.csv',\n",
" output_png='http://localhost:5000/outputs/c0ccdac4-8624-11ef-a84c-080038c050cd/tcactivity_48_17_20240629_lag2_Sindian.1.png'\n",
")"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
"ename": "ProcessFailed",
"evalue": "Sorry, process failed.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mProcessFailed\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m resp \u001b[38;5;241m=\u001b[39m wps\u001b[38;5;241m.\u001b[39mcyclone(init_date\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m2024-06-29\u001b[39m\u001b[38;5;124m\"\u001b[39m, leadtime\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m48-96 h\u001b[39m\u001b[38;5;124m\"\u001b[39m, region\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNorth Atlantic\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(resp)\n\u001b[0;32m----> 3\u001b[0m \u001b[43mresp\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/work/bk1318/b382633/conda/envs/shearwater/lib/python3.11/site-packages/birdy/client/outputs.py:40\u001b[0m, in \u001b[0;36mWPSResult.get\u001b[0;34m(self, asobj)\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ProcessIsNotComplete(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPlease wait ...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39misSucceded():\n\u001b[1;32m 39\u001b[0m \u001b[38;5;66;03m# TODO: add reason for failure\u001b[39;00m\n\u001b[0;32m---> 40\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ProcessFailed(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSorry, process failed.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_output(asobj)\n",
"\u001b[0;31mProcessFailed\u001b[0m: Sorry, process failed."
]
}
],
"source": [
Expand Down
4 changes: 2 additions & 2 deletions shearwater/processes/wps_cyclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ def _handler(self, request, response):

workdir = Path(self.workdir)
model_path = os.path.join(workdir, f"Unet_sevenAreas_fullStd_{lag}lag_model.keras")
git_path = "https://github.com/climateintelligence/shearwater/raw/main"
urllib.request.urlretrieve(
f"""https://github.com/climateintelligence/shearwater/raw/
main/data/Unet_sevenAreas_fullStd_{lag}lag_model.keras""",
f"{git_path}/data/Unet_sevenAreas_fullStd_{lag}lag_model.keras",
model_path
)

Expand Down

0 comments on commit 07385c2

Please sign in to comment.