Skip to content

Commit

Permalink
Add clean_notebook to pre-commit (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 authored Oct 25, 2023
1 parent 0af4cd6 commit 5eb4b22
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 93 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ repos:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/hoxbro/clean_notebook
rev: v0.1.13
hooks:
- id: clean-notebook

ci:
autofix_prs: false
51 changes: 10 additions & 41 deletions examples/tiling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from datashader.tiles import render_tiles"
Expand Down Expand Up @@ -73,9 +71,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
Expand Down Expand Up @@ -106,9 +102,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import datashader as ds\n",
Expand All @@ -133,9 +127,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import datashader.transfer_functions as tf\n",
Expand All @@ -160,9 +152,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from PIL import ImageDraw\n",
Expand All @@ -184,9 +174,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"full_extent_of_data = (-500000, -500000, 500000, 500000)\n",
Expand Down Expand Up @@ -224,9 +212,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from bokeh.plotting import figure\n",
Expand Down Expand Up @@ -302,9 +288,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"full_extent_of_data = (int(-20e6), int(-20e6), int(20e6), int(20e6))\n",
Expand All @@ -331,9 +315,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"xmin, ymin, xmax, ymax = full_extent_of_data\n",
Expand All @@ -352,22 +334,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.5"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
16 changes: 1 addition & 15 deletions examples/user_guide/11_Geography.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -22,22 +21,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.10"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
17 changes: 1 addition & 16 deletions examples/user_guide/12_Inspection_Reductions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -228,7 +227,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -246,22 +244,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
15 changes: 1 addition & 14 deletions examples/user_guide/2_Points.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.10"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
7 changes: 0 additions & 7 deletions examples/user_guide/7_Networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,6 @@
"<!-- def circle(r,n): return [(math.cos(2*math.pi/n*x)*r,math.sin(2*math.pi/n*x)*r) for x in range(0,n)] -->"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 5eb4b22

Please sign in to comment.