Skip to content

Commit c9d7bff

Browse files
authored
Merge pull request #25099 from dstansby/isort
Add isort (import sorting) to pre-commit hooks
2 parents af8a046 + 18b9eb8 commit c9d7bff

File tree

436 files changed

+846
-620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

436 files changed

+846
-620
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ repos:
4141
"--skip",
4242
"doc/users/project/credits.rst"
4343
]
44+
45+
- repo: https://github.com/pycqa/isort
46+
rev: 5.12.0
47+
hooks:
48+
- id: isort
49+
name: isort (python)
50+
files: ^tutorials/|^examples/

examples/animation/animate_decay.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
import itertools
1515

16-
import numpy as np
1716
import matplotlib.pyplot as plt
17+
import numpy as np
18+
1819
import matplotlib.animation as animation
1920

2021

examples/animation/animated_histogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
histogram.
88
"""
99

10+
import matplotlib.pyplot as plt
1011
import numpy as np
1112

12-
import matplotlib.pyplot as plt
1313
import matplotlib.animation as animation
1414

1515
# Fixing random state for reproducibility

examples/animation/bayes_update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
import math
1515

16-
import numpy as np
1716
import matplotlib.pyplot as plt
17+
import numpy as np
18+
1819
from matplotlib.animation import FuncAnimation
1920

2021

examples/animation/double_pendulum.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1212
"""
1313

14-
from numpy import sin, cos
15-
import numpy as np
14+
from collections import deque
15+
1616
import matplotlib.pyplot as plt
17+
import numpy as np
18+
from numpy import cos, sin
19+
1720
import matplotlib.animation as animation
18-
from collections import deque
1921

2022
G = 9.8 # acceleration due to gravity, in m/s^2
2123
L1 = 1.0 # length of pendulum 1 in m

examples/animation/dynamic_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
Output generate via `matplotlib.animation.Animation.to_jshtml`.
77
"""
88

9-
import numpy as np
109
import matplotlib.pyplot as plt
10+
import numpy as np
11+
1112
import matplotlib.animation as animation
1213

1314
fig, ax = plt.subplots()

examples/animation/frame_grabbing_sgskip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
"""
1212

1313
import numpy as np
14+
1415
import matplotlib
16+
1517
matplotlib.use("Agg")
1618
import matplotlib.pyplot as plt
19+
1720
from matplotlib.animation import FFMpegWriter
1821

1922
# Fixing random state for reproducibility

examples/animation/multiple_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1212
"""
1313

14-
import numpy as np
1514
import matplotlib.pyplot as plt
15+
import numpy as np
16+
1617
import matplotlib.animation as animation
1718
from matplotlib.patches import ConnectionPatch
1819

examples/animation/pause_resume.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
"""
2121

2222
import matplotlib.pyplot as plt
23-
import matplotlib.animation as animation
2423
import numpy as np
2524

25+
import matplotlib.animation as animation
26+
2627

2728
class PauseAnimation:
2829
def __init__(self):

examples/animation/rain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1212
"""
1313

14-
import numpy as np
1514
import matplotlib.pyplot as plt
15+
import numpy as np
16+
1617
from matplotlib.animation import FuncAnimation
1718

1819
# Fixing random state for reproducibility

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy