Skip to content

Commit

Permalink
black for jupyter notebooks (regionmask#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Sep 8, 2021
1 parent ec01087 commit 7ff45d6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
13 changes: 7 additions & 6 deletions docs/logo/logo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"outputs": [],
"source": [
"import cartopy\n",
"\n",
"cartopy.__version__"
]
},
Expand Down Expand Up @@ -110,11 +111,11 @@
"outputs": [],
"source": [
"colors = [\n",
" \"#0b713b\", # CH\n",
" \"#edf8b2\", # I\n",
" \"#79c679\", # DE\n",
" \"#bce395\", # FR\n",
" \"#004529\", # AT\n",
" \"#0b713b\", # CH\n",
" \"#edf8b2\", # I\n",
" \"#79c679\", # DE\n",
" \"#bce395\", # FR\n",
" \"#004529\", # AT\n",
"]"
]
},
Expand Down Expand Up @@ -168,7 +169,7 @@
"\n",
"\n",
"plot()\n",
"plt.savefig(\"logo.png\", dpi=150) #, facecolor=\"none\")"
"plt.savefig(\"logo.png\", dpi=150) # , facecolor=\"none\")"
]
},
{
Expand Down
6 changes: 5 additions & 1 deletion docs/notebooks/create_own_regions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@
"mask_ma = np.ma.masked_invalid(mask)\n",
"\n",
"h = ax.pcolormesh(\n",
" lon_edges, lat_edges, mask_ma, transform=ccrs.PlateCarree(), cmap=\"viridis\",\n",
" lon_edges,\n",
" lat_edges,\n",
" mask_ma,\n",
" transform=ccrs.PlateCarree(),\n",
" cmap=\"viridis\",\n",
")\n",
"\n",
"ax.coastlines()\n",
Expand Down
10 changes: 8 additions & 2 deletions docs/notebooks/geopandas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"# turn off pandas html repr:\n",
"# does not gracefully survive the ipynb -> rst -> html conversion\n",
"import pandas as pd\n",
"\n",
"pd.set_option(\"display.notebook_repr_html\", False)"
]
},
Expand Down Expand Up @@ -123,7 +124,9 @@
"source": [
"f, ax = plt.subplots(subplot_kw=dict(projection=ccrs.PlateCarree()))\n",
"mask.plot(\n",
" ax=ax, transform=ccrs.PlateCarree(), add_colorbar=False,\n",
" ax=ax,\n",
" transform=ccrs.PlateCarree(),\n",
" add_colorbar=False,\n",
")\n",
"\n",
"ax.coastlines(color=\"0.1\");"
Expand Down Expand Up @@ -165,7 +168,10 @@
"f, ax = plt.subplots(subplot_kw=dict(projection=ccrs.PlateCarree()))\n",
"\n",
"mask_3D.sel(region=0).plot(\n",
" ax=ax, transform=ccrs.PlateCarree(), add_colorbar=False, cmap=cmap1,\n",
" ax=ax,\n",
" transform=ccrs.PlateCarree(),\n",
" add_colorbar=False,\n",
" cmap=cmap1,\n",
")\n",
"\n",
"ax.coastlines(color=\"0.1\");"
Expand Down
17 changes: 14 additions & 3 deletions docs/notebooks/method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@
"for ax in axes:\n",
"\n",
" ax = region_global.plot(\n",
" ax=ax, line_kws=dict(lw=2, color=\"#b15928\"), add_label=False,\n",
" ax=ax,\n",
" line_kws=dict(lw=2, color=\"#b15928\"),\n",
" add_label=False,\n",
" )\n",
" ax.plot(LON, LAT, \"o\", color=\"0.3\", ms=1, transform=ccrs.PlateCarree(), zorder=5)\n",
"\n",
Expand Down Expand Up @@ -426,7 +428,10 @@
"metadata": {},
"outputs": [],
"source": [
"ax = region_global_2.plot(line_kws=dict(color=\"#b15928\", zorder=3, lw=1), add_label=False,)\n",
"ax = region_global_2.plot(\n",
" line_kws=dict(color=\"#b15928\", zorder=3, lw=1),\n",
" add_label=False,\n",
")\n",
"\n",
"ax.plot(LON, LAT, \"o\", color=\"0.3\", ms=2, transform=ccrs.PlateCarree(), zorder=5)\n",
"\n",
Expand Down Expand Up @@ -467,7 +472,13 @@
"outputs": [],
"source": [
"interior = np.array(\n",
" [[-86.0, 44.0], [-86.0, 34.0], [-94.0, 34.0], [-94.0, 44.0], [-86.0, 44.0],]\n",
" [\n",
" [-86.0, 44.0],\n",
" [-86.0, 34.0],\n",
" [-94.0, 34.0],\n",
" [-94.0, 44.0],\n",
" [-86.0, 44.0],\n",
" ]\n",
")\n",
"\n",
"poly = Polygon(outline, holes=[interior])\n",
Expand Down

0 comments on commit 7ff45d6

Please sign in to comment.