From 55e6f9fafb94db1014a007f51e2d68da7f41fd2e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:35:35 +0100 Subject: [PATCH 1/7] rename old surf setup --- ...arch_cloud_setup.ipynb => old_surf_research_cloud_setup.ipynb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/user-guide/tutorials/{surf_research_cloud_setup.ipynb => old_surf_research_cloud_setup.ipynb} (100%) diff --git a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb b/docs/user-guide/tutorials/old_surf_research_cloud_setup.ipynb similarity index 100% rename from docs/user-guide/tutorials/surf_research_cloud_setup.ipynb rename to docs/user-guide/tutorials/old_surf_research_cloud_setup.ipynb From d80fcf343426351e7a00f78cf0745c1c8ce70851 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:49:42 +0100 Subject: [PATCH 2/7] Update surf instructions --- .../tutorials/surf_research_cloud_setup.ipynb | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 docs/user-guide/tutorials/surf_research_cloud_setup.ipynb diff --git a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb new file mode 100644 index 00000000..044c570c --- /dev/null +++ b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb @@ -0,0 +1,98 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "vscode": { + "languageId": "plaintext" + } + }, + "source": [ + "# SURF Resarch Cloud: Virtualship environment setup\n", + "\n", + "> Note: \n", + "> This guide is specific to students who are enrolled at UU in the Dynamical Oceanography course.\n", + "\n", + "In the class, we use virtualship in the cloud (in this case, SURF Research Cloud - called SURF RC from here-on). This has several advantages:\n", + "\n", + "- You aren't limited to the power of your laptop\n", + "- Input datasets are downloaded faster, as they're downloaded to the cloud instance (and not to your laptop)\n", + "\n", + "\n", + "## 1. Accepting SURF RC invite\n", + "\n", + "In your student email you'll have an invite from SURF Research Access Management (SRAM) to join a project on SURF RC. Accept this invite.\n", + "\n", + "## 2. Open the environment\n", + "\n", + "Navigate to the [SURF Research Cloud Dashboard](https://portal.live.surfresearchcloud.nl/), and click \"access\" on the shared workspace.\n", + "\n", + "## 3. Jupyter workspace layout and additional config\n", + "\n", + "> Note: This only needs to be done once during setup.\n", + "\n", + "In the Jupyter workspace, you'll see the following in your file explorer:\n", + "```\n", + ".\n", + "├── KERNEL-README.ipynb\n", + "├── data\n", + "│ └── datasets\n", + "| └── shared-storage <--- The shared persistent storage\n", + "└── scratch\n", + "```\n", + "\n", + "The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{group-name}` replacing `{group-name}` with the name of your group) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n", + "\n", + "---\n", + "\n", + "To be able to run virtualship from the terminal, we need to take some additional steps which are detailed in the `KERNEL-README.ipynb` contains important information for configuring your environment. Namely, for our uses, the \"Initialize conda\" section. Do the following.\n", + "\n", + "> #### Initialize conda\n", + "> \n", + "> To make the already installed conda-tool available for yourself, you have to initialize your terminal shell.\n", + "> \n", + "> Start a \"Terminal\" tab in the Jupyter Lab launcher and type:\n", + "> ```\n", + "> /etc/miniconda/bin/conda init\n", + "> ```\n", + "> Close the terminal tab and start a new one.\n", + "> You will see that the terminal prompt has changed to something like\n", + "> ```\n", + "> (base) metheuser@mywsp:\n", + "> ```\n", + "> This is conda telling you that you are currently in the \"base\" environment.\n", + "\n", + "From here, you already have another environment set up for you. Running `conda env list` in the terminal, you should see:\n", + "\n", + "```bash\n", + "(base) $ conda env list\n", + "\n", + "# conda environments:\n", + "#\n", + "base * /etc/miniconda\n", + "virtualship /etc/miniconda/envs/virtualship`\n", + "```\n", + "\n", + "Here you can do `conda activate virtualship` to activate the environment called \"virtualship\". This environment is a shared environment among all workspace users that can be centrally updated. If you want you can create and manage your own environments by running the relevant conda commands.\n", + "\n", + "With the `virtualship` environment, you now have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/shared-storage/{group name}` and run `virtualship` commands as you would on your local machine.\n", + "\n", + "---\n", + "Finally, when you're working in Jupyter Notebooks, you are able to access the Conda environment with `virtualship` and related dependencies by switching the Kernel in the top right of the UI.\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From db31ba8519cf56ca8ba96c354378d1f9c9b3f7f5 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:53:25 +0100 Subject: [PATCH 3/7] update pr template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9a56995e..70d3a645 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ -- [ ] Closes #xxxx +- Closes #xxxx - [ ] Tests added - [ ] Re-ran README.md help commands if the CLI has changed From 1247d4e1205eb14dd8a5beefbe25886cfc0fb82b Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:56:22 +0100 Subject: [PATCH 4/7] Update suggested folder naming --- docs/user-guide/tutorials/surf_research_cloud_setup.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb index 044c570c..810dcd7f 100644 --- a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb +++ b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb @@ -41,7 +41,7 @@ "└── scratch\n", "```\n", "\n", - "The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{group-name}` replacing `{group-name}` with the name of your group) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n", + "The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{your-name}` replacing `{your-name}` with your name) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n", "\n", "---\n", "\n", @@ -75,7 +75,7 @@ "\n", "Here you can do `conda activate virtualship` to activate the environment called \"virtualship\". This environment is a shared environment among all workspace users that can be centrally updated. If you want you can create and manage your own environments by running the relevant conda commands.\n", "\n", - "With the `virtualship` environment, you now have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/shared-storage/{group name}` and run `virtualship` commands as you would on your local machine.\n", + "With the `virtualship` environment, you now have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/shared-storage/{your-name}` and run `virtualship` commands as you would on your local machine.\n", "\n", "---\n", "Finally, when you're working in Jupyter Notebooks, you are able to access the Conda environment with `virtualship` and related dependencies by switching the Kernel in the top right of the UI.\n", From 876d86897731c5d16fe7d5440e149866676e0b26 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:58:29 +0000 Subject: [PATCH 5/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/tutorials/ADCP_data_tutorial.ipynb | 2 +- docs/tutorials/CTD_data_tutorial.ipynb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/ADCP_data_tutorial.ipynb b/docs/tutorials/ADCP_data_tutorial.ipynb index 9df68b3d..a7fe063b 100644 --- a/docs/tutorials/ADCP_data_tutorial.ipynb +++ b/docs/tutorials/ADCP_data_tutorial.ipynb @@ -128,7 +128,7 @@ " {\"long_name\": \"distance to coast\", \"units\": \"m\", \"positive\": \"shoreward\"}\n", ")\n", "peru = peru.set_coords(\"s\").sortby(\"s\")\n", - "print(f\"max distance from coast: {abs(peru.s.min()).data/1000:.2f} km\")" + "print(f\"max distance from coast: {abs(peru.s.min()).data / 1000:.2f} km\")" ] }, { diff --git a/docs/tutorials/CTD_data_tutorial.ipynb b/docs/tutorials/CTD_data_tutorial.ipynb index c374a476..fcd5d181 100644 --- a/docs/tutorials/CTD_data_tutorial.ipynb +++ b/docs/tutorials/CTD_data_tutorial.ipynb @@ -263,12 +263,12 @@ "source": [ "# Fill the dataset with values from the csv files.\n", "for ob in range(5): # loop through files\n", - " header = pd.read_csv(f\"Japan/CTD_Japan_station_{ob+1}.csv\", nrows=7, header=None)\n", + " header = pd.read_csv(f\"Japan/CTD_Japan_station_{ob + 1}.csv\", nrows=7, header=None)\n", " ctd.lon[ob] = header.iloc[0, 1]\n", " ctd.lat[ob] = header.iloc[1, 1]\n", " ctd.start_time[ob] = header.iloc[2, 1]\n", " ctd.end_time[ob] = header.iloc[3, 1]\n", - " data = pd.read_csv(f\"Japan/CTD_Japan_station_{ob+1}.csv\", skiprows=4)\n", + " data = pd.read_csv(f\"Japan/CTD_Japan_station_{ob + 1}.csv\", skiprows=4)\n", " ctd.P[:, ob] = data[\"pressure [hPa]\"]\n", " ctd.T[:, ob] = data[\"temperature [degC]\"]\n", " ctd.S[:, ob] = data[\"salinity [g kg-1]\"]" From 67805777ceed2b0dd342f9f79e32b15ac47be382 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:06:00 +0100 Subject: [PATCH 6/7] Add course facilitator notes --- .../tutorials/surf_research_cloud_setup.ipynb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb index 810dcd7f..2eb41185 100644 --- a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb +++ b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb @@ -79,7 +79,17 @@ "\n", "---\n", "Finally, when you're working in Jupyter Notebooks, you are able to access the Conda environment with `virtualship` and related dependencies by switching the Kernel in the top right of the UI.\n", - "\n" + "\n", + "\n", + "\n", + "## Course facilitator notes\n", + "\n", + "If `virtualship` is updated on GitHub, and you want to update the shared environment, you can do so by running the following commands in the terminal:\n", + "\n", + "```bash\n", + "conda activate virtualship\n", + "sudo /etc/miniconda/envs/virtualship/bin/pip install --upgrade git+https://github.com/OceanParcels/virtualship@main\n", + "```" ] }, { From 874b01849b917fd595800df7b75f68bd6992e132 Mon Sep 17 00:00:00 2001 From: Erik van Sebille Date: Wed, 19 Feb 2025 16:00:07 +0100 Subject: [PATCH 7/7] Fixing suggestions by @ammedd --- docs/user-guide/tutorials/surf_research_cloud_setup.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb index 2eb41185..299d9cb0 100644 --- a/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb +++ b/docs/user-guide/tutorials/surf_research_cloud_setup.ipynb @@ -41,7 +41,7 @@ "└── scratch\n", "```\n", "\n", - "The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{your-name}` replacing `{your-name}` with your name) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n", + "The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{your-group-name}` replacing `{your-group-name}` with your group name) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n", "\n", "---\n", "\n", @@ -65,7 +65,7 @@ "From here, you already have another environment set up for you. Running `conda env list` in the terminal, you should see:\n", "\n", "```bash\n", - "(base) $ conda env list\n", + "conda env list\n", "\n", "# conda environments:\n", "#\n",