|
7 | 7 | "source": [ |
8 | 8 | "# The *ecco_access* Python \"package\": accessing ECCO output on PO.DAAC\n", |
9 | 9 | "\n", |
10 | | - "Andrew Delman, updated 2024-10-15\n", |
| 10 | + "Andrew Delman, updated 2024-10-17\n", |
11 | 11 | "\n", |
12 | 12 | "[Introduction](https://ecco-v4-python-tutorial.readthedocs.io/ECCO_access_intro.html#Introduction)\\\n", |
13 | 13 | "[Setting up *ecco_access*](https://ecco-v4-python-tutorial.readthedocs.io/ECCO_access_intro.html#Setting-up-ecco_access)\\\n", |
|
39 | 39 | "- Download the *ecco_access* folder by clicking on [this link](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2FECCO-GROUP%2FECCO-v4-Python-Tutorial%2Ftree%2Fmaster%2Fecco_access).\n", |
40 | 40 | "\n", |
41 | 41 | "\n", |
42 | | - "If you downloaded the folder (second option), make sure the downloaded folder is unzipped/extracted and rename it to `ecco_access`. Then you need to make it accessible to your notebook, either by: \n", |
| 42 | + "If you downloaded the folder (second option), make sure the downloaded folder is unzipped/extracted and rename it to `ecco_access`. \n", |
43 | 43 | "\n", |
44 | | - "### Moving the folder to a directory in your Python path\n", |
| 44 | + "Then you need to make it accessible to your notebook, either by: \n", |
| 45 | + "\n", |
| 46 | + "### Adding the `ecco_access` parent directory to your Python path\n", |
| 47 | + "\n", |
| 48 | + "The `ecco_access` parent directory is the directory containing `ecco_access`. Add it to your Python path with the following Python code in each notebook where `ecco_access` is used:\n", |
45 | 49 | "\n", |
46 | 50 | "```\n", |
47 | 51 | "import sys\n", |
48 | | - "print(sys.path)\n", |
49 | | - "\n", |
50 | | - "['', '/srv/conda/envs/notebook/lib/python311.zip', '/srv/conda/envs/notebook/lib/python3.11',\n", |
51 | | - " '/srv/conda/envs/notebook/lib/python3.11/lib-dynload', '/srv/conda/envs/notebook/lib/python3.11/site-packages']\n", |
| 52 | + "sys.path.append({parent_dir})\n", |
52 | 53 | "```\n", |
53 | 54 | "\n", |
54 | | - "In this example, `ecco_access` could be moved to the `/srv/conda/envs/notebook/lib/python3.11/site-packages/` directory in your Python path. \n", |
55 | | - "\n", |
56 | 55 | "Or:\n", |
57 | 56 | "\n", |
58 | 57 | "### Put in a symlink to the `ecco_access` location from your current notebook directory.\n", |
59 | 58 | "\n", |
| 59 | + "A symlink (or soft link) from the directory containing your notebooks will allow you to use the `ecco_access` libraries from any notebook in that directory. Put in the link with the following code in your terminal window:\n", |
| 60 | + "\n", |
| 61 | + "```\n", |
| 62 | + "ln -s {parent_dir}/ecco_access {current_notebook_dir}/ecco_access\n", |
| 63 | + "```\n", |
| 64 | + "\n", |
| 65 | + "or by running the following Python code once:\n", |
| 66 | + "\n", |
60 | 67 | "```\n", |
61 | 68 | "import os\n", |
62 | 69 | "os.symlink('{location_of_ecco_access}/ecco_access','{current_notebook_dir}/ecco_access',target_is_directory=True)\n", |
|
0 commit comments