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 test_floating.py test to call sys.exit #433

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

marcinz
Copy link
Collaborator

@marcinz marcinz commented Jun 29, 2022

Because this test is not calling sys.exit, the test failures are not correctly registered. In this PR we fix the test and the failing test cases.

@marcinz marcinz requested a review from bryevdv June 29, 2022 00:22
@bryevdv
Copy link
Contributor

bryevdv commented Jun 29, 2022

Looks good, the test should fail now (good to verify). Then I believe this patch will fix:

diff --git a/cunumeric/_ufunc/ufunc.py b/cunumeric/_ufunc/ufunc.py
index 47ae475b..c6d2a327 100644
--- a/cunumeric/_ufunc/ufunc.py
+++ b/cunumeric/_ufunc/ufunc.py
@@ -264,7 +264,7 @@ class ufunc:
         raise TypeError("return arrays must be of ArrayType")
 
     def _prepare_operands(
-        self, *args: Any, out: Union[ndarray, None], where: bool = True
+        self, *args: Any, out: Union[ndarray, tuple[ndarray, ...], None], where: bool = True
     ) -> tuple[
         Sequence[ndarray],
         Sequence[Union[ndarray, None]],
@@ -295,6 +295,8 @@ class ufunc:
             computed_out = (None,) * self.nout
         elif not isinstance(out, tuple):
             computed_out = (out,)
+        else:
+            computed_out = out
 
         outputs = tuple(
             self._maybe_convert_output_to_cunumeric_ndarray(arr)
@@ -469,7 +471,7 @@ class multiout_unary_ufunc(ufunc):
     def __call__(
         self,
         *args: Any,
-        out: Union[ndarray, None] = None,
+        out: Union[ndarray, tuple[ndarray, ...], None] = None,
         where: bool = True,
         casting: CastingKind = "same_kind",
         order: str = "K",

@marcinz
Copy link
Collaborator Author

marcinz commented Jun 29, 2022

First we'll get a CI failure, and then we'll fix the issues that cause test failures.

@bryevdv
Copy link
Contributor

bryevdv commented Jun 29, 2022

I've created #434 regarding developing a linter of some sort for this.

@marcinz marcinz merged commit 6b5660c into nv-legate:branch-22.07 Jun 29, 2022
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