Skip to content

Module 3: Code

Opened Thursday 26 November 2026. Done 29 November 2026, certificate issued by HUB Ocean.

Ready-made notebooks in an ODP Workspace, in Python or R. Alongside the lessons I wanted to test how an ODP notebook can be versioned, cited and archived, so that an analysis made on the platform can be found and rerun later.

What came out of it: (i) three notebooks of my own, all in this repository and run in an ODP Workspace; (ii) three tutorials, below; (iii) my Module 2 layers as a dataset on Zenodo, doi:10.5281/zenodo.24659418, cited from the dataset on ODP.

Tutorial What it covers
From an ODP Workspace to QGIS Starting a Small Workspace, a first notebook, the layers into QGIS
Reading and writing ODP data for my own area stats, schema, select, aggregate, and writing a table back, for the Wild Coast
Lab 3, step by step The group dataset, my own dataset, the map, and species records with an AI helper

Open your Workspace

29 November 2026. The Small Workspace opened, after my access request came through.

To check it from code, I wrote module3_open_workspace.ipynb. It runs from any Workspace folder, and it does five things:

  1. Checks that this is the Small environment, with odp-sdk and pyarrow already installed (nothing to pip install).
  2. Signs in to ODP with no API key, as a Workspace allows.
  3. Opens my Module 2 dataset, Wild Coast seafloor and protected areas (Group 21 - Linda), and lists its files and table. It has none yet, and it is in review by the HUB Ocean admins.
  4. Reads the five layers the dataset describes from this repository and maps them: my place, 23 protected-area zones, and the seamounts, canyons and shelf.
  5. Saves them as one GeoPackage for QGIS. An optional last cell attaches them to the dataset; it stays off until the review is done.

Step by step, with what went wrong and how I fixed it: Tutorial: from an ODP Workspace to QGIS.

The same layers in QGIS (QGIS/QGIS-exo3.qgz, kept local):

QGIS: the Wild Coast shelf, canyons and protected areas, with my place off Port St Johns in red Data: GSFM, GRID-Arendal (CC BY 4.0), Harris et al. 2014; ProtectedSeas Navigator V2 (CC BY 4.0); both via the Ocean Data Platform.

Pulling your first data (Python)

29 November 2026. The course notebook reads and writes ODP data for Tanzania and Unguja. I took the same steps to the Wild Coast and my Lab 2 place, and wrote my Module 2 layers back as one 50-row table: Tutorial: reading and writing ODP data for my own area. Quiz done.

Lab 3: Our places together

29 November 2026. Group 21's shared dataset, Group 21 - all places, made and in the group's collection; my own dataset fixed to hold only my place, the Port St Johns canyons; my Module 2 layers on Zenodo, doi:10.5281/zenodo.24659418. How, and the mistakes on the way: Tutorial: Lab 3, step by step.

Optional: Code with an AI helper

29 November 2026. With the course's helper file for AI assistants, Claude Code wrote lab3_ai_helper_obis_species.ipynb. Run in my Workspace, it put 4,071 OBIS species records of 762 taxa, from inside my place, into a new ODP dataset, Group 21 - Linda - species, with column descriptions, description, tags, licence (CC BY-NC 4.0, the strictest of the sources kept) and citation. 101 records from a source marked Restricted are left out.

OBIS records inside the Port St Johns canyons: dense in the inshore north-west corner, sparse offshore Data: OBIS (obis.org), 29 November 2026.