From ac864c987b2d6fcf14f3f4afdbd64e0856b70648 Mon Sep 17 00:00:00 2001 From: Shaivan Bhagat Date: Tue, 3 Nov 2026 12:51:53 +0100 Subject: [PATCH 1/2] Fix CTD transect variable lookup to use dataset column name ctd_build_2d_arrays was passed the display key (e.g. "oxygen") instead of the actual dataset column (ds_name, e.g. "o2"), so plotting any variable other than temperature/salinity/ph failed with a missing-column error. Look up VARIABLES[plot_variable]["ds_name"] so oxygen/nitrate/phosphate/ phytoplankton/primary_production/chlorophyll resolve to o2/no3/po4/phyc/ nppv/chl respectively. --- docs/user-guide/tutorials/CTD_transects.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/tutorials/CTD_transects.ipynb b/docs/user-guide/tutorials/CTD_transects.ipynb index b51e17ee..fc957672 100644 --- a/docs/user-guide/tutorials/CTD_transects.ipynb +++ b/docs/user-guide/tutorials/CTD_transects.ipynb @@ -329,7 +329,7 @@ "ctd_down = ctd_df.filter(pl.col(\"raising\") == 0)\n", "\n", "# build 2D arrays: (n_casts x uniform-depth)\n", - "z_2d, distances, var_2d = ctd_build_2d_arrays(ctd_down, plot_variable)\n", + "z_2d, distances, var_2d = ctd_build_2d_arrays(ctd_down, VARIABLES[plot_variable][\"ds_name\"])\n", "\n", "# 1D depth array from the deepest cast\n", "deepest_idx = np.argmax(np.sum(~np.isnan(z_2d), axis=1))\n", From 036f229dae3a5103e2bdf3f6d5d212b2abd40f13 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 12:03:28 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/user-guide/tutorials/CTD_transects.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/tutorials/CTD_transects.ipynb b/docs/user-guide/tutorials/CTD_transects.ipynb index fc957672..46427b65 100644 --- a/docs/user-guide/tutorials/CTD_transects.ipynb +++ b/docs/user-guide/tutorials/CTD_transects.ipynb @@ -329,7 +329,9 @@ "ctd_down = ctd_df.filter(pl.col(\"raising\") == 0)\n", "\n", "# build 2D arrays: (n_casts x uniform-depth)\n", - "z_2d, distances, var_2d = ctd_build_2d_arrays(ctd_down, VARIABLES[plot_variable][\"ds_name\"])\n", + "z_2d, distances, var_2d = ctd_build_2d_arrays(\n", + " ctd_down, VARIABLES[plot_variable][\"ds_name\"]\n", + ")\n", "\n", "# 1D depth array from the deepest cast\n", "deepest_idx = np.argmax(np.sum(~np.isnan(z_2d), axis=1))\n",