test_has_names fails on info category checked main namespace, instead of class attributes
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start with array_api_tests/test_has_names.py and inspect the test_has_names handling for the info category. Run the failing parametrized test cases, using array_namespace_info() as the object to check. Done means the five info names are validated on the Info object and the test suite passes.
Written by the indexing model from the issue text.
Description
__________________________________________________________________________________________ test_has_names[info-dtypes] __________________________________________________________________________________________
category = 'info', name = 'dtypes'
@pytest.mark.parametrize("category, name", has_name_params)
def test_has_names(category, name):
if category in EXTENSIONS:
ext_mod = getattr(xp, category)
assert hasattr(ext_mod, name), f"{xp.__name__} is missing the {category} extension function {name}()"
elif category.startswith('array_'):
# TODO: This would fail if ones() is missing.
arr = xp.ones((1, 1))
if category == 'array_attribute':
assert hasattr(arr, name), f"The {xp.__name__} array object is missing the attribute {name}"
else:
assert hasattr(arr, name), f"The {xp.__name__} array object is missing the method {name}()"
else:
> assert hasattr(xp, name), f"{xp.__name__} is missing the {category} function {name}()"
E AssertionError: dpctl.tensor is missing the info function dtypes()
E assert False
E + where False = hasattr(xp, 'dtypes')
array_api_tests/test_has_names.py:37: AssertionError
============================================================================================ short test summary info ============================================================================================
FAILED array_api_tests/test_has_names.py::test_has_names[info-capabilities] - AssertionError: dpctl.tensor is missing the info function capabilities()
FAILED array_api_tests/test_has_names.py::test_has_names[info-default_device] - AssertionError: dpctl.tensor is missing the info function default_device()
FAILED array_api_tests/test_has_names.py::test_has_names[info-default_dtypes] - AssertionError: dpctl.tensor is missing the info function default_dtypes()
FAILED array_api_tests/test_has_names.py::test_has_names[info-devices] - AssertionError: dpctl.tensor is missing the info function devices()
FAILED array_api_tests/test_has_names.py::test_has_names[info-dtypes] - AssertionError: dpctl.tensor is missing the info function dtypes()
========================================================================================= 5 failed, 192 passed in 0.42s =========================================================================================
The specification states that these must be attributes of Info class, not of the main namespace:
In [1]: import dpctl, dpctl.tensor as dpt
In [2]: info = dpt.__array_namespace_info__()
In [3]: hasattr(info, "capabilities")
Out[3]: True
In [4]: hasattr(info, "default_device")
Out[4]: True
In [5]: hasattr(info, "default_dtypes")
Out[5]: True
In [6]: hasattr(info, "devides")
Out[6]: False
In [7]: hasattr(info, "devices")
Out[7]: True
In [8]: hasattr(info,"dtypes")
Out[8]: True
- Dominant language
- Python
- Stars
- 74
- Forks
- 54
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api-tests
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
data-apis/array-api-tests#465 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#460 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#455 · 2 comments ·
-
tracking
Difficulty 5/5 Over a week Newbie friendliness 25/100
data-apis/array-api-tests#381 · 9 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
data-apis/array-api-tests#379 · 10 comments ·
All issues in data-apis/array-api-tests
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·