[mypy] Fix directory arithmetic_analysis (#4304) · rkalyankumar/Python@5229c74 · GitHub
Skip to content

Commit 5229c74

Browse files
authored
[mypy] Fix directory arithmetic_analysis (TheAlgorithms#4304)
* fix directory arithmetic_analysis * Update build.yml * temporary fix for psf/black bug see psf/black#2079 * Update in_static_equilibrium.py
1 parent 895bca3 commit 5229c74

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
~/.cache/pip
1515
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
1616
- uses: actions/setup-python@v2
17-
- uses: psf/black@stable
17+
- uses: psf/black@20.8b1
1818
- name: Install pre-commit
1919
run: |
2020
python -m pip install --upgrade pip

arithmetic_analysis/gaussian_elimination.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88

99

10-
def retroactive_resolution(coefficients: np.matrix, vector: np.array) -> np.array:
10+
def retroactive_resolution(coefficients: np.matrix, vector: np.ndarray) -> np.ndarray:
1111
"""
1212
This function performs a retroactive linear system resolution
1313
for triangular matrix
@@ -38,7 +38,7 @@ def retroactive_resolution(coefficients: np.matrix, vector: np.array) -> np.arra
3838
return x
3939

4040

41-
def gaussian_elimination(coefficients: np.matrix, vector: np.array) -> np.array:
41+
def gaussian_elimination(coefficients: np.matrix, vector: np.ndarray) -> np.ndarray:
4242
"""
4343
This function performs Gaussian elimination method
4444
@@ -57,7 +57,7 @@ def gaussian_elimination(coefficients: np.matrix, vector: np.array) -> np.array:
5757
# coefficients must to be a square matrix so we need to check first
5858
rows, columns = np.shape(coefficients)
5959
if rows != columns:
60-
return []
60+
return np.array((), dtype=float)
6161

6262
# augmented matrix
6363
augmented_mat = np.concatenate((coefficients, vector), axis=1)

arithmetic_analysis/in_static_equilibrium.py

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)