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

fix: fixed testing and added more examples #10

Merged
merged 2 commits into from
May 24, 2024

Conversation

jcabrero
Copy link
Member

@jcabrero jcabrero commented May 23, 2024

This PR does 3 things:

a) It creates a new example for broadcasting.
b) It fixes the errors where testing may not have been done because errors where not propagated.
c) It adds a linting check on the actions that can be solved by using: black .

@jcabrero jcabrero force-pushed the feat/fixed_testing_and_added_more_examples branch 2 times, most recently from 5c57f78 to c0bde1d Compare May 23, 2024 13:59
@jcabrero jcabrero changed the title Feat/fixed testing and added more examples fix: fixed testing and added more examples May 23, 2024
@jcabrero jcabrero force-pushed the feat/fixed_testing_and_added_more_examples branch 2 times, most recently from cc4ff88 to 4f63716 Compare May 23, 2024 14:10
@jcabrero jcabrero force-pushed the feat/fixed_testing_and_added_more_examples branch from 4f63716 to d0e8b89 Compare May 23, 2024 14:12
@jcabrero jcabrero requested a review from mathias-nillion May 23, 2024 14:16
@@ -10,7 +10,24 @@ on:
branches: [ "*" ]

jobs:
check-linting:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice-to-have but might want to start running mypy and/or pylint at some point as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. For the time being, I like black because it's uniform, easy to run and doesn't add a lot of complexity. Linting can be painfull on certain behaviours that we normally use.

Copy link
Contributor

@mathias-nillion mathias-nillion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a few small nits. Awesome work!

result = a[0] + a[1] + a[2]
result = Integer(0)
for i in range(a.shape[0]): # GET ATTR
result += a[i] # GET ITEM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcabrero Does this work nested as well? e.g., a[i][i][i]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the shape is known at compilation time, it can be done, yes.

]

TESTS = [("tests/nada-tests/", test) for test in TESTS] + [
("examples/" + test, test) for test in EXAMPLES
("examples/" + test + "/", test) for test in EXAMPLES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit but this wouldn't work on Windows --> os.path.join is probably better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it. I may add tests for Windows, but I think nilup, nada ... do not officially support Windows besides WSL.

@@ -79,7 +85,7 @@ def test_run(self, testname):
cwd = os.getcwd()
try:
# Build Nada Program
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, I assume this comment is no longer accurate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for pointing it out.

@jcabrero jcabrero force-pushed the feat/fixed_testing_and_added_more_examples branch from d0e8b89 to 4d5a93c Compare May 24, 2024 14:42
@jcabrero jcabrero merged commit cf823f1 into main May 24, 2024
4 checks passed
@jcabrero jcabrero deleted the feat/fixed_testing_and_added_more_examples branch May 24, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants