File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,10 @@ def result_type(*dtypes: DataType):
352352 "boolean" : (xp .bool ,),
353353 "integer" : all_int_dtypes ,
354354 "floating-point" : real_float_dtypes ,
355+ "real-valued" : real_float_dtypes ,
356+ "real-valued floating-point" : real_float_dtypes ,
357+ "complex floating-point" : complex_dtypes ,
358+ "complex-floating point" : complex_dtypes ,
355359 "numeric" : numeric_dtypes ,
356360 "integer or boolean" : bool_and_all_int_dtypes ,
357361}
@@ -364,8 +368,6 @@ def result_type(*dtypes: DataType):
364368 dtype_category = "floating-point"
365369 dtypes = category_to_dtypes [dtype_category ]
366370 func_in_dtypes [name ] = dtypes
367- # See https://github.com/data-apis/array-api/pull/413
368- func_in_dtypes ["expm1" ] = real_float_dtypes
369371
370372
371373func_returns_bool = {
Original file line number Diff line number Diff line change 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"
2022assert 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
2224assert 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
2830name_to_mod : Dict [str , ModuleType ] = {}
2931for 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
3335array = name_to_mod ["array_object" ].array
3436array_methods = [
You can’t perform that action at this time.
0 commit comments