diff --git a/examples/workflow_by_code.ipynb b/examples/workflow_by_code.ipynb index d5711e0b5..5a992e339 100644 --- a/examples/workflow_by_code.ipynb +++ b/examples/workflow_by_code.ipynb @@ -1,11 +1,11 @@ { "cells": [ { + "cell_type": "markdown", + "metadata": {}, "source": [ "\"Open" - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", @@ -28,16 +28,17 @@ "import sys, site\n", "from pathlib import Path\n", "\n", - "TEMP_CODE_DIR = str(Path(\"~/tmp/qlib_code\").expanduser().resolve())\n", "\n", "try:\n", " import qlib\n", - " scripts_dir = Path.cwd().parent.joinpath(\"scripts\")\n", "except ImportError:\n", " # install qlib\n", " ! pip install pyqlib\n", " # reload\n", " site.main()\n", + "\n", + "scripts_dir = Path.cwd().parent.joinpath(\"scripts\")\n", + "if not scripts_dir.joinpath(\"get_data.py\").exists():\n", " # download get_data.py script\n", " scripts_dir = Path(\"~/tmp/qlib_code/scripts\").expanduser().resolve()\n", " scripts_dir.mkdir(parents=True, exist_ok=True)\n", @@ -376,4 +377,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +}