From 447241c6f85425d12e011eee19f01ec1099fb326 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Fri, 20 Sep 2024 11:54:38 -0600 Subject: [PATCH] Make pretty --- examples/README.ipynb | 4 +- examples/bmi-topography.ipynb | 98 +++++++++++++++++------------------ examples/topography.ipynb | 30 +++++------ 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/examples/README.ipynb b/examples/README.ipynb index 004b940..e57da47 100644 --- a/examples/README.ipynb +++ b/examples/README.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "8e3d936a-be52-413e-b714-8f1eba301d21", + "id": "0", "metadata": {}, "source": [ "# Examples: bmi-topography" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "0bfc1e88-64f6-46b0-bf7d-ecb2487fae9c", + "id": "1", "metadata": {}, "source": [ "Here are a few examples of using the Topography data component,\n", diff --git a/examples/bmi-topography.ipynb b/examples/bmi-topography.ipynb index 100696f..982b0ca 100644 --- a/examples/bmi-topography.ipynb +++ b/examples/bmi-topography.ipynb @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "4", + "id": "3", "metadata": {}, "source": [ "Import a pair of libraries for later use:" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "5", "metadata": {}, "source": [ "## Fetch and load data" @@ -54,7 +54,7 @@ }, { "cell_type": "markdown", - "id": "7", + "id": "6", "metadata": {}, "source": [ "Import the `BmiTopography` class from the `bmi-topography` package:" @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -72,7 +72,7 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "8", "metadata": {}, "source": [ "Create an instance of this class." @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -90,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "11", + "id": "10", "metadata": {}, "source": [ "Calling `help` on the instance displays all the BMI methods that are available." @@ -99,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -108,7 +108,7 @@ }, { "cell_type": "markdown", - "id": "13", + "id": "12", "metadata": {}, "source": [ "The first step in using a BMI is calling the `initialize` method.\n", @@ -120,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +130,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "16", + "id": "15", "metadata": {}, "source": [ "Call `initialize` with the sample configuration file." @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ }, { "cell_type": "markdown", - "id": "18", + "id": "17", "metadata": {}, "source": [ "This step may take a moment, as the `Topography` library fetches and downloads the data from the internet.\n", @@ -168,7 +168,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -177,7 +177,7 @@ }, { "cell_type": "markdown", - "id": "20", + "id": "19", "metadata": {}, "source": [ "## Access data through the BMI" @@ -185,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "20", "metadata": {}, "source": [ "Now that we've fetched the data, let's access it through the BMI.\n", @@ -198,7 +198,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "23", + "id": "22", "metadata": {}, "source": [ "The (long) name for the variable representing elevation is an instance of a [CSDMS Standard Name](https://csdms.colorado.edu/wiki/CSDMS_Standard_Names).\n", @@ -216,7 +216,7 @@ }, { "cell_type": "markdown", - "id": "24", + "id": "23", "metadata": {}, "source": [ "Find the data type of the elevation data." @@ -225,7 +225,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ }, { "cell_type": "markdown", - "id": "26", + "id": "25", "metadata": {}, "source": [ "Within the BMI, functions that describe the grids that variables are defined on take an index instead of a variable name.\n", @@ -246,7 +246,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -256,7 +256,7 @@ }, { "cell_type": "markdown", - "id": "28", + "id": "27", "metadata": {}, "source": [ "Then find the total size of the elevation data." @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -275,7 +275,7 @@ }, { "cell_type": "markdown", - "id": "30", + "id": "29", "metadata": {}, "source": [ "Next, get the elevation values.\n", @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "32", + "id": "31", "metadata": {}, "source": [ "Get the elevation data." @@ -310,7 +310,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "34", + "id": "33", "metadata": {}, "source": [ "Note that the elevation array is one-dimensional." @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "36", + "id": "35", "metadata": {}, "source": [ "### Reshape data" @@ -345,7 +345,7 @@ }, { "cell_type": "markdown", - "id": "37", + "id": "36", "metadata": {}, "source": [ "Like all BMI arrays, the elevations returned from the BMI `get_value` function are flattened.\n", @@ -354,7 +354,7 @@ }, { "cell_type": "markdown", - "id": "38", + "id": "37", "metadata": {}, "source": [ "First, determine the dimensionality of the elevation variable." @@ -363,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -373,7 +373,7 @@ }, { "cell_type": "markdown", - "id": "40", + "id": "39", "metadata": {}, "source": [ "Get the dimensions of the elevation data, first creating an array to store their values." @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41", + "id": "40", "metadata": {}, "outputs": [], "source": [ @@ -393,7 +393,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "43", + "id": "42", "metadata": {}, "source": [ "Reshape the elevation data, creating a new array." @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "44", + "id": "43", "metadata": {}, "outputs": [], "source": [ @@ -421,7 +421,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "46", + "id": "45", "metadata": {}, "source": [ "## Visualize" @@ -438,7 +438,7 @@ }, { "cell_type": "markdown", - "id": "47", + "id": "46", "metadata": {}, "source": [ "Let's visualize the elevation data as an image." @@ -447,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48", + "id": "47", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ }, { "cell_type": "markdown", - "id": "49", + "id": "48", "metadata": {}, "source": [ "## Conclusion" @@ -464,7 +464,7 @@ }, { "cell_type": "markdown", - "id": "50", + "id": "49", "metadata": {}, "source": [ "Last, call the BMI `finalize` function." @@ -473,7 +473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51", + "id": "50", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ }, { "cell_type": "markdown", - "id": "52", + "id": "51", "metadata": {}, "source": [ "This demonstration of the BMI took a lot of code to reproduce a simple result.\n", diff --git a/examples/topography.ipynb b/examples/topography.ipynb index 1d7b9e8..f69b33a 100644 --- a/examples/topography.ipynb +++ b/examples/topography.ipynb @@ -19,7 +19,7 @@ }, { "cell_type": "markdown", - "id": "4", + "id": "2", "metadata": {}, "source": [ "## Fetch and load data" @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "3", "metadata": {}, "source": [ "Import the `Topography` class from the `bmi-topography` package:" @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "7", + "id": "5", "metadata": {}, "source": [ "`Topography` downloads and stores SRTM data through the [OpenTopography](https://opentopography.org/) [REST API](https://portal.opentopography.org/apidocs/#/Public/getGlobalDem). OpenTopography is an NSF-supported project that provides open access to high-resolution topography data and services." @@ -53,7 +53,7 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "6", "metadata": {}, "source": [ "Create an instance of `Topography` using parameters to describe\n", @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "8", "metadata": {}, "source": [ "While this step sets up a call to the OpenTopography API, it doesn't download the data. Download the data by calling the `fetch` method:" @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "10", "metadata": {}, "source": [ "This step may take a few moments to run while the data are fetched from OpenTopography and downloaded." @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "13", + "id": "11", "metadata": {}, "source": [ "The `fetch` method only downloads data; it doesn't load it into memory. Call the `load` method to open the downloaded file and load it into an `xarray` DataArray:" @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "markdown", - "id": "15", + "id": "13", "metadata": {}, "source": [ "Note that `load` calls `fetch`, so the latter can be omitted if the goal is the get the data into memory." @@ -140,7 +140,7 @@ }, { "cell_type": "markdown", - "id": "16", + "id": "14", "metadata": {}, "source": [ "## Visualize" @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "17", + "id": "15", "metadata": {}, "source": [ "Finally, let's visualize the downloaded elevation data." @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "16", "metadata": {}, "outputs": [], "source": [