From f877804672aed10f323c14d0cf1f5a305b59db0d Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 11:32:57 +0200 Subject: [PATCH 01/27] Printing functions for testing outputs --- src/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..4fc0cfc 100644 --- a/src/utils.py +++ b/src/utils.py @@ -103,4 +103,6 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + return np.random.randint(0, 100) +print(return_random_number()) +print(return_hexadecimal(return_random_number())) \ No newline at end of file From dbadf86b6cb5d868bd50bd31e5881b5724174b40 Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 11:45:58 +0200 Subject: [PATCH 02/27] Updated the return_random_number --- src/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index 4fc0cfc..18548c2 100644 --- a/src/utils.py +++ b/src/utils.py @@ -91,7 +91,7 @@ def return_hexadecimal(a: int) -> float: return hex(a) -def return_random_number() -> int: +def return_random_number(a: int, b:int) -> int: ''' ... @@ -103,6 +103,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) -print(return_random_number()) -print(return_hexadecimal(return_random_number())) \ No newline at end of file + return np.random.randint(a, b) \ No newline at end of file From b5477bcc0f02b1fa18b63352086cb248e642cf83 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:50:13 +0200 Subject: [PATCH 03/27] Update utils.py I fixed the issue #5 and #3 --- src/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..bfed943 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,7 +41,8 @@ def divide(a: float, b: float) -> float: Returns: float ''' - return a / b + if b!=0: + return a / b def modulo(a: int, b: int): ''' @@ -103,4 +104,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + return np.random.randint(0, 100) From 2a51a457a0a7f0436a54f260b274af289feae0d1 Mon Sep 17 00:00:00 2001 From: maedeh-amini <110631052+maedeh-amini@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:05:00 +0100 Subject: [PATCH 04/27] Update utils.py Division by zero is excluded #5 --- src/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..ae3a355 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,6 +41,8 @@ def divide(a: float, b: float) -> float: Returns: float ''' + if b == 0: + raise ValueError("The divisor 'b' cannot be zero.") return a / b def modulo(a: int, b: int): @@ -103,4 +105,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) \ No newline at end of file + return np.random.randint(0, 100) From 0b4a6f67b365006c61abb26c9bc6bbc1034d0803 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:54:51 +0200 Subject: [PATCH 05/27] Update utils.py I add a print line that says b can't be zero --- src/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.py b/src/utils.py index bfed943..c716ebe 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,6 +41,7 @@ def divide(a: float, b: float) -> float: Returns: float ''' + print("b shouldn't be zero") if b!=0: return a / b From d6ecfb09427004892ee21d45cea63ba6460e4c94 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:13:01 +0200 Subject: [PATCH 06/27] Update utils.py I moved the print into the condition block --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index c716ebe..e073f33 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,8 +41,9 @@ def divide(a: float, b: float) -> float: Returns: float ''' - print("b shouldn't be zero") + if b!=0: + print("b shouldn't be zero") return a / b def modulo(a: int, b: int): From 5387673b3c0f1a6e3ae4529dda900a685967461a Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:20:08 +0200 Subject: [PATCH 07/27] Update utils.py I resolved the conflict with rand region --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index e073f33..473aa1a 100644 --- a/src/utils.py +++ b/src/utils.py @@ -106,4 +106,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(0, 100) + return np.random.randint(a,b) From cfa05c691b8e046cbcf48c7d61746498ee135335 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:25:23 +0200 Subject: [PATCH 08/27] Update utils.py add a space before b --- src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 473aa1a..2aab6f6 100644 --- a/src/utils.py +++ b/src/utils.py @@ -106,4 +106,4 @@ def return_random_number() -> int: float ''' - return np.random.randint(a,b) + return np.random.randint(a, b) From 2c873c85b92dacf32946682513f8124d230b4950 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:33:19 +0200 Subject: [PATCH 09/27] Update utils.py --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 2aab6f6..9ddfe09 100644 --- a/src/utils.py +++ b/src/utils.py @@ -43,8 +43,9 @@ def divide(a: float, b: float) -> float: ''' if b!=0: - print("b shouldn't be zero") return a / b + else: + print("b shouldn't be zero") def modulo(a: int, b: int): ''' From 179bc8fdcfed5fac3f57d9a618585d1cc6f8fea1 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:05:04 +0200 Subject: [PATCH 10/27] Update utils.py I added the seed into rand function --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 4cc2092..cfd3429 100644 --- a/src/utils.py +++ b/src/utils.py @@ -95,7 +95,8 @@ def return_hexadecimal(a: int) -> float: return hex(a) -def return_random_number(a: int, b:int) -> int: +def return_random_number(a: int, b:int, seed:int) -> int: + np.random.seed(seed) ''' ... From af80b7001cb6eaa2a97dcc1bfaa61cd0eb38fe2e Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 15:08:43 +0200 Subject: [PATCH 11/27] Created a unit test for return_hexadecimal --- tests/test_hexadecimal.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/test_hexadecimal.py diff --git a/tests/test_hexadecimal.py b/tests/test_hexadecimal.py new file mode 100644 index 0000000..ace9728 --- /dev/null +++ b/tests/test_hexadecimal.py @@ -0,0 +1,6 @@ +from src.utils import return_hexadecimal +def test_hexadecimal(): + a = 2 + b = 3 + + assert return_hexadecimal(a) == hex(a) From 887e0b14b8b698285ba70890237e5026777ef2e5 Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 15:09:53 +0200 Subject: [PATCH 12/27] Created a unit test for return_hexadecimal --- tests/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..fb01633 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +from utils import sum, multiply, divide \ No newline at end of file From 08c11b7cb27e9e313200bc7f3a7bbb2f1301f8bd Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:10:47 +0200 Subject: [PATCH 13/27] Create Test_return_random_number I created a test using try-except for the function return_random_number. --- tests/Test_return_random_number | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/Test_return_random_number diff --git a/tests/Test_return_random_number b/tests/Test_return_random_number new file mode 100644 index 0000000..589fdb7 --- /dev/null +++ b/tests/Test_return_random_number @@ -0,0 +1,7 @@ +from src.utils import return_random_number + +try: + return_random_number(0,200, 45): + print("The reurtn_random_number function works") +except: + print("We have an issue with return_random_number function") From b223318cf2ae35265759cf3ce4dc5690db32a3d8 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:20:14 +0200 Subject: [PATCH 14/27] Rename Test_return_random_number to Test_return_random_number.py --- tests/{Test_return_random_number => Test_return_random_number.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{Test_return_random_number => Test_return_random_number.py} (100%) diff --git a/tests/Test_return_random_number b/tests/Test_return_random_number.py similarity index 100% rename from tests/Test_return_random_number rename to tests/Test_return_random_number.py From 67078bb7320121a5ea0746595b46ffbbef3b5b36 Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:28:49 +0200 Subject: [PATCH 15/27] Update Test_return_random_number.py remove : --- tests/Test_return_random_number.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Test_return_random_number.py b/tests/Test_return_random_number.py index 589fdb7..3a7d806 100644 --- a/tests/Test_return_random_number.py +++ b/tests/Test_return_random_number.py @@ -1,7 +1,7 @@ from src.utils import return_random_number try: - return_random_number(0,200, 45): + return_random_number(0,200, 45) print("The reurtn_random_number function works") except: print("We have an issue with return_random_number function") From e8f1ee2c3c2a1597e27ed935bbba72c243404f6c Mon Sep 17 00:00:00 2001 From: Sedighe Raeisi <67642255+Sedighe-Raeisi@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:40:43 +0200 Subject: [PATCH 16/27] Update utils.py seed added --- src/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index f88c179..6216011 100644 --- a/src/utils.py +++ b/src/utils.py @@ -95,7 +95,8 @@ def return_hexadecimal(a: int) -> float: return hex(a) -def return_random_number(a: int, b:int) -> int: +def return_random_number(a: int, b:int, seed:int) -> int: + ''' ... @@ -106,4 +107,6 @@ def return_random_number(a: int, b:int) -> int: Returns: float ''' + + np.random.seed(seed) return np.random.randint(a, b) From d4cb88117dfa4f2c6ebed2f97ddf6c76a2754ff8 Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 15:43:46 +0200 Subject: [PATCH 17/27] Updated and checked the random number unit test --- tests/Test_return_random_number.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Test_return_random_number.py b/tests/Test_return_random_number.py index 3a7d806..b6ac062 100644 --- a/tests/Test_return_random_number.py +++ b/tests/Test_return_random_number.py @@ -2,6 +2,6 @@ try: return_random_number(0,200, 45) - print("The reurtn_random_number function works") + print("The return_random_number function works") except: print("We have an issue with return_random_number function") From f30d5b2a7f124738b8523104a594e696b154c148 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:07:32 +0200 Subject: [PATCH 18/27] Rename test-pytest.yml.disabled to test-pytest.yml --- .github/workflows/{test-pytest.yml.disabled => test-pytest.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test-pytest.yml.disabled => test-pytest.yml} (100%) diff --git a/.github/workflows/test-pytest.yml.disabled b/.github/workflows/test-pytest.yml similarity index 100% rename from .github/workflows/test-pytest.yml.disabled rename to .github/workflows/test-pytest.yml From d8178888e080f14538e91e8afb4f4be0dd46bd05 Mon Sep 17 00:00:00 2001 From: Anish-Hs Date: Mon, 29 Jul 2024 16:13:38 +0200 Subject: [PATCH 19/27] Created sum unit test --- tests/test_sum.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/test_sum.py diff --git a/tests/test_sum.py b/tests/test_sum.py new file mode 100644 index 0000000..322aae7 --- /dev/null +++ b/tests/test_sum.py @@ -0,0 +1,6 @@ +from src.utils import sum +def test_sum(): + a = 2 + b = 3 + + assert sum(a, b) == 5 From 49ae1d20a36e9bd9191f9b1da92e34bf19c86ba7 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:43:16 +0200 Subject: [PATCH 20/27] Update mkdocs.yml --- mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index b2d949c..d0a6d98 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,9 +26,9 @@ extra_javascript: [ ] site_name: Contributor Onboarding -repo_url: 'https://github.com/GITHUBUSERNAME/contributor-onboarding' +repo_url: 'https://github.com/anishhs001/contributor-onboarding' nav: - Home: 'index.md' - Resources: - - 'resources/github-basics.md' \ No newline at end of file + - 'resources/github-basics.md' From 266b428b5746144fce1f2fde1ce287101c94cd7a Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:43:37 +0200 Subject: [PATCH 21/27] Rename docs-publish.yml.disabled to docs-publish.yml --- .github/workflows/{docs-publish.yml.disabled => docs-publish.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docs-publish.yml.disabled => docs-publish.yml} (100%) diff --git a/.github/workflows/docs-publish.yml.disabled b/.github/workflows/docs-publish.yml similarity index 100% rename from .github/workflows/docs-publish.yml.disabled rename to .github/workflows/docs-publish.yml From bfc18ca2267b94e19bdf2474c7b4a0a015bbd9ff Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:48:41 +0200 Subject: [PATCH 22/27] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9681ccb..9b5c1f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ test = [ ] [project.urls] -repository = "https://github.com/GITHUBUSERNAME/contributor-onboarding" -documentation = "https://GITHUBUSERNAME.github.io/contributor-onboarding/" +repository = "https://github.com/anishhs001/contributor-onboarding" +documentation = "https://anishhs001.github.io/contributor-onboarding/" [build-system] requires = ["setuptools", "setuptools_scm"] From e0e4bb1efa135b98c3699df7ae8212a25ea61e57 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:11:25 +0200 Subject: [PATCH 23/27] Update and rename python-publish.yml.disabled to python-publish.yml --- .../{python-publish.yml.disabled => python-publish.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{python-publish.yml.disabled => python-publish.yml} (83%) diff --git a/.github/workflows/python-publish.yml.disabled b/.github/workflows/python-publish.yml similarity index 83% rename from .github/workflows/python-publish.yml.disabled rename to .github/workflows/python-publish.yml index 2529b95..1a6f04d 100644 --- a/.github/workflows/python-publish.yml.disabled +++ b/.github/workflows/python-publish.yml @@ -37,4 +37,4 @@ jobs: with: repository_url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.pypi-AgENdGVzdC5weXBpLm9yZwIkYzA1ZGZjNDktZDJhNC00OGQ2LTllOGQtYmM1M2Q1ODA2YzE1AAIqWzMsIjQ4ZGZlOGRmLTcyYzUtNDEwOS04YjdhLTQwYzU0NmQ0ZjRhNyJdAAAGIILWk24u8GFzCHstNeFNlacjlpfPHSfHURQJhzSjgsME }} From 3875ff195a43f6a7bf5b9bcc960ee1da24e8bfc7 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:22:42 +0200 Subject: [PATCH 24/27] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9b5c1f4..48a4154 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "practice-project" +name = "practice-project-ANISH" description = "A practice project for open-source development" authors = [] dynamic = ["version"] From 2f3a62525552eb6c2e323e1d5dcea0734eb74535 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:23:31 +0200 Subject: [PATCH 25/27] Update python-publish.yml --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1a6f04d..23d5dea 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -37,4 +37,4 @@ jobs: with: repository_url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.pypi-AgENdGVzdC5weXBpLm9yZwIkYzA1ZGZjNDktZDJhNC00OGQ2LTllOGQtYmM1M2Q1ODA2YzE1AAIqWzMsIjQ4ZGZlOGRmLTcyYzUtNDEwOS04YjdhLTQwYzU0NmQ0ZjRhNyJdAAAGIILWk24u8GFzCHstNeFNlacjlpfPHSfHURQJhzSjgsME }} + password: ${{ secrets.API_TOKEN}} From 50f99e18b38c6ccbb47c0a208a22f6d6b5146a96 Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:44:23 +0200 Subject: [PATCH 26/27] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 48a4154..1aeb7a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "practice-project-ANISH" +name = "practice-project-ASD-v1.0.0" description = "A practice project for open-source development" authors = [] dynamic = ["version"] From e6a2fae0079dfb41970a6c7c57bc10cb992d24ee Mon Sep 17 00:00:00 2001 From: anishhs001 <108971115+anishhs001@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:17:05 +0200 Subject: [PATCH 27/27] Update python-publish.yml --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 23d5dea..94ba549 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -37,4 +37,4 @@ jobs: with: repository_url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.API_TOKEN}} + password: ${{ secrets.API_TOKEN }}