Skip to content

Commit

Permalink
Merge pull request #408 from claritychallenge/407-pre-commit-raises-s…
Browse files Browse the repository at this point in the history
…everal-errors-in-jupyter-notebooks

Place imports at top of cell
  • Loading branch information
jonbarker68 authored Sep 9, 2024
2 parents 9fcdf8b + ddb3b22 commit b383605
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@
},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"\n",
"print(\"Changing directory...\")\n",
"%cd clarity\n",
"print(\"Installing Clarity tools\")\n",
"%pip install -e .\n",
"import os\n",
"import sys\n",
"\n",
"sys.path.append(os.getcwd())\n",
"print(\"Moving back to project root directory\")\n",
Expand Down
8 changes: 5 additions & 3 deletions notebooks/02_Running_the_CEC2_baseline_from_commandline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@
},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"\n",
"from IPython.display import clear_output\n",
"\n",
"print(\"Cloning git repo...\")\n",
"!git clone --quiet https://github.com/claritychallenge/clarity.git\n",
"%cd clarity\n",
"%pip install -e .\n",
"import os\n",
"import sys\n",
"\n",
"sys.path.append(f'{os.getenv(\"NBOOKROOT\")}/clarity')\n",
"from IPython.display import clear_output\n",
"\n",
"clear_output()\n",
"print(\"Repository installed\")"
Expand Down
5 changes: 3 additions & 2 deletions notebooks/03_Running_the_CEC2_baseline_from_python.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@
},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"\n",
"print(\"Cloning git repo...\")\n",
"\n",
"!git clone --quiet https://github.com/claritychallenge/clarity.git\n",
"%cd clarity\n",
"%pip install -e .\n",
"import os\n",
"import sys\n",
"\n",
"sys.path.append(os.getcwd())\n",
"%cd .."
Expand Down

0 comments on commit b383605

Please sign in to comment.