diff --git a/array-api b/array-api index c5808f2b..ab69aa24 160000 --- a/array-api +++ b/array-api @@ -1 +1 @@ -Subproject commit c5808f2b173ea52d813c450bec7b1beaf2973299 +Subproject commit ab69aa240025ff1d52525ce3859b69ebfd6b7faf diff --git a/array_api_tests/dtype_helpers.py b/array_api_tests/dtype_helpers.py index 9c2f3bfe..8d3bdf97 100644 --- a/array_api_tests/dtype_helpers.py +++ b/array_api_tests/dtype_helpers.py @@ -352,6 +352,9 @@ def result_type(*dtypes: DataType): "boolean": (xp.bool,), "integer": all_int_dtypes, "floating-point": real_float_dtypes, + "real-valued": real_float_dtypes, + "real-valued floating-point": real_float_dtypes, + "complex floating-point": complex_dtypes, "numeric": numeric_dtypes, "integer or boolean": bool_and_all_int_dtypes, } @@ -364,8 +367,6 @@ def result_type(*dtypes: DataType): dtype_category = "floating-point" dtypes = category_to_dtypes[dtype_category] func_in_dtypes[name] = dtypes -# See https://github.com/data-apis/array-api/pull/413 -func_in_dtypes["expm1"] = real_float_dtypes func_returns_bool = { diff --git a/array_api_tests/stubs.py b/array_api_tests/stubs.py index 0134765b..628c74c0 100644 --- a/array_api_tests/stubs.py +++ b/array_api_tests/stubs.py @@ -15,20 +15,22 @@ "extension_to_funcs", ] +spec_version = "2022.12" +spec_module = "_" + spec_version.replace('.', '_') -spec_dir = Path(__file__).parent.parent / "array-api" / "spec" / "API_specification" +spec_dir = Path(__file__).parent.parent / "array-api" / "spec" / spec_version / "API_specification" assert spec_dir.exists(), f"{spec_dir} not found - try `git submodule update --init`" -sigs_dir = spec_dir / "signatures" +sigs_dir = Path(__file__).parent.parent / "array-api" / "src" / "array_api_stubs" / spec_module assert sigs_dir.exists() -spec_abs_path: str = str(spec_dir.resolve()) -sys.path.append(spec_abs_path) -assert find_spec("signatures") is not None +sigs_abs_path: str = str(sigs_dir.parent.parent.resolve()) +sys.path.append(sigs_abs_path) +assert find_spec(f"array_api_stubs.{spec_module}") is not None name_to_mod: Dict[str, ModuleType] = {} for path in sigs_dir.glob("*.py"): name = path.name.replace(".py", "") - name_to_mod[name] = import_module(f"signatures.{name}") + name_to_mod[name] = import_module(f"array_api_stubs.{spec_module}.{name}") array = name_to_mod["array_object"].array array_methods = [ diff --git a/array_api_tests/test_special_cases.py b/array_api_tests/test_special_cases.py index 345d7fe5..be031afa 100644 --- a/array_api_tests/test_special_cases.py +++ b/array_api_tests/test_special_cases.py @@ -1197,6 +1197,10 @@ def parse_binary_case_block(case_block: str) -> List[BinaryCase]: # its False - Hypothesis will complain if we reject too many examples, thus # indicating we've done something wrong. +assert len(unary_params) != 0 # sanity check +assert len(binary_params) != 0 # sanity check +assert len(iop_params) != 0 # sanity check + @pytest.mark.parametrize("func_name, func, case", unary_params) @given(