From b82ed080066ca9876938cc47b68c2e68431d4458 Mon Sep 17 00:00:00 2001 From: ammarcsj <70114795+ammarcsj@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:06:15 +0200 Subject: [PATCH] change path finding --- .../run_pipeline_w_different_input_formats.ipynb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/quicktests/run_pipeline_w_different_input_formats.ipynb b/tests/quicktests/run_pipeline_w_different_input_formats.ipynb index 9def785..881b2df 100644 --- a/tests/quicktests/run_pipeline_w_different_input_formats.ipynb +++ b/tests/quicktests/run_pipeline_w_different_input_formats.ipynb @@ -8,18 +8,20 @@ "source": [ "import os\n", "import alphabase.test_data_downloader\n", + "from IPython import get_ipython\n", "\n", - "# Use the current working directory as a starting point\n", - "current_dir = os.getcwd()\n", + "# Get the directory of the current notebook\n", + "notebook_path = get_ipython().kernel.path\n", + "notebook_dir = os.path.dirname(notebook_path)\n", "\n", - "# Navigate up two levels to reach the project root\n", - "project_root = os.path.abspath(os.path.join(current_dir, '..', '..','..'))\n", + "# Navigate up three levels to reach the project root\n", + "project_root = os.path.abspath(os.path.join(notebook_dir, '..', '..'))\n", "\n", "output_dir = os.path.join(project_root, 'test_data', 'system_tests')\n", "\n", "os.makedirs(output_dir, exist_ok=True)\n", "# Now use the absolute path in the DataShareDownloader call\n", - "alphabase.test_data_downloader.DataShareDownloader(url=\"https://datashare.biochem.mpg.de/s/VJm70w0p2P86tE1\", output_dir=output_dir).download()" + "alphabase.test_data_downloader.DataShareDownloader(url=\"https://datashare.biochem.mpg.de/s/VJm70w0p2P86tE1\", output_dir=output_dir).download()\n" ] }, { @@ -28,7 +30,7 @@ "metadata": {}, "outputs": [], "source": [ - "quicktest_folder_mq_peptides = \"../../test_data/system_tests/quicktests/mq_peptides\"\n", + "quicktest_folder_mq_peptides = f\"../../test_data/system_tests/quicktests/mq_peptides\"\n", "\n", "quicktest_folder_mq_evidence = \"../../test_data/system_tests/quicktests/mq_evidence\"\n", "\n",