Skip to content

Enables get_namespace to return namespace when input adopts Array API spec #20

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

Merged

Conversation

thomasjpfan
Copy link
Contributor

This PR enables get_namespace to return the Array API namespace if the input already adapts the Array API standard.

Copy link
Contributor

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

LGTM. This looks to be a bug in the current implementation.

@@ -12,3 +12,10 @@ def test_get_namespace(library):
expected_namespace = getattr(array_api_compat, library)
assert namespace is expected_namespace


@pytest.mark.parametrize("array_namespace", ["cupy.array_api", "numpy.array_api"])
def test_get_namespace_returns_actual_namespace(array_namespace):
Copy link
Member

Choose a reason for hiding this comment

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

Why is this a separate test from the one above?

Copy link
Member

Choose a reason for hiding this comment

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

Going to just merge this and fix this and the other issues you opened issues for in another PR.

@asmeurer asmeurer merged commit e2203df into data-apis:main Mar 6, 2023
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.

3 participants