Skip to content

Commit edeeacf

Browse files
Update Quickstart and README (#242)
* update README * update quickstart guide, including video * Apply suggestions from code review Co-authored-by: Erik van Sebille <[email protected]> * Disable mypy typechecking in CI configuration (#243) Comment out typechecking (mypy) steps in CI workflow * update README * update quickstart guide, including video * change from passive --------- Co-authored-by: Erik van Sebille <[email protected]>
1 parent 71aa963 commit edeeacf

File tree

3 files changed

+79
-55
lines changed

3 files changed

+79
-55
lines changed

README.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
VirtualShipParcels is a command line simulator allowing students to plan and conduct a virtual research expedition, receiving measurements as if they were coming from actual oceanographic instruments including:
3838

3939
- ADCP (currents)
40-
- CTD (conductivity and temperature)
40+
- CTD (conductivity and temperature + biogeochemical variables)
4141
- XBT (temperature)
42-
- underwater measurements (salinity and temperature)
43-
- surface drifters
44-
- argo float deployments
42+
- Ship-mounted underwater measurements (salinity and temperature)
43+
- Surface drifters
44+
- Argo float deployments
4545

4646
<!-- TODO: future. Along the way students will encounter difficulties such as: -->
4747

@@ -60,6 +60,12 @@ For a development installation, please follow the instructions detailed in the [
6060

6161
## Usage
6262

63+
```{tip}
64+
See the [Quickstart guide](https://virtualship.readthedocs.io/en/latest/user-guide/quickstart.html) in our documentation for a step-by-step introduction to using VirtualShip.
65+
```
66+
67+
You can run the VirtualShip via the command line interface (CLI) using the `virtualship` command. It has three subcommands: `init`, `plan`, and `run`.
68+
6369
```console
6470
$ virtualship --help
6571
Usage: virtualship [OPTIONS] COMMAND [ARGS]...
@@ -69,53 +75,65 @@ Options:
6975
--help Show this message and exit.
7076

7177
Commands:
72-
fetch Download input data for an expedition.
73-
init Initialize a directory for a new expedition, with an example...
74-
run Run the expedition.
78+
init Initialize a directory for a new expedition, with an...
79+
plan Launch UI to help build expedition configuration (YAML) file.
80+
run Execute the expedition simulations.
7581
```
7682

7783
```console
7884
$ virtualship init --help
7985
Usage: virtualship init [OPTIONS] PATH
8086

81-
Initialize a directory for a new expedition, with an example schedule and
82-
ship config files.
87+
Initialize a directory for a new expedition, with an expedition.yaml file.
88+
89+
If --mfp-file is provided, it will generate the expedition.yaml from the MPF
90+
file instead.
8391

8492
Options:
85-
--help Show this message and exit.
93+
--from-mfp TEXT Partially initialise a project from an exported xlsx or csv
94+
file from NIOZ' Marine Facilities Planning tool
95+
(specifically the "Export Coordinates > DD" option). User
96+
edits are required after initialisation.
97+
--help Show this message and exit.
8698
```
8799

88100
```console
89101

90-
$ virtualship fetch --help
91-
Usage: virtualship fetch [OPTIONS] PATH
102+
$ virtualship plan --help
103+
Usage: virtualship plan [OPTIONS] PATH
92104

93-
Download input data for an expedition.
105+
Launch UI to help build expedition configuration (YAML) file.
94106

95-
Entrypoint for the tool to download data based on space-time region provided
96-
in the schedule file. Data is downloaded from Copernicus Marine, credentials
97-
for which can be obtained via registration:
98-
https://data.marine.copernicus.eu/register . Credentials can be provided on
99-
prompt, via command line arguments, or via a YAML config file. Run
100-
`virtualship fetch` on a expedition for more info.
107+
Should you encounter any issues with using this tool, please report an issue
108+
describing the problem to the VirtualShip issue tracker at:
109+
https://github.com/OceanParcels/virtualship/issues"
101110

102111
Options:
103-
--username TEXT Copernicus Marine username.
104-
--password TEXT Copernicus Marine password.
105-
--help Show this message and exit.
112+
--help Show this message and exit.
106113
```
107114

108115
```console
109116
$ virtualship run --help
110117
Usage: virtualship run [OPTIONS] PATH
111118

112-
Run the expedition.
119+
Execute the expedition simulations.
113120

114121
Options:
115-
--help Show this message and exit.
122+
--from-data TEXT Use pre-downloaded data, saved to disk, for expedition,
123+
instead of streaming directly via Copernicus Marine
124+
Assumes all data is stored in prescribed directory, and
125+
all variables (as listed below) are present. Required
126+
variables are: {'phyc', 'o2', 'so', 'uo', 'po4', 'thetao',
127+
'no3', 'vo', 'chl', 'ph', 'nppv'} Assumes that variable
128+
names at least contain the standard Copernicus Marine
129+
variable name as a substring. Will also take the first
130+
file found containing the variable name substring. CAUTION
131+
if multiple files contain the same variable name
132+
substring.
133+
--help Show this message and exit.
116134
```
117135

118-
For examples, see [the tutorials section of our documentation](https://virtualship.readthedocs.io/en/latest/user-guide/tutorials/index.html).
136+
For examples of VirtualShip simulation output post-processing, see [the tutorials section of our documentation](https://virtualship.readthedocs.io/en/latest/user-guide/tutorials/index.html).
119137

120138
## Input data
121139

docs/user-guide/quickstart.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# VirtualShip Quickstart Guide 🚢
22

3-
```{warning}
4-
This quickstart guide is designed for use with VirtualShip v0.2.2 and currently out of date with the latest version of VirtualShip (v1.0.0). It will be updated soon.
5-
6-
In particular, the `virtualship fetch` command is no longer supported. Instead, data fetching is now integrated into the `virtualship run` command. See [#226](https://github.com/Parcels-code/virtualship/pull/226) for details in the meantime.
7-
```
8-
93
Welcome to this Quickstart to using VirtualShip. In this guide we will conduct a virtual expedition in the North Sea. Note, however, that you can plan your own expedition anywhere in the global ocean and conduct whatever set of measurements you wish!
104

115
This Quickstart is available as an instructional video below, or you can continue with the step-by-step guide.
126

13-
<iframe width="560" height="315" src="https://www.youtube.com/embed/ypafzoTBj_A?si=m8BpYN_08OJ9aagq" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
7+
```{warning}
8+
Please note the video below may show output from an earlier version of VirtualShip, as the codebase is in active development. The instructions in the video are still generally applicable for the current version. However, for the most up-to-date instructions, please follow the text in this Quickstart guide.
9+
```
10+
11+
<iframe width="720" height="400" src="https://www.youtube.com/embed/yymj5fImnRc?si=04Nt3YEhGRMBcEBI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1412

1513
---
1614

1715
This guide is intended to give a basic overview of how to plan, initialise and execute a virtual expedition. Data post-processing, analysis and visualisation advice is provided in other sections of the documentation (see [Results](#results) section).
1816

19-
## Expedition route planning
17+
## 1) Expedition route planning
2018

2119
```{note}
2220
This section describes the _custom_ expedition route planning procedure. There is also an option to proceed without your own route and you can instead use an example route, schedule and selection of measurements (see [Expedition initialisation](#expedition-initialisation) for more details).
@@ -36,7 +34,7 @@ Feel free to design your expedition as you wish! There is no need to copy these
3634

3735
Once you have finalised your MFP expedition route, select "Export" on the right hand side of the window --> "Export Coordinates" --> "DD". This will download your coordinates as an .xlsx (Excel) file, which we will later feed into the VirtualShip protocol to initialise the expedition.
3836

39-
## Expedition initialisation
37+
## 2) Expedition initialisation
4038

4139
```{note}
4240
VirtualShip is a command line interface (CLI) based tool. From this point on in the Quickstart we will be working predominantly via the command line in the Terminal. If you are unfamiliar with what a CLI is, see [here](https://www.w3schools.com/whatis/whatis_cli.asp) for more information.
@@ -58,7 +56,7 @@ This will create a folder/directory called `EXPEDITION_NAME` with a single file:
5856
For advanced users: it is also possible to run the expedition initialisation step without an MFP .xlsx export file. In this case you should simply run `virtualship init EXPEDITION_NAME` in the CLI. This will write an example `expedition.yaml` file in the `EXPEDITION_NAME` folder/directory. This file contains example waypoints, timings, instrument selections, and ship configuration, but can be edited or propagated through the rest of the workflow unedited to run a sample expedition.
5957
```
6058

61-
## Expedition scheduling & ship configuration
59+
## 3) Expedition scheduling & ship configuration
6260

6361
The next step is to finalise the expedition schedule plan, including setting times and instrument selection choices for each waypoint, as well as configuring the ship (such as its speed and underway measurement instruments). The easiest way to do so is to use the bespoke VirtualShip planning tool via the following command:
6462

@@ -86,8 +84,10 @@ For the underway ADCP, there is a choice of using the 38 kHz OceanObserver or th
8684

8785
### Waypoint datetimes
8886

87+
<!-- TODO: change this to a reference to `Run the data` instead of `Fetch the data` and talk a bit about data in the run step -->
88+
8989
```{note}
90-
VirtualShip supports simulating experiments in the years 1993 through to the present day (and up to two weeks in the future) by leveraging the suite of products available Copernicus Marine Data Store (see [Fetch the data](#fetch-the-data)). The data download is automated based on the time period selected in the schedule. Different periods will rely on different products from the Copernicus Marine catalogue (see [Documentation](documentation/copernicus_products.md)).
90+
VirtualShip supports simulating experiments in the years 1993 through to the present day (and up to two weeks in the future) by leveraging the suite of products available Copernicus Marine Data Store (see [Run the expedition](#run-the-expedition)). The data access is automated based on the time period selected in the schedule. Different periods will rely on different products from the Copernicus Marine catalogue (see [Documentation](documentation/copernicus_products.md)).
9191
```
9292

9393
You will need to enter dates and times for each of the sampling stations/waypoints selected in the MFP route planning stage. This can be done under _Schedule Editor_ > _Waypoints & Instrument Selection_ in the planning tool.
@@ -110,7 +110,7 @@ You should now consider which measurements are to be taken at each sampling site
110110
Click [here](https://virtualship.readthedocs.io/en/latest/user-guide/assignments/Research_proposal_intro.html#Measurement-Options) for more information on what measurement options are available, and a brief introduction to each instrument.
111111
```
112112

113-
Instrument selections can be made for each waypoint in the same sub-panels as the [waypoint time](#waypoint-datetimes) selection by simply switching each on or off. Multiple instruments are allowed at each waypoint.
113+
You can make instrument selections for each waypoint in the same sub-panels as the [waypoint time](#waypoint-datetimes) selection by simply switching each on or off. Multiple instruments are allowed at each waypoint.
114114

115115
```{note}
116116
For advanced users: you can also make further customisations to behaviours of all instruments under _Ship Config Editor_ > _Instrument Configurations_.
@@ -124,35 +124,41 @@ When you are happy with your ship configuration and schedule plan, press _Save C
124124
On pressing _Save Changes_ the tool will check the selections are valid (for example that the ship will be able to reach each waypoint in time). If they are, the changes will be saved to the `expedition.yaml` file, ready for the next steps. If your selections are invalid you should be provided with information on how to fix them.
125125
```
126126

127-
## Fetch the data
128-
129-
You are now ready to retrieve the input data required for simulating your virtual expedition from the [Copernicus Marine Data Store](https://data.marine.copernicus.eu/products). You will need to register for an account via https://data.marine.copernicus.eu/register.
130-
131-
To retrieve the data, run the following command in your CLI:
132-
133-
```
134-
virtualship fetch EXPEDITION_NAME --username <USERNAME> --password <PASSWORD>
127+
```{caution}
128+
The `virtualship plan` tool will check that the ship can reach each waypoint according to the prescribed ship speed. However, before the ultimate [simulation step](#run-the-expedition) there will be a final, automated check that the schedule also accounts for the time taken to conduct the measurements at each site (e.g. a CTD cast in deeper waters will take longer). Therefore, we recommend to take this extra time into account at this stage of the planning by estimating how long each measurement will take and adding this time on.
135129
```
136130

137-
Replace `<USERNAME>` and `<PASSWORD>` with your own Copernicus Marine Data Store credentials. Alternatively, you can simply run `virtualship fetch EXPEDITION_NAME` and you will be prompted for your credentials instead.
131+
## 4) Run the expedition
138132

139-
Waiting for your data download is a great time to practice your level of patience. A skill much needed in oceanographic fieldwork ;-)
133+
You are now ready to run your virtual expedition! This stage will simulate the measurements taken by the instruments you selected at each waypoint in your expedition schedule, using input data sourced from the [Copernicus Marine Data Store](https://data.marine.copernicus.eu/products).
140134

141-
## Run the expedition
135+
You will need to register for Copernicus Marine Service account (see [here](https://data.marine.copernicus.eu/register)), but the data access in VirtualShip will be automated.
142136

143-
Once your input data has finished downloading you can run your expedition using the command:
137+
You can run your expedition simulation using the command:
144138

145139
```
146140
virtualship run EXPEDITION_NAME
147141
```
148142

143+
If this is your first time running VirtualShip, you will be prompted to enter your own Copernicus Marine Data Store credentials (these will be saved automatically for future use).
144+
149145
Your command line output should look something like this...
150146

151147
![GIF of example VirtualShip log output](example_log_instruments.gif)
152148

153-
It might take up to an hour to simulate the measurements depending on your choices. Why not browse through previous real-life [blogs and expedition reports](https://virtualship.readthedocs.io/en/latest/user-guide/assignments/Sail_the_ship.html#Reporting) in the meantime?!
149+
Small simulations (e.g. small space-time domains and fewer instrument deployments) will be relatively fast. For large, complex expeditions, it _could_ take up to an hour to simulate the measurements depending on your choices. Waiting for simulation is a great time to practice your level of patience. A skill much needed in oceanographic fieldwork ;-)
150+
151+
Why not browse through previous real-life [blogs and expedition reports](https://virtualship.readthedocs.io/en/latest/user-guide/assignments/Sail_the_ship.html#Reporting) in the meantime?!
152+
153+
#### Using pre-downloaded data (optional)
154+
155+
By default, VirtualShip will stream data 'on-the-fly' from the Copernicus Marine Data Store, meaning no prior data download is necessary. However, if you prefer to use pre-downloaded data instead (e.g. due to limited internet connection or wanting to use different input data) you can do so by running `virtualship run EXPEDITION_NAME --from-data <PATH_TO_DATA_DIR>`.
156+
157+
Enter `virtualship run --help` to see the full description of the `--from-data` flag and its usage.
158+
159+
See the relevant [documentation](https://virtualship.readthedocs.io/en/latest/user-guide/documentation/pre_download_data.html#) for more detail on how to prepare data for offline use.
154160

155-
## Results
161+
## 5) Results
156162

157163
Upon successfully completing the simulation, results from the expedition will be stored in the `EXPEDITION_NAME/results` directory, written as [Zarr](https://zarr.dev/) files.
158164

src/virtualship/cli/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def plan(path):
8686
"--from-data",
8787
type=str,
8888
default=None,
89-
help="Use pre-downloaded data, saved to disk, for expedition, instead of streaming directly via Copernicus Marine"
90-
"Assumes all data is stored in prescribed directory, and all variables (as listed below) are present."
91-
f"Required variables are: {set(COPERNICUSMARINE_PHYS_VARIABLES + COPERNICUSMARINE_BGC_VARIABLES)}"
92-
"Assumes that variable names at least contain the standard Copernicus Marine variable name as a substring."
89+
help="Use pre-downloaded data, saved to disk, for expedition, instead of streaming directly via Copernicus Marine Service."
90+
"Assumes all data is stored in prescribed directory, and all variables (as listed below) are present. "
91+
f"Required variables are: {set(COPERNICUSMARINE_PHYS_VARIABLES + COPERNICUSMARINE_BGC_VARIABLES)} "
92+
"Assumes that variable names at least contain the standard Copernicus Marine variable name as a substring. "
9393
"Will also take the first file found containing the variable name substring. CAUTION if multiple files contain the same variable name substring.",
9494
)
9595
def run(path, from_data):

0 commit comments

Comments
 (0)