From d50f776dc503cbb8453fce918409868d68652574 Mon Sep 17 00:00:00 2001 From: Shaivan Bhagat Date: Mon, 30 Nov 2026 09:50:12 +0100 Subject: [PATCH 1/3] update tutorials to use polars --- docs/user-guide/assignments/sail_the_ship.md | 2 +- docs/user-guide/quickstart.md | 2 +- docs/user-guide/tutorials/ADCP_transects.ipynb | 6 +++++- docs/user-guide/tutorials/Argo_data_tutorial.ipynb | 7 +++++-- docs/user-guide/tutorials/CTD_transects.ipynb | 6 +++++- docs/user-guide/tutorials/Drifter_data_tutorial.ipynb | 7 +++++-- docs/user-guide/tutorials/xbt_plotting.ipynb | 8 ++++++-- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/docs/user-guide/assignments/sail_the_ship.md b/docs/user-guide/assignments/sail_the_ship.md index 98d9c3a9..983e3d74 100644 --- a/docs/user-guide/assignments/sail_the_ship.md +++ b/docs/user-guide/assignments/sail_the_ship.md @@ -221,7 +221,7 @@ VirtualShip may encounter 'real-life challenges' during the expedition, which si Upon successfully completing the simulation, results from the expedition will be stored in the `EXPEDITION_NAME/results` directory, written in `.parquet` [format](https://parquet.apache.org/). -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! +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/)(`pl.read_parquet()`) and/or [Pandas](https://pandas.pydata.org/)(`pd.read_parquet()`) 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} 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: diff --git a/docs/user-guide/quickstart.md b/docs/user-guide/quickstart.md index 948b3666..2bb193ac 100644 --- a/docs/user-guide/quickstart.md +++ b/docs/user-guide/quickstart.md @@ -210,6 +210,6 @@ See the relevant [documentation](https://virtualship.readthedocs.io/en/latest/us Upon successfully completing the simulation, results from the expedition will be stored in the `EXPEDITION_NAME/results` directory, written in `.parquet` [format](https://parquet.apache.org/). -From here you can carry on your analysis (offline). 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. +From here you can carry on your analysis (offline). 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/)(`pl.read_parquet()`) and/or [Pandas](https://pandas.pydata.org/)(`pd.read_parquet()`) for further data analysis. We also provide various [VirtualShip tutorials](https://virtualship.readthedocs.io/en/latest/user-guide/tutorials/index.html) with further examples of how to visualise data recorded by the VirtualShip instruments. diff --git a/docs/user-guide/tutorials/ADCP_transects.ipynb b/docs/user-guide/tutorials/ADCP_transects.ipynb index d07ecddf..88c7b766 100644 --- a/docs/user-guide/tutorials/ADCP_transects.ipynb +++ b/docs/user-guide/tutorials/ADCP_transects.ipynb @@ -91,7 +91,11 @@ "outputs": [], "source": [ "# load ADCP data\n", - "adcp_df = parcels.read_particlefile(f\"{data_dir}/adcp.parquet\")\n", + "\n", + "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", + "adcp_df = pl.read_parquet(f\"{data_dir}/adcp.parquet\")\n", + "\n", + "# adcp_df = parcels.read_particlefile(f\"{data_dir}/adcp.parquet\") # Using Parcels to read the data file\n", "if len(adcp_df) <= 1:\n", " raise ValueError(\"Number of observations must be > 1\")" ] diff --git a/docs/user-guide/tutorials/Argo_data_tutorial.ipynb b/docs/user-guide/tutorials/Argo_data_tutorial.ipynb index de30d535..8b7df536 100644 --- a/docs/user-guide/tutorials/Argo_data_tutorial.ipynb +++ b/docs/user-guide/tutorials/Argo_data_tutorial.ipynb @@ -80,13 +80,16 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# load argo data\n", "\n", - "argo_df = parcels.read_particlefile(f\"{data_dir}/argo_float.parquet\")" + "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", + "argo_df = pl.read_parquet(f\"{data_dir}/argo_float.parquet\")\n", + "\n", + "# argo_df = parcels.read_particlefile(f\"{data_dir}/argo_float.parquet\") Using Parcels to read the data file" ] }, { diff --git a/docs/user-guide/tutorials/CTD_transects.ipynb b/docs/user-guide/tutorials/CTD_transects.ipynb index 46427b65..8574e163 100644 --- a/docs/user-guide/tutorials/CTD_transects.ipynb +++ b/docs/user-guide/tutorials/CTD_transects.ipynb @@ -195,7 +195,11 @@ "outputs": [], "source": [ "# load CTD data\n", - "ctd_df = parcels.read_particlefile(f\"{data_dir}/ctd.parquet\")\n", + "\n", + "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", + "ctd_df = pl.read_parquet(f\"{data_dir}/ctd.parquet\")\n", + "\n", + "# ctd_df = parcels.read_particlefile(f\"{data_dir}/ctd.parquet\") # Using Parcels to read the data file\n", "if np.unique(ctd_df[\"particle_id\"]).size <= 1:\n", " raise ValueError(\"Number of waypoints must be > 1\")" ] diff --git a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb index 97b72905..c5e6c3ac 100755 --- a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb +++ b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb @@ -86,13 +86,16 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# load drifter data\n", "\n", - "drifter_df = parcels.read_particlefile(f\"{data_dir}/drifter.parquet\")" + "# Using Polars to read the data file (quicker option for most cases). You can also use pandas instead.\n", + "drifter_df = pl.read_parquet(f\"{data_dir}/drifter.parquet\")\n", + "\n", + "# drifter_df = parcels.read_particlefile(f\"{data_dir}/drifter.parquet\") Using Parcels to read the data file" ] }, { diff --git a/docs/user-guide/tutorials/xbt_plotting.ipynb b/docs/user-guide/tutorials/xbt_plotting.ipynb index 4dfc17be..506bbd0c 100644 --- a/docs/user-guide/tutorials/xbt_plotting.ipynb +++ b/docs/user-guide/tutorials/xbt_plotting.ipynb @@ -82,13 +82,17 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "18ea91b0", "metadata": {}, "outputs": [], "source": [ "# load argo data\n", - "xbt_df = parcels.read_particlefile(f\"{data_dir}/xbt.parquet\")" + "\n", + "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", + "xbt_df = pl.read_parquet(f\"{data_dir}/xbt.parquet\")\n", + "\n", + "# xbt_df = parcels.read_particlefile(f\"{data_dir}/xbt.parquet\") Using Parcels to read the data file" ] }, { From f2327138ad27584b69ddc52452872f4f50389f18 Mon Sep 17 00:00:00 2001 From: Shaivan Bhagat Date: Mon, 30 Nov 2026 09:56:50 +0100 Subject: [PATCH 2/3] make drifter consistent with rest of changes --- docs/user-guide/tutorials/Drifter_data_tutorial.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb index c5e6c3ac..885ed516 100755 --- a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb +++ b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb @@ -92,7 +92,7 @@ "source": [ "# load drifter data\n", "\n", - "# Using Polars to read the data file (quicker option for most cases). You can also use pandas instead.\n", + "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", "drifter_df = pl.read_parquet(f\"{data_dir}/drifter.parquet\")\n", "\n", "# drifter_df = parcels.read_particlefile(f\"{data_dir}/drifter.parquet\") Using Parcels to read the data file" From ebd04a5172c94c4d3648fbe896e5e6d5eabf8949 Mon Sep 17 00:00:00 2001 From: Shaivan Bhagat Date: Mon, 30 Nov 2026 11:22:41 +0100 Subject: [PATCH 3/3] revise tutorials to pandas --- docs/user-guide/tutorials/ADCP_transects.ipynb | 7 ++++--- docs/user-guide/tutorials/Argo_data_tutorial.ipynb | 7 ++++--- docs/user-guide/tutorials/CTD_transects.ipynb | 7 ++++--- docs/user-guide/tutorials/Drifter_data_tutorial.ipynb | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/user-guide/tutorials/ADCP_transects.ipynb b/docs/user-guide/tutorials/ADCP_transects.ipynb index 88c7b766..79504902 100644 --- a/docs/user-guide/tutorials/ADCP_transects.ipynb +++ b/docs/user-guide/tutorials/ADCP_transects.ipynb @@ -44,7 +44,8 @@ "from matplotlib import pyplot as plt\n", "import xarray as xr\n", "import polars as pl\n", - "import parcels" + "import parcels\n", + "import pandas as pd" ] }, { @@ -92,8 +93,8 @@ "source": [ "# load ADCP data\n", "\n", - "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", - "adcp_df = pl.read_parquet(f\"{data_dir}/adcp.parquet\")\n", + "# Using Pandas to read the data file (suitable option for most cases). You can also use Parcels or Polars instead.\n", + "adcp_df = pd.read_parquet(f\"{data_dir}/adcp.parquet\")\n", "\n", "# adcp_df = parcels.read_particlefile(f\"{data_dir}/adcp.parquet\") # Using Parcels to read the data file\n", "if len(adcp_df) <= 1:\n", diff --git a/docs/user-guide/tutorials/Argo_data_tutorial.ipynb b/docs/user-guide/tutorials/Argo_data_tutorial.ipynb index 8b7df536..bdaa761a 100644 --- a/docs/user-guide/tutorials/Argo_data_tutorial.ipynb +++ b/docs/user-guide/tutorials/Argo_data_tutorial.ipynb @@ -30,12 +30,13 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import parcels\n", "import polars as pl\n", + "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import cartopy.crs as ccrs\n", @@ -86,8 +87,8 @@ "source": [ "# load argo data\n", "\n", - "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", - "argo_df = pl.read_parquet(f\"{data_dir}/argo_float.parquet\")\n", + "# Using Pandas to read the data file (suitable option for most cases). You can also use Parcels or Polars instead.\n", + "argo_df = pd.read_parquet(f\"{data_dir}/argo_float.parquet\")\n", "\n", "# argo_df = parcels.read_particlefile(f\"{data_dir}/argo_float.parquet\") Using Parcels to read the data file" ] diff --git a/docs/user-guide/tutorials/CTD_transects.ipynb b/docs/user-guide/tutorials/CTD_transects.ipynb index 8574e163..75834e18 100644 --- a/docs/user-guide/tutorials/CTD_transects.ipynb +++ b/docs/user-guide/tutorials/CTD_transects.ipynb @@ -47,7 +47,8 @@ "import numpy as np\n", "from matplotlib import pyplot as plt\n", "import polars as pl\n", - "import parcels" + "import parcels\n", + "import pandas as pd" ] }, { @@ -196,8 +197,8 @@ "source": [ "# load CTD data\n", "\n", - "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", - "ctd_df = pl.read_parquet(f\"{data_dir}/ctd.parquet\")\n", + "# Using Pandas to read the data file (suitable option for most cases). You can also use Parcels or Polars instead.\n", + "ctd_df = pd.read_parquet(f\"{data_dir}/ctd.parquet\")\n", "\n", "# ctd_df = parcels.read_particlefile(f\"{data_dir}/ctd.parquet\") # Using Parcels to read the data file\n", "if np.unique(ctd_df[\"particle_id\"]).size <= 1:\n", diff --git a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb index 885ed516..34dae0fe 100755 --- a/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb +++ b/docs/user-guide/tutorials/Drifter_data_tutorial.ipynb @@ -28,12 +28,13 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import parcels\n", "import polars as pl\n", + "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import cmocean.cm as cmo\n", "import numpy as np\n", @@ -92,8 +93,8 @@ "source": [ "# load drifter data\n", "\n", - "# Using Polars to read the data file (quicker option for most cases). You can also use Parcels or pandas instead.\n", - "drifter_df = pl.read_parquet(f\"{data_dir}/drifter.parquet\")\n", + "# Using Pandas to read the data file (suitable option for most cases). You can also use Parcels or Polars instead.\n", + "drifter_df = pd.read_parquet(f\"{data_dir}/drifter.parquet\")\n", "\n", "# drifter_df = parcels.read_particlefile(f\"{data_dir}/drifter.parquet\") Using Parcels to read the data file" ]