Skip to content

Commit f723e08

Browse files
jakevdphonno
authored andcommitted
Update to most recent array-api commit
1 parent 83f0bcd commit f723e08

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Diff for: array-api

Submodule array-api updated 211 files

Diff for: array_api_tests/dtype_helpers.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ def result_type(*dtypes: DataType):
346346
"boolean": (xp.bool,),
347347
"integer": all_int_dtypes,
348348
"floating-point": real_float_dtypes,
349+
"real-valued": real_float_dtypes,
350+
"real-valued floating-point": real_float_dtypes,
351+
"complex floating-point": complex_dtypes,
352+
"complex-floating point": complex_dtypes,
349353
"numeric": numeric_dtypes,
350354
"integer or boolean": bool_and_all_int_dtypes,
351355
}
@@ -358,8 +362,6 @@ def result_type(*dtypes: DataType):
358362
dtype_category = "floating-point"
359363
dtypes = category_to_dtypes[dtype_category]
360364
func_in_dtypes[name] = dtypes
361-
# See https://github.com/data-apis/array-api/pull/413
362-
func_in_dtypes["expm1"] = real_float_dtypes
363365

364366

365367
func_returns_bool = {

Diff for: array_api_tests/stubs.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@
1515
"extension_to_funcs",
1616
]
1717

18+
spec_version = "2022.12"
19+
spec_module = "_" + spec_version.replace('.', '_')
1820

19-
spec_dir = Path(__file__).parent.parent / "array-api" / "spec" / "API_specification"
21+
spec_dir = Path(__file__).parent.parent / "array-api" / "spec" / spec_version / "API_specification"
2022
assert spec_dir.exists(), f"{spec_dir} not found - try `git submodule update --init`"
21-
sigs_dir = spec_dir / "signatures"
23+
sigs_dir = Path(__file__).parent.parent / "array-api" / "src" / "array_api_stubs" / spec_module
2224
assert sigs_dir.exists()
2325

24-
spec_abs_path: str = str(spec_dir.resolve())
25-
sys.path.append(spec_abs_path)
26-
assert find_spec("signatures") is not None
26+
sigs_abs_path: str = str(sigs_dir.parent.parent.resolve())
27+
sys.path.append(sigs_abs_path)
28+
assert find_spec(f"array_api_stubs.{spec_module}") is not None
2729

2830
name_to_mod: Dict[str, ModuleType] = {}
2931
for path in sigs_dir.glob("*.py"):
3032
name = path.name.replace(".py", "")
31-
name_to_mod[name] = import_module(f"signatures.{name}")
33+
name_to_mod[name] = import_module(f"array_api_stubs.{spec_module}.{name}")
3234

3335
array = name_to_mod["array_object"].array
3436
array_methods = [

0 commit comments

Comments
 (0)