Skip to content

Commit

Permalink
Merge pull request #721 from jarrodmillman/pre-commit-update
Browse files Browse the repository at this point in the history
Update pre-commit repos
  • Loading branch information
jarrodmillman authored Feb 23, 2024
2 parents 632dc46 + 18b5120 commit 271064b
Show file tree
Hide file tree
Showing 41 changed files with 49 additions and 15 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
87566f51031ddd54e2f3020bb62d7bf85289e408
7cb7b365c51ab20d92745e5eefb95690e3ba2e14
67c4efab4e3ec1dc16c18b9ab8c5cd5f375040e0
8d00b416689c428b2bafdaad61ed3ec660ca06c2
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # v4.4.0
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -19,36 +19,36 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: efd8b1e16f05132acf6edcf2827eeab21e0e00db # frozen: v3.0.0
rev: ffb6a759a979008c0e6dff86e39f4745a2d9eac4 # frozen: v3.1.0
hooks:
- id: prettier
files: \.(md|rst|yml|yaml)
args: [--prose-wrap=preserve]

- repo: https://github.com/psf/black
rev: 193ee766ca496871f93621d6b58d57a6564ff81b # frozen: 23.7.0
rev: 6fdf8a4af28071ed1d079c01122b34c5d587207a # frozen: 24.2.0
hooks:
- id: black

- repo: https://github.com/adamchainz/blacken-docs
rev: 2e74dc4c30c336176e76e0426c66f09a4e79df9c # frozen: 1.15.0
rev: 960ead214cd1184149d366c6d27ca6c369ce46b6 # frozen: 1.16.0
hooks:
- id: blacken-docs

- repo: https://github.com/MarcoGorelli/cython-lint
rev: 0d4704ff7d75ad487dcde6947c628be824060184 # frozen: v0.15.0
rev: 582556b052c898dc484a981bea48de3284a4b8ee # frozen: v0.16.0
hooks:
- id: cython-lint
args: [--no-pycodestyle, --max-line-length=88]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: ade96e24aa3fa43c9d9b50d6cccae93d82765f40 # frozen: v0.0.282
rev: cc575a3e5800b42ffbb5182b53d87203b2c4fc26 # frozen: v0.2.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/codespell-project/codespell
rev: "355e50e14fd03fe83e4ed9aa0489824b150b3b58" # frozen: v2.2.5
rev: "6e41aba91fb32e9feb741a6258eefeb9c6e4a482" # frozen: v2.2.6
hooks:
- id: codespell
args: ["-w", "-L", "ans,nd,sav,mke,ags,mot,coo,whos"]
args: ["-w", "-L", "ans,nd,sav,mke,ags,mot,coo,whos,manuel"]
1 change: 1 addition & 0 deletions advanced/advanced_numpy/examples/plots/plot_maskedstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot a masked statistics
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions advanced/debugging/to_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ridder: 778394 total function calls
bisect: 2148380 total function calls
"""

from itertools import product

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions advanced/debugging/to_debug_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ridder: 778394 total function calls
bisect: 2148380 total function calls
"""

from itertools import product

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions advanced/image_processing/examples/plot_display_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
An example that displays a raccoon face with matplotlib.
"""

import scipy as sp
import matplotlib.pyplot as plt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Comparison of optimizers on various problems.
"""

import functools
import pickle
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Example cost functions or objective functions to optimize.
"""

import numpy as np

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
A small figure explaining optimization with constraints
"""

import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
first term in simply 2 * K.T @ K. Thus the conditioning of the
problem can be judged from looking at the conditioning of K.
"""

import time

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
An example demoing gradient descent by creating figures that trace the
evolution of the optimizer.
"""

import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
Expand Down
1 change: 1 addition & 0 deletions advanced/mathematical_optimization/examples/plot_noisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Draws a figure explaining noisy vs non-noisy optimization
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
An example showing how to do optimization with general constraints using
SLSQP and cobyla.
"""

import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
Expand Down
1 change: 1 addition & 0 deletions advanced/mathematical_optimization/examples/plot_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Draws a figure to explain smooth versus non smooth optimization.
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions advanced/scipy_sparse/examples/direct_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
to CSR format and solve A x = b for x:and solve a linear system with a
direct solver.
"""

import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def __init__(self, **options):
}%
\makeatother%
\newpage\newpage
"""
""",
# 'tableofcontents': '\\pagestyle{normal}\\pagenumbering{arabic} %\\tableofcontents',
}

Expand Down
4 changes: 2 additions & 2 deletions intro/language/oop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Python supports object-oriented programming (OOP). The goals of OOP are:

* to organize the code, and

* to re-use code in similar contexts.
* to reuse code in similar contexts.


Here is a small example: we create a Student *class*, which is an object
Expand Down Expand Up @@ -52,6 +52,6 @@ Thanks to classes and object-oriented programming, we can organize code
with different classes corresponding to different objects we encounter
(an Experiment class, an Image class, a Flow class, etc.), with their own
methods and attributes. Then we can use inheritance to consider
variations around a base class and **re-use** code. Ex : from a Flow
variations around a base class and **reuse** code. Ex : from a Flow
base class, we can create derived StokesFlow, TurbulentFlow,
PotentialFlow, etc.
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_basic1dplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot a basic 1D figure
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_basic2dplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot a basic 2D figure
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_chebyfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot noisy data and their polynomial fit in a Chebyshev basis
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot distances in a grid
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_elephant.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Read and write images
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_mandelbrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Compute the Mandelbrot fractal and plot it
"""

import numpy as np
import matplotlib.pyplot as plt
from numpy import newaxis
Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_polyfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot noisy data and their polynomial fit
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_populations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Plot populations of hares, lynxes, and carrots
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/examples/plot_randomwalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
together with the theoretical result
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 1 addition & 0 deletions intro/numpy/solutions/2_4_mandelbrot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Compute the Mandelbrot fractal
"""

import numpy as np
import matplotlib.pyplot as plt
from numpy import newaxis
Expand Down
2 changes: 1 addition & 1 deletion intro/scipy/image_processing/image_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Changing orientation, resolution, .. ::
>>> # Load an image
>>> face = sp.datasets.face(gray=True)

>>> # Shift, roate and zoom it
>>> # Shift, rotate and zoom it
>>> shifted_face = sp.ndimage.shift(face, (50, 50))
>>> shifted_face2 = sp.ndimage.shift(face, (50, 50), mode='nearest')
>>> rotated_face = sp.ndimage.rotate(face, 30)
Expand Down
1 change: 1 addition & 0 deletions intro/scipy/solutions/test_dir_sort.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test the dir_sort logic.
"""

import dir_sort


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Generate the exercise results on the Gumbell distribution
"""

import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Generate a chart of the data fitted by Gaussian curve
"""

import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Generate a chart of the data recorded by the lidar system
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Generate a chart of the data fitted by Gaussian curve
"""

import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Generate the exercise results on the Gumbell distribution
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion packages/scikit-learn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ Model Selection via Validation
Cross-validation
----------------

Cross-validation consists in repetively splitting the data in pairs of
Cross-validation consists in repeatedly splitting the data in pairs of
train and test sets, called 'folds'. Scikit-learn comes with a function
to automatically compute score on all these folds. Here we do
:class:`~sklearn.model_selection.KFold` with k=5. ::
Expand Down
2 changes: 1 addition & 1 deletion packages/statistics/examples/plot_airfare.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Download the file if it is not present
r = requests.get(
"https://users.stat.ufl.edu/~winner/data/airq4.dat",
verify=False # Wouldn't normally do this, but this site's certificate
verify=False, # Wouldn't normally do this, but this site's certificate
# is not yet distributed
)
with open("airfares.txt", "wb") as f:
Expand Down
1 change: 1 addition & 0 deletions packages/statistics/examples/plot_iris_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
of a continuous confound
"""

import matplotlib.pyplot as plt

import pandas
Expand Down
1 change: 1 addition & 0 deletions packages/statistics/examples/plot_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Fit a simple linear regression using 'statsmodels', compute corresponding
p-values.
"""

# Original author: Thomas Haslwanter

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions packages/statistics/examples/plot_regression_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Also shows how to make 3d plots.
"""

# Original author: Thomas Haslwanter

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions packages/statistics/examples/solutions/plot_brain_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
data type, statsmodels is able to automatically infer this.
"""

import pandas
from statsmodels.formula.api import ols

Expand Down
2 changes: 1 addition & 1 deletion packages/statistics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ Categorical variables can be plotted as the hue::
.. tip::

To switch back to seaborn settings, or understand better styling in
seaborn, see the `relevent section of the seaborn documentation
seaborn, see the `relevant section of the seaborn documentation
<https://seaborn.pydata.org/tutorial/aesthetics.html>`_.


Expand Down

0 comments on commit 271064b

Please sign in to comment.