test_has_names fails on info category checked main namespace, instead of class attributes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với array_api_tests/test_has_names.py và kiểm tra cách xử lý test_has_names cho danh mục info. Chạy các trường hợp kiểm thử được tham số hóa đang thất bại, sử dụng array_namespace_info() làm đối tượng cần kiểm tra. Hoàn thành khi năm tên info được xác thực trên đối tượng Info và bộ kiểm thử chạy thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
__________________________________________________________________________________________ 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
- Ngôn ngữ chính
- Python
- Star
- 74
- Fork
- 54
- Merge trung bình
- 4 giờ 35 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của data-apis/array-api-tests
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
data-apis/array-api-tests#465 · 1 bình luận ·
-
Test reflected operators? Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
data-apis/array-api-tests#460 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
data-apis/array-api-tests#455 · 2 bình luận ·
-
tracking
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
data-apis/array-api-tests#381 · 9 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
data-apis/array-api-tests#379 · 10 bình luận ·
Tất cả issue của data-apis/array-api-tests
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·