From a1be554b1fb04f1ea4d3dece63a16defdb776371 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 21 Feb 2020 05:26:55 +0100 Subject: [PATCH 1/2] uses: actions/checkout@v2 --- .github/workflows/autoblack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 . From 95c37ff5158efc1035e332c77ae5755df94741dc Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 21 Feb 2020 04:27:51 +0000 Subject: [PATCH 2/2] fixup! Format Python code with psf/black push --- linear_algebra/src/rayleigh_quotient.py | 4 ++-- maths/modular_exponential.py | 4 +++- maths/monte_carlo_dice.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) 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.