diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml index cf578a14da95..95d2d3d64233 100644 --- a/.github/workflows/autoblack.yml +++ b/.github/workflows/autoblack.yml @@ -9,7 +9,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-python@v1 - run: pip install black - run: black --check . diff --git a/linear_algebra/src/rayleigh_quotient.py b/linear_algebra/src/rayleigh_quotient.py index 46551749febd..d0d5d6396d28 100644 --- a/linear_algebra/src/rayleigh_quotient.py +++ b/linear_algebra/src/rayleigh_quotient.py @@ -4,7 +4,7 @@ import numpy as np -def is_hermitian(matrix:np.matrix) -> bool: +def is_hermitian(matrix: np.matrix) -> bool: """ Checks if a matrix is Hermitian. @@ -25,7 +25,7 @@ def is_hermitian(matrix:np.matrix) -> bool: return np.array_equal(matrix, matrix.H) -def rayleigh_quotient(A:np.matrix, v:np.matrix) -> float: +def rayleigh_quotient(A: np.matrix, v: np.matrix) -> float: """ Returns the Rayleigh quotient of a Hermitian matrix A and vector v. diff --git a/maths/modular_exponential.py b/maths/modular_exponential.py index 91fa0e462a49..8b7b17575a33 100644 --- a/maths/modular_exponential.py +++ b/maths/modular_exponential.py @@ -5,7 +5,9 @@ """ """Calculate Modular Exponential.""" -def modular_exponential(base : int, power : int, mod : int): + + +def modular_exponential(base: int, power: int, mod: int): """ >>> modular_exponential(5, 0, 10) 1 diff --git a/maths/monte_carlo_dice.py b/maths/monte_carlo_dice.py index c045cc829213..c36c3e83e00b 100644 --- a/maths/monte_carlo_dice.py +++ b/maths/monte_carlo_dice.py @@ -1,6 +1,7 @@ import random from typing import List + class Dice: NUM_SIDES = 6 @@ -15,7 +16,7 @@ def _str_(self): return "Fair Dice" -def throw_dice(num_throws: int, num_dice: int=2) -> List[float]: +def throw_dice(num_throws: int, num_dice: int = 2) -> List[float]: """ Return probability list of all possible sums when throwing dice.