Skip to content

Commit

Permalink
docs: rerun notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Jun 14, 2024
1 parent fd2e768 commit c5fe426
Show file tree
Hide file tree
Showing 15 changed files with 1,419 additions and 2,589 deletions.
24 changes: 17 additions & 7 deletions docs/gallery/3D_stack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:52:32.842409Z",
Expand All @@ -26,6 +26,7 @@
"\n",
"# set Python's logging level to get information\n",
"import logging\n",
"import os\n",
"\n",
"import pyogrio\n",
"\n",
Expand All @@ -34,6 +35,16 @@
"logging.getLogger().setLevel(logging.INFO)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# set default to southern hemisphere for this notebook\n",
"os.environ[\"POLARTOOLKIT_HEMISPHERE\"] = \"south\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -43,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:52:35.866303Z",
Expand Down Expand Up @@ -83,7 +94,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:52:46.142537Z",
Expand Down Expand Up @@ -134,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:52:57.331904Z",
Expand All @@ -153,7 +164,7 @@
"<POLYGON ((-567296.694 -960693.399, -571417.813 -946194.579, -566583.657 -93...>"
]
},
"execution_count": 4,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -177,7 +188,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:52:57.455008Z",
Expand Down Expand Up @@ -215,7 +226,6 @@
" transparencies=[0, 30, 20],\n",
" cpt_lims=[(-1000, -200), (-600, 0), (0, 500)],\n",
" grd2cpt=False,\n",
" hemisphere=\"south\",\n",
")\n",
"fig.show()"
]
Expand Down
27 changes: 20 additions & 7 deletions docs/gallery/basic_map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,21 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import os\n",
"\n",
"from polartoolkit import fetch, maps, regions"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# set default to southern hemisphere for this notebook\n",
"os.environ[\"POLARTOOLKIT_HEMISPHERE\"] = \"south\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -45,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:09.263668Z",
Expand All @@ -72,7 +84,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:11.807964Z",
Expand Down Expand Up @@ -114,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:13.086134Z",
Expand Down Expand Up @@ -146,7 +158,7 @@
")\n",
"\n",
"# add the coastline and groundingline\n",
"maps.add_coast(fig, hemisphere=\"south\")\n",
"maps.add_coast(fig)\n",
"\n",
"fig.show()"
]
Expand All @@ -160,7 +172,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:16.338253Z",
Expand All @@ -175,7 +187,9 @@
"output_type": "stream",
"text": [
"grd2cpt [ERROR]: Making a continuous cpt from a discrete cpt may give unexpected results!\n",
"gmtset [WARNING]: Representation of font type not recognized. Using default.\n"
"gmtset [WARNING]: Representation of font type not recognized. Using default.\n",
"/home/mdtanker/polartoolkit/src/polartoolkit/maps.py:839: UserWarning: getting max/min values from grid, if cpt_lims were used to create the colorscale, histogram will not properly align with colorbar!\n",
" add_colorbar(\n"
]
},
{
Expand Down Expand Up @@ -212,7 +226,6 @@
" y_spacing=2, # latitude interval (degrees)\n",
" hist=True, # add a histogram to the colorbar\n",
" hist_bin_num=100, # 100 bins\n",
" hemisphere=\"south\",\n",
")\n",
"\n",
"# display the figure\n",
Expand Down
42 changes: 22 additions & 20 deletions docs/gallery/colormaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import os\n",
"from pathlib import Path\n",
"\n",
"import geopandas as gpd\n",
Expand All @@ -42,6 +43,16 @@
"from polartoolkit import fetch, maps, regions, utils"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# set default to southern hemisphere for this notebook\n",
"os.environ[\"POLARTOOLKIT_HEMISPHERE\"] = \"south\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -51,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:09.263668Z",
Expand All @@ -77,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -107,7 +118,6 @@
"\n",
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"test.cpt\", # use created colormap\n",
Expand All @@ -121,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -160,7 +170,6 @@
"\n",
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"test.cpt\", # use created colormap\n",
Expand All @@ -181,7 +190,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:11.807964Z",
Expand Down Expand Up @@ -209,7 +218,6 @@
"source": [
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
")\n",
Expand All @@ -226,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -247,7 +255,6 @@
"source": [
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"rain\", # change the colormap\n",
Expand All @@ -273,7 +280,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2024-02-09T04:53:13.086134Z",
Expand Down Expand Up @@ -301,7 +308,6 @@
"source": [
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"matter\",\n",
Expand All @@ -321,7 +327,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -342,7 +348,6 @@
"source": [
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"matter\",\n",
Expand All @@ -362,7 +367,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -385,7 +390,6 @@
"\n",
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"matter\",\n",
Expand All @@ -408,7 +412,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -438,7 +442,6 @@
"\n",
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"matter\",\n",
Expand All @@ -465,15 +468,15 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"grd2cpt [ERROR]: Making a continuous cpt from a discrete cpt may give unexpected results!\n",
"/home/mdtanker/polartoolkit/src/polartoolkit/maps.py:831: UserWarning: getting max/min values from grid, if cpt_lims were used to create the colorscale, histogram will not properly align with colorbar!\n",
"/home/mdtanker/polartoolkit/src/polartoolkit/maps.py:839: UserWarning: getting max/min values from grid, if cpt_lims were used to create the colorscale, histogram will not properly align with colorbar!\n",
" add_colorbar(\n"
]
},
Expand All @@ -495,7 +498,6 @@
"source": [
"fig = maps.plot_grd(\n",
" bed,\n",
" hemisphere=\"south\",\n",
" inset=True,\n",
" hist=True,\n",
" cmap=\"matter\",\n",
Expand Down
Loading

0 comments on commit c5fe426

Please sign in to comment.