uses: actions/checkout@v2 (#1779)

* uses: actions/checkout@v2

* fixup! Format Python code with psf/black push
This commit is contained in:
Christian Clauss 2020-02-21 11:02:35 +01:00 committed by GitHub
parent cb4795616c
commit 59bf115aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
- run: pip install black - run: pip install black
- run: black --check . - run: black --check .

View File

@ -4,7 +4,7 @@ https://en.wikipedia.org/wiki/Rayleigh_quotient
import numpy as np import numpy as np
def is_hermitian(matrix:np.matrix) -> bool: def is_hermitian(matrix: np.matrix) -> bool:
""" """
Checks if a matrix is Hermitian. Checks if a matrix is Hermitian.
@ -25,7 +25,7 @@ def is_hermitian(matrix:np.matrix) -> bool:
return np.array_equal(matrix, matrix.H) 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 Returns the Rayleigh quotient of a Hermitian matrix A and
vector v. vector v.

View File

@ -5,7 +5,9 @@
""" """
"""Calculate Modular Exponential.""" """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) >>> modular_exponential(5, 0, 10)
1 1

View File

@ -1,6 +1,7 @@
import random import random
from typing import List from typing import List
class Dice: class Dice:
NUM_SIDES = 6 NUM_SIDES = 6
@ -15,7 +16,7 @@ class Dice:
return "Fair Dice" 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. Return probability list of all possible sums when throwing dice.