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

signature tests being misled by **kwargs #171

Open
asmeurer opened this issue Feb 24, 2023 · 1 comment
Open

signature tests being misled by **kwargs #171

asmeurer opened this issue Feb 24, 2023 · 1 comment

Comments

@asmeurer
Copy link
Member

The meshgrid signature test fails with cupy:

E           AssertionError: Argument 'indexing' missing from signature
E           assert 'indexing' in odict_keys(['xi', 'kwargs'])
E            +  where 'indexing' = <Parameter "indexing: str = 'xy'">.name
E            +  and   odict_keys(['xi', 'kwargs']) = <built-in method keys of mappingproxy object at 0x7fc946212170>()
E            +    where <built-in method keys of mappingproxy object at 0x7fc946212170> = mappingproxy(OrderedDict([('xi', <Parameter "*xi">), ('kwargs', <Parameter "**kwargs">)])).keys
E            +      where mappingproxy(OrderedDict([('xi', <Parameter "*xi">), ('kwargs', <Parameter "**kwargs">)])) = <Signature (*xi, **kwargs)>.parameters

array_api_tests/test_signatures.py:92: AssertionError

cupy.meshgrid does have the indexing keyword, but its signature is meshgrid(*x, **kwargs). If we can't check a keyword argument directly, we should assume it is present with **kwargs, and let the individual tests suss out whether it really supports it.

@honno
Copy link
Member

honno commented Feb 25, 2023

Interesting scenario!

cupy.meshgrid does have the indexing keyword, but its signature is meshgrid(*x, **kwargs). If we can't check a keyword argument directly, we should assume it is present with **kwargs, and let the individual tests suss out whether it really supports it.

Personally I'd rather skip here (after testing everything else first so the test still could fail), as we can't confidently say the test "passes", with a skip reason like "keyword not found, but star-kwargs could consume keyword".

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

No branches or pull requests

3 participants
@asmeurer @honno and others