Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert type #10

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f877804
Printing functions for testing outputs
Jul 29, 2024
dbadf86
Updated the return_random_number
Jul 29, 2024
b5477bc
Update utils.py
Sedighe-Raeisi Jul 29, 2024
2a51a45
Update utils.py
maedeh-amini Jul 29, 2024
0b4a6f6
Update utils.py
Sedighe-Raeisi Jul 29, 2024
d6ecfb0
Update utils.py
Sedighe-Raeisi Jul 29, 2024
7ef8c26
Merge pull request #7 from anishhs001/feature_add
maedeh-amini Jul 29, 2024
5387673
Update utils.py
Sedighe-Raeisi Jul 29, 2024
cfa05c6
Update utils.py
Sedighe-Raeisi Jul 29, 2024
2c873c8
Update utils.py
anishhs001 Jul 29, 2024
9d3e036
Merge branch 'main' into Sedighe
anishhs001 Jul 29, 2024
36a31ef
Merge pull request #6 from anishhs001/Sedighe
Sedighe-Raeisi Jul 29, 2024
6680ad4
Merge branch 'main' into maedeh-amini-patch-1
anishhs001 Jul 29, 2024
6d07a53
Merge pull request #8 from anishhs001/maedeh-amini-patch-1
anishhs001 Jul 29, 2024
179bc8f
Update utils.py
Sedighe-Raeisi Jul 29, 2024
af80b70
Created a unit test for return_hexadecimal
Jul 29, 2024
887e0b1
Created a unit test for return_hexadecimal
Jul 29, 2024
08c11b7
Create Test_return_random_number
Sedighe-Raeisi Jul 29, 2024
6171108
Merge pull request #10 from anishhs001/Sedighe-Raeisi-patch-2
anishhs001 Jul 29, 2024
b223318
Rename Test_return_random_number to Test_return_random_number.py
Sedighe-Raeisi Jul 29, 2024
5046932
Merge pull request #11 from anishhs001/unit_test_return_hexadecimal
anishhs001 Jul 29, 2024
67078bb
Update Test_return_random_number.py
Sedighe-Raeisi Jul 29, 2024
e8f1ee2
Update utils.py
Sedighe-Raeisi Jul 29, 2024
d4cb881
Updated and checked the random number unit test
Jul 29, 2024
ba89529
Merge branch 'main' into UnitTest_return_random_number
anishhs001 Jul 29, 2024
6832dec
Merge pull request #14 from anishhs001/UnitTest_return_random_number
anishhs001 Jul 29, 2024
f30d5b2
Rename test-pytest.yml.disabled to test-pytest.yml
anishhs001 Jul 29, 2024
d817888
Created sum unit test
Jul 29, 2024
9b4c9ff
Merge pull request #16 from anishhs001/unit_test_sum
anishhs001 Jul 29, 2024
49ae1d2
Update mkdocs.yml
anishhs001 Jul 29, 2024
266b428
Rename docs-publish.yml.disabled to docs-publish.yml
anishhs001 Jul 29, 2024
bfc18ca
Update pyproject.toml
anishhs001 Jul 29, 2024
5c2b737
Merge pull request #18 from anishhs001/anishhs001-patch-1-1
anishhs001 Jul 29, 2024
1e21855
Merge pull request #19 from anishhs001/anishhs001-patch-1
anishhs001 Jul 29, 2024
158dc10
Merge pull request #20 from anishhs001/anishhs001-patch-3
anishhs001 Jul 29, 2024
e0e4bb1
Update and rename python-publish.yml.disabled to python-publish.yml
anishhs001 Jul 29, 2024
3875ff1
Update pyproject.toml
anishhs001 Jul 29, 2024
2f3a625
Update python-publish.yml
anishhs001 Jul 29, 2024
50f99e1
Update pyproject.toml
anishhs001 Jul 29, 2024
e6a2fae
Update python-publish.yml
anishhs001 Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
with:
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
password: ${{ secrets.API_TOKEN }}
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
- 'resources/github-basics.md'
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "practice-project"
name = "practice-project-ASD-v1.0.0"
description = "A practice project for open-source development"
authors = []
dynamic = ["version"]
Expand All @@ -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"]
Expand Down
12 changes: 9 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def divide(a: float, b: float) -> float:
Returns:
float
'''
return a / b

if b!=0:
return a / b
else:
print("b shouldn't be zero")

def modulo(a: int, b: int):
'''
Expand Down Expand Up @@ -91,7 +95,8 @@ def return_hexadecimal(a: int) -> float:
return hex(a)


def return_random_number() -> int:
def return_random_number(a: int, b:int, seed:int) -> int:

'''
...

Expand All @@ -103,4 +108,5 @@ def return_random_number() -> int:
float
'''

return np.random.randint(0, 100)
np.random.seed(seed)
return np.random.randint(a, b)
7 changes: 7 additions & 0 deletions tests/Test_return_random_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from src.utils import return_random_number

try:
return_random_number(0,200, 45)
print("The return_random_number function works")
except:
print("We have an issue with return_random_number function")
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from utils import sum, multiply, divide
6 changes: 6 additions & 0 deletions tests/test_hexadecimal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from src.utils import return_hexadecimal
def test_hexadecimal():
a = 2
b = 3

assert return_hexadecimal(a) == hex(a)
6 changes: 6 additions & 0 deletions tests/test_sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from src.utils import sum
def test_sum():
a = 2
b = 3

assert sum(a, b) == 5