diff --git a/docs/user-guide/assignments/sail_the_ship.md b/docs/user-guide/assignments/sail_the_ship.md index d5e0e25b..98d9c3a9 100644 --- a/docs/user-guide/assignments/sail_the_ship.md +++ b/docs/user-guide/assignments/sail_the_ship.md @@ -224,7 +224,19 @@ Upon successfully completing the simulation, results from the expedition will be From here you can carry on your analysis. In general, we encourage you to use [Parcels](https://Parcels-code.org/) (i.e. `parcels.read_particlefile()`) to read in VirtualShip output files, and tools such as [Polars](https://www.pola.rs/) and/or [Pandas](https://pandas.pydata.org/) for further data analysis. We also provide various further [VirtualShip tutorials](https://virtualship.readthedocs.io/en/latest/user-guide/tutorials/index.html) which provide examples of how to visualise data recorded by the VirtualShip instruments. Use these to help you get started! ```{tip} -We also host a [Binder environment](https://mybinder.org/v2/gh/Parcels-code/virtualship-workspace/HEAD) (note this is separate to the GitHub Codespaces workspace you may be using) with all the necessary post-processing tools pre-installed and all the tutorials ready to use. This might be useful as a means to explore your data at first. See [here](../tutorials/binder_workspace.md) for more detail or await further instruction from your instructor. +You can analyse your results in either of our pre-configured cloud-based workspaces, which have all the necessary post-processing tools pre-installed and example tutorials ready to use: + +- **GitHub Codespaces** (the workspace you may already be using for your Virtualship simulations) has a `tutorials` folder with example notebooks. Your results and analysis files are saved between sessions. However, it uses your monthly free Codespaces hours. See the Simulation Workspace Guide below for how for use it. + +- **[Binder](https://mybinder.org/)** (a separate, browser-based JupyterLab environment). It has no usage limits and does not require creating an account, but it has less memory available and does not save your work. See the Binder Post-processing Workspace Guide below for how to use it. +``` + +```{nbgallery} +--- +maxdepth: 1 +--- +../tutorials/codespaces_guide.md +../tutorials/binder_guide.md ``` ## Reporting diff --git a/docs/user-guide/tutorials/binder_guide.md b/docs/user-guide/tutorials/binder_guide.md index 8e3bc8d3..f8035b0f 100644 --- a/docs/user-guide/tutorials/binder_guide.md +++ b/docs/user-guide/tutorials/binder_guide.md @@ -1,8 +1,10 @@ # Post-processing Workspace Guide -This guide is supposed to be used once you have run VirtualShip simulations, which you may have done either on your own computer or in the VirtualShip workspace [via GitHub Codespaces](../user-profiles/educators/train-the-teacher/codespaces_guide.md). +This guide is supposed to be used once you have run VirtualShip simulations, which you may have done either on your own computer or in the VirtualShip workspace [via GitHub Codespaces](codespaces_guide.md). -The instructions below will guide you through the steps to access the VirtualShip post-processing workspace, upload your VirtualShip simulation output files, and run the example tutorials for analysis. +You can also analyse your results directly in the GitHub Codespaces workspace, which offers more memory than Binder and saves your work between sessions (see [Analysing your results on GitHub Codespaces](codespaces_guide.md#analysing-your-results)). This separate Binder workspace is provided as an alternative, because Codespaces has a monthly usage limit. Use Binder if you want to save or if you exhaust your monthly Codespaces hours. + +The instructions below will guide you through the steps to access the VirtualShip Binder post-processing workspace, upload your VirtualShip simulation output files, and run the example tutorials for analysis. Using this workspace saves you from having to install any dependencies on your own computer. Note, if you plan for extensive post-processing analysis, you may prefer to move onto your own machine and install the dependencies there, as the Binder workspace is not suitable for long-running analysis or extensive expeditions with many instruments and sensors enabled (see [below](#non-persistent-storage)). @@ -10,7 +12,7 @@ Using this workspace saves you from having to install any dependencies on your o Navigate to the VirtualShip Workspace repository on GitHub: [https://github.com/Parcels-code/virtualship-workspace](https://github.com/Parcels-code/virtualship-workspace) -From here, on the repo welcome page, you should a section labelled **Workspace for VirtualShip post-processing - Binder**. Click on the **Step on Board: VirtualShip** button (Figure 1) to launch the post-processing workspace. +From here, on the repo welcome page, you should see a section labelled **Workspace for VirtualShip post-processing - Binder**. Click on the **Step on Board: VirtualShip** button (Figure 1) to launch the post-processing workspace. ```{figure} ../_images/binder_button.png :width: 200px @@ -27,7 +29,7 @@ You can also launch Terminal sessions to run commands in the workspace, and open ## Upload your VirtualShip output files -Before you can use the workspace to analyse your data, you will need to upload your VirtualShip simulation output files. You can do this via the file explorer in the JupyterLab environment. Simply navigate to the folder where you want to upload your files, and click the "Upload Files" button. Then select the files from your computer that you want to upload. +Before you can use the workspace to analyse your data, you will need to upload your VirtualShip simulation output files. You can do this via the file explorer in the JupyterLab environment. Simply navigate to the folder where you want to upload your files, and click the "Upload Files" button. Then select the files from your computer that you want to upload. You can also simply **drag and drop** your output files from your laptop into the folder created in the file explorer panel. ```{tip} We suggest also making a new folder (called e.g. `data`) in the workspace to store your uploaded files, to keep things organised. @@ -36,7 +38,7 @@ We suggest also making a new folder (called e.g. `data`) in the workspace to sto ## Running the example tutorials ```{important} -The example tutorials are near-ready to be run 'out of the box'. However, you will have to adjust the file paths in the tutorial notebooks to point to your own data (e.g. in the `data` directory you may have created). As standard they have only have a place holder path, which will cause the code to fail. +The example tutorials are near-ready to be run 'out of the box'. However, you will have to adjust the file paths in the tutorial notebooks to point to your own data (e.g. in the `data` directory you may have created). As standard they only have a place holder path, which will cause the code to fail. ``` There is a pre-uploaded folder called `tutorials` in the workspace (see in the file explorer, or you can navigate there in the Terminal with `cd tutorials`), which contains the example notebooks. These are mirrors of the tutorials in the [VirtualShip User Guide](../tutorials/index.md), and are provided here so that they can be run straight away with your data. There is one notebook dedicated to each of the instruments currently supported in VirtualShip. @@ -47,7 +49,7 @@ When running any blocks of code the `python 3 (ipykernel)` in the bottom left of ## Non-persistent storage -The Binder workspace is not suitable for long-running analysis, as it has non-persistent storage and limited computing resourses. This means that any files you create or modify in the workspace will be lost when the workspace is closed and the notebook files will revert to the original version. Therefore it is intended as a space to run the example tutorials and do some quick analysis, but not for long-term storage of your data or results. +The Binder workspace is not suitable for long-running analysis, as it has non-persistent storage and limited computing resources. This means that any files you create or modify in the workspace will be lost when the workspace is closed and the notebook files will revert to the original version. Therefore it is intended as a space to run the example tutorials and do some quick analysis, but not for long-term storage of your data or results. If you want to do more extensive analysis or for larger expeditions with several instrument choices, we recommend that you download your data and results to your own computer, and run the analysis there. You will also need to install the required dependencies to your own computer. diff --git a/docs/user-guide/tutorials/codespaces_guide.md b/docs/user-guide/tutorials/codespaces_guide.md index 945a4ac7..89db8592 100644 --- a/docs/user-guide/tutorials/codespaces_guide.md +++ b/docs/user-guide/tutorials/codespaces_guide.md @@ -53,6 +53,10 @@ Otherwise, you may find the editor window (`B`) helpful for example to [edit the The file explorer (`A`) will allow you to navigate the file structure of your Codespace, and you can also use it to upload/download files to/from your Codespace by right-clicking on a file or folder and selecting the appropriate option. When downloading files from your Codespace you may encounter a `github.dev cannot open this because it contains system files` error, particularly when downloading entire results folders. To avoid this, create a new folder on your local PC where you want to store your files and download the files directly there. +```{tip} +You can also **drag and drop** files from your computer straight into the file explorer (`A`) to upload them to your Codespace. Drop them onto a folder to put them there, or onto an empty area to put them in the main workspace folder. This works for individual files and entire folders and is a quick way to upload data +``` + ### Persistent storage Your instance of the VirtualShip simulation workspace is linked to your GitHub account. This means that any files which you create and/or modify (e.g. the output of your VirtualShip simulations) will be tied to your account and will persist between sessions. You can also download files to your own computer if you wish, or upload files from your computer to the workspace. @@ -89,6 +93,24 @@ It's good to know that by default the Codespace will automatically stop after 30 ``` +## 4) Analysing your Virtualship Results + +You can also use the same Codespace environment to analyse results from your Virtualship simulation. In the File Explorer panel on the left, you will find a `tutorials` folder. This contains example analysis notebooks for each instrument offered by Virtualship. You can open a notebook by clicking on it. The first time you run a notebook, you need to select which Python environment to use: + +- Click `Select Kernel` in the top-right corner of the notebook. +- Choose `Python Environments...` when prompted. +- Select the environment called `venv` (`/opt/venv/bin/python`). + +After this, you can continue to run the notebook and begin analysing your results. Remember to set the working directory to the location where your VirtualShip results are stored when reading in your data in the notebook. + +```{tip} + +Loading data from many instruments or sensors (for example CTD/Argo float data with several biogeochemical sensors) needs a lot of memory. On the standard Codespace (2 cores, 8 GB RAM), the notebook kernel may crash (resulting in "the kernel died"). If this happens, use a more powerful Codespace with 4 cores. Remember that this uses your free hours twice as fast. + +``` + +If you run out of your monthly free GitHub Codespaces hours you can also analyse your results in the [Binder post-processing workspace](binder_guide.md) or [locally on your own laptop](binder_guide.md#non-persistent-storage). Analysis on the Binder workspace has no usage limits, but it has less memory and does not save your work. + ### Collaboration within groups _[This section is under development]_ diff --git a/docs/user-guide/user-profiles/educators/train-the-teacher/train_the_teacher.md b/docs/user-guide/user-profiles/educators/train-the-teacher/train_the_teacher.md index eb5d53dd..3f24501a 100644 --- a/docs/user-guide/user-profiles/educators/train-the-teacher/train_the_teacher.md +++ b/docs/user-guide/user-profiles/educators/train-the-teacher/train_the_teacher.md @@ -96,7 +96,7 @@ There are broadly two ways to set up the `VirtualShip` software for teaching: Option 1) requires less preparation but can be more challenging for students to set up (especially if inexperienced) with frequent machine-dependent issues (and a lot of time spent on troubleshooting during lesson time!). Option 2) requires more preparation as the course convenor but is generally easier to support in-class, especially for larger groups. It also has the advantage that all students are working with the same resources, versions and infrastructure, which is beneficial for reproducibility and fairness. ```{important} -At present, for Option 2), we offer an _experimental_ pre-configured cloud-based environment solution via [GitHub Codespaces](https://github.com/features/codespaces) for VirtualShip simualtions. This is a central, free solution that we can support and maintain, but this approach also has some limitations. Namely, each student must sign up for a GitHub account and the monthly free tier is limited to, in effect, up to 60 hours of usage* (per student/GitHub account). +At present, for Option 2), we offer an _experimental_ pre-configured cloud-based environment solution via [GitHub Codespaces](https://github.com/features/codespaces) for both running VirtualShip simualtions and analysing the results. This is a central, free solution that we can support and maintain, but this approach also has some limitations. Namely, each student must sign up for a GitHub account and the monthly free tier is limited to, in effect, up to 60 hours of usage* (per student/GitHub account). This will be sufficient for _most_ courses, but could be insufficient if your planned teaching activities are longer or more intensive. We continually monitor the optimum solution for distributing the VirtualShip software to whole classrooms in the most accessible way possible, and we are open to [feedback/advice](#feedback-support) on this. @@ -106,6 +106,8 @@ This will be sufficient for _most_ courses, but could be insufficient if your pl ``` ```{note} +Students can analyse their results in the same GitHub Codespaces workspace, which comes with the necessary dependencies and packages pre-installed to perform preliminary analysis of their results along with example tutorial notebooks. + We also offer a [Binder workspace](https://mybinder.org/v2/gh/Parcels-code/virtualship-workspace/HEAD) for post-processing VirtualShip output files, which is a separate solution to the VirtualShip simulation workspace (GitHub Codespaces). See the [post-processing workspace section](#pre-configured-post-processing-workspace) later in this document for more information and why these are two separate solutions. ``` @@ -249,19 +251,21 @@ VirtualShip does not provide explicit tooling for analysis, as this will be depe ``` -#### Pre-configured post-processing workspace +#### Pre-configured post-processing workspaces + +Students have two pre-configured options for analysing their output. Both have all relevant dependencies pre-installed and the example [tutorials](../../../tutorials/index.md) directly available in the workspace. Using either is optional, but they are offered to make post-processing more accessible to students, with less time spent setting up their local environment.. However, students can also analyse their results locally if preferred. -We also host a VirtualShip [post-processing environment](https://mybinder.org/v2/gh/Parcels-code/virtualship-workspace/HEAD) via [Binder](https://mybinder.org/), which is a cloud-based JupyterLab environment. This can be used to run the example tutorials and any other analysis code that students may wish to write, without having to install anything on their own devices. All relevant dependencies are pre-installed in this environment, the example tutorials are directly available in the workspace, and the VirtualShip output files can be uploaded to the environment for analysis. +- **GitHub Codespaces** (the same workspace used to run the simulations): The workspace includes a `tutorials` folder with the example notebooks. Students need to select the `venv` kernel when they first run an example jupyter notebook, and edit the notebook file paths to point to their own results. This option has more memory than Binder and saves students' work between sessions. The advantage is that students can run and analyse their Virtualship simulations in the same environment. However, analysis time counts towards the limited monthly Codespaces allowance. Instructions can be found in the [Simulation Workspace Guide above](#option-2-pre-configured-environment-cloud-based). -This is of course optional, but is offered as a means to make the post-processing analysis more accessible to students with less time spent setting up their local environment. +- **Binder**: We also host a separate VirtualShip [post-processing environment](https://mybinder.org/v2/gh/Parcels-code/virtualship-workspace/HEAD) via [Binder](https://mybinder.org/), which is a cloud-based JupyterLab environment. This can be used to run the example tutorials and any other analysis code that students may wish to write, without having to install anything on their own devices. It has no monthly usage limit and does not need creating an account, but it has limited RAM and non-persistent storage making it unsuitable for complex analyses or if students wish to save and return to their work. ```{note} -This Binder workspace is a separate protocol to the GitHub Codespaces workspace used for running the VirtualShip simulations, and described [above](#option-2-pre-configured-environment-cloud-based). We made the decision to separate these two environments to minimise the amount of compute time on the Codespaces environment, which has a monthly limit per user. +We made the decision to separate these two environments to minimise the amount of compute time on the Codespaces environment, which has a monthly limit per user. The Binder environment does not have monthly quotas, but is not suitable for running the VirtualShip simulations themselves (low, inconsistent RAM allocation and non-persistent storage). Hence the need (for now at least 🤞) to have these as two separate environments. ``` -See the "Post-processing Workspace" guide below for more information on how to use this environment. This can also be distributed to students as part of your course. +See the "Post-processing Workspace" guide below for more information on how to use the Binder post-processing environment. This can also be distributed to students as part of your course. diff --git a/docs/user-guide/user-profiles/learners/index.md b/docs/user-guide/user-profiles/learners/index.md index 6a36a7d9..82119b6e 100644 --- a/docs/user-guide/user-profiles/learners/index.md +++ b/docs/user-guide/user-profiles/learners/index.md @@ -89,12 +89,16 @@ conda create -n virtualship -c conda-forge virtualship conda activate virtualship ``` -### 3) Post-processing workspace +### 3) Post-processing workspaces -When your expedition has finished, you can analyse your results in our **post-processing workspace**. This is a separate, cloud-based JupyterLab environment (hosted on [Binder](https://mybinder.org/)) with all the analysis tools and example tutorials already installed. See the Post-processing Workspace Guide below for how to use it. +When your expedition has finished, you can analyse your results [locally on your own laptop](../../tutorials/binder_guide.md#non-persistent-storage) or in a cloud-based workspace with all the analysis tools and example tutorials already installed. There are two post-processing workspace options: + +- **GitHub Codespaces** (the same workspace you may have used to run your Virtualship simulations). Your results and analysis files are saved between sessions. However, it uses your monthly free Codespaces hours. See the [Simulation Workspace Guide](../../tutorials/codespaces_guide.md) for instructions. + +- **[Binder](https://mybinder.org/)** (a separate, browser-based JupyterLab environment). It has no usage limits and does not require creating an account, but it has less memory available and does not save your work. See the Post-processing Workspace Guide below for how to use it. ```{note} -You don't have to use the post-processing workspace. Feel free to download your data and analyse it in your own programming environment if you prefer. +You don't have to use the post-processing workspaces. Feel free to download your data and analyse it in your own programming environment if you prefer. ``` ```{nbgallery}