From f97868e6737fffbd3ac2d9bceb37cfb7e9c7c061 Mon Sep 17 00:00:00 2001 From: Krishnendu-Bose Date: Mon, 29 Jul 2024 12:01:24 +0200 Subject: [PATCH 1/2] Added an @ --- src/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..5f69657 100644 --- a/src/utils.py +++ b/src/utils.py @@ -74,7 +74,9 @@ def element_wise_multiply(a: np.array, b: np.array) -> np.array: # let's hope that both vectors have the same shape - return np.multiply(a, b) + return a@b #bitwise operation of the input vectors + + def return_hexadecimal(a: int) -> float: ''' From 137bd502837ac4473f4643c8932eebc8c49f407c Mon Sep 17 00:00:00 2001 From: Krishnendu-Bose Date: Mon, 29 Jul 2024 15:50:48 +0200 Subject: [PATCH 2/2] Added a modulo test --- .gitignore | 3 ++- tests/Modulus test.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/Modulus test.py diff --git a/.gitignore b/.gitignore index b6dd9be..4635797 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ # Python Environment .python-version .venv - +venv +\venv # General ignores for macOS .DS_Store diff --git a/tests/Modulus test.py b/tests/Modulus test.py new file mode 100644 index 0000000..e1b067e --- /dev/null +++ b/tests/Modulus test.py @@ -0,0 +1,13 @@ +import unittest + + + + +from src.utils import modulo + + +def test_modulo(): + a = 7 + b = 3 + + assert modulo(a, b) == 1 \ No newline at end of file