Skip to content

Commit

Permalink
add black_nbconvert to pre-commit hooks (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan authored Aug 24, 2021
1 parent 2b6622a commit ca0037f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ repos:
hooks:
- id: black

- repo: https://github.com/dfm/black_nbconvert
rev: v0.3.0
hooks:
- id: black_nbconvert

- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
hooks:
Expand Down
22 changes: 13 additions & 9 deletions docs/notebooks/plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"outputs": [],
"source": [
"model = sme.open_example_model()\n",
"fig = plt.figure(figsize=(16,8))\n",
"fig = plt.figure(figsize=(16, 8))\n",
"plt.imshow(model.compartment_image)\n",
"plt.title(\"Compartment geometry image\")\n",
"plt.show()\n",
"results = model.simulate(100, 100)\n",
"species = ['B_out', 'B_cell']"
"species = [\"B_out\", \"B_cell\"]"
]
},
{
Expand All @@ -63,7 +63,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure(figsize=(16,8))\n",
"fig = plt.figure(figsize=(16, 8))\n",
"smeplot.concentration_heatmap(results[-1], species)\n",
"plt.show()"
]
Expand All @@ -81,8 +81,8 @@
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure(figsize=(16,8))\n",
"smeplot.concentration_heatmap(results[-1], species, cmap='flag')\n",
"fig = plt.figure(figsize=(16, 8))\n",
"smeplot.concentration_heatmap(results[-1], species, cmap=\"flag\")\n",
"plt.show()"
]
},
Expand All @@ -101,7 +101,7 @@
"source": [
"# make a black -> green colormap using sme_contrib.plot.colormap:\n",
"cmap = smeplot.colormap(\"#00ff00\")\n",
"fig = plt.figure(figsize=(16,8))\n",
"fig = plt.figure(figsize=(16, 8))\n",
"smeplot.concentration_heatmap(results[-1], species, cmap=cmap)\n",
"plt.show()"
]
Expand All @@ -119,9 +119,13 @@
"metadata": {},
"outputs": [],
"source": [
"fig, (ax_l, ax_r) = plt.subplots(nrows=1, ncols=2, figsize=(16,6))\n",
"ax_l, im_l = smeplot.concentration_heatmap(results[-1], ['B_cell'], cmap=smeplot.colormap(\"#00ff00\"), ax=ax_l)\n",
"ax_r, im_r = smeplot.concentration_heatmap(results[-1], ['B_out'], cmap=smeplot.colormap(\"#ff00ff\"), ax=ax_r)\n",
"fig, (ax_l, ax_r) = plt.subplots(nrows=1, ncols=2, figsize=(16, 6))\n",
"ax_l, im_l = smeplot.concentration_heatmap(\n",
" results[-1], [\"B_cell\"], cmap=smeplot.colormap(\"#00ff00\"), ax=ax_l\n",
")\n",
"ax_r, im_r = smeplot.concentration_heatmap(\n",
" results[-1], [\"B_out\"], cmap=smeplot.colormap(\"#ff00ff\"), ax=ax_r\n",
")\n",
"fig.colorbar(im_l, ax=ax_l)\n",
"fig.colorbar(im_r, ax=ax_r)\n",
"plt.show()"
Expand Down

0 comments on commit ca0037f

Please sign in to comment.