File tree 3 files changed +13
-9
lines changed
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,10 @@ def result_type(*dtypes: DataType):
346
346
"boolean" : (xp .bool ,),
347
347
"integer" : all_int_dtypes ,
348
348
"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 ,
349
353
"numeric" : numeric_dtypes ,
350
354
"integer or boolean" : bool_and_all_int_dtypes ,
351
355
}
@@ -358,8 +362,6 @@ def result_type(*dtypes: DataType):
358
362
dtype_category = "floating-point"
359
363
dtypes = category_to_dtypes [dtype_category ]
360
364
func_in_dtypes [name ] = dtypes
361
- # See https://github.com/data-apis/array-api/pull/413
362
- func_in_dtypes ["expm1" ] = real_float_dtypes
363
365
364
366
365
367
func_returns_bool = {
Original file line number Diff line number Diff line change 15
15
"extension_to_funcs" ,
16
16
]
17
17
18
+ spec_version = "2022.12"
19
+ spec_module = "_" + spec_version .replace ('.' , '_' )
18
20
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"
20
22
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
22
24
assert sigs_dir .exists ()
23
25
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
27
29
28
30
name_to_mod : Dict [str , ModuleType ] = {}
29
31
for path in sigs_dir .glob ("*.py" ):
30
32
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 } " )
32
34
33
35
array = name_to_mod ["array_object" ].array
34
36
array_methods = [
You can’t perform that action at this time.
0 commit comments