You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/mpm/mpm.ipynb
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -825,7 +825,31 @@
825
825
"id": "e074a3c3",
826
826
"metadata": {},
827
827
"outputs": [],
828
-
"source": "# --- Translate Path with Verification ---\nds_path: str = \"/MyData/mpm-benchmarks/2d/uniaxial_stress/\"\nds_path_nonexistent: str = \"/MyData/this/path/does/not/exist/\"\n\ntry:\n # Translate and verify the existing path\n print(f\"\\nTranslating and verifying path: {ds_path}\")\n input_uri = ds.files.to_uri(ds_path, verify_exists=True)\n print(f\"Input Directory Tapis URI (verified): {input_uri}\")\n\n # Example: Try translating a non-existent path with verification (will raise error)\n print(f\"\\nTranslating and verifying non-existent path: {ds_path_nonexistent}\")\n input_uri_bad = ds.files.to_uri(\n ds_path_nonexistent, verify_exists=True\n )\n print(f\"This line should not be reached.\")\n\nexcept FileOperationError as e:\n print(f\"Error during path translation/verification: {e}\")\n # Decide how to handle the error (e.g., stop notebook, use default, etc.)\n # For this example, we'll stop if verification fails.\n raise SystemExit(\"Stopping notebook due to path verification error.\")\nexcept Exception as e:\n print(f\"An unexpected error occurred during path translation: {e}\")\n raise SystemExit(\"Stopping notebook due to unexpected path translation error.\")"
0 commit comments