Tighten up psf/black and flake8 (#2024)

* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2020-05-22 08:10:11 +02:00
committed by GitHub
parent 21ed8968c0
commit 1f8a21d727
124 changed files with 583 additions and 495 deletions

View File

@ -27,10 +27,10 @@ import random
class Vector:
"""
This class represents a vector of arbitrary size.
You need to give the vector components.
You need to give the vector components.
Overview about the methods:
constructor(components : list) : init the vector
set(components : list) : changes the vector components.
__str__() : toString method
@ -124,7 +124,7 @@ class Vector:
def __mul__(self, other):
"""
mul implements the scalar multiplication
mul implements the scalar multiplication
and the dot-product
"""
if isinstance(other, float) or isinstance(other, int):
@ -167,7 +167,7 @@ def zeroVector(dimension):
def unitBasisVector(dimension, pos):
"""
returns a unit basis vector with a One
returns a unit basis vector with a One
at index 'pos' (indexing at 0)
"""
# precondition
@ -196,7 +196,7 @@ def randomVector(N, a, b):
"""
input: size (N) of the vector.
random range (a,b)
output: returns a random vector of size N, with
output: returns a random vector of size N, with
random integer components between 'a' and 'b'.
"""
random.seed(None)
@ -208,10 +208,10 @@ class Matrix:
"""
class: Matrix
This class represents a arbitrary matrix.
Overview about the methods:
__str__() : returns a string representation
__str__() : returns a string representation
operator * : implements the matrix vector multiplication
implements the matrix-scalar multiplication.
changeComponent(x,y,value) : changes the specified component.