7
7
8
8
./generate_stubs.py path/to/clone/of/array-api
9
9
10
- This will update the stub files in array_api_tests /function_stubs/
10
+ This will update the stub files in xptests /function_stubs/
11
11
"""
12
12
from __future__ import annotations
13
13
@@ -218,12 +218,12 @@ def main():
218
218
parser .add_argument ('-v' , '--verbose' , help = "Print verbose output to the terminal" , action = 'store_true' )
219
219
args = parser .parse_args ()
220
220
221
- types_path = os .path .join ('array_api_tests ' , 'function_stubs' , '_types.py' )
221
+ types_path = os .path .join ('xptests ' , 'function_stubs' , '_types.py' )
222
222
if args .write :
223
223
with open (types_path , 'w' ) as f :
224
224
f .write (TYPES_HEADER )
225
225
226
- special_cases_dir = Path ('array_api_tests /special_cases' )
226
+ special_cases_dir = Path ('xptests /special_cases' )
227
227
special_cases_dir .mkdir (exist_ok = True )
228
228
(special_cases_dir / '__init__.py' ).touch ()
229
229
@@ -256,7 +256,7 @@ def main():
256
256
title += " (Extension)"
257
257
else :
258
258
py_file = filename .replace ('.md' , '.py' )
259
- py_path = os .path .join ('array_api_tests ' , 'function_stubs' , py_file )
259
+ py_path = os .path .join ('xptests ' , 'function_stubs' , py_file )
260
260
module_name = py_file .replace ('.py' , '' )
261
261
modules [module_name ] = []
262
262
if args .verbose :
@@ -342,7 +342,7 @@ def {annotated_sig}:{doc}
342
342
if filename == 'elementwise_functions.md' :
343
343
special_cases = parse_special_cases (text , verbose = args .verbose )
344
344
for func in special_cases :
345
- py_path = os .path .join ('array_api_tests ' , 'special_cases' , f'test_{ func } .py' )
345
+ py_path = os .path .join ('xptests ' , 'special_cases' , f'test_{ func } .py' )
346
346
tests = make_special_case_tests (func , special_cases , sigs )
347
347
if tests :
348
348
code = SPECIAL_CASES_HEADER .format (func = func ) + '\n ' .join (tests )
@@ -354,7 +354,7 @@ def {annotated_sig}:{doc}
354
354
elif filename == 'array_object.md' :
355
355
op_special_cases = parse_special_cases (text , verbose = args .verbose )
356
356
for func in op_special_cases :
357
- py_path = os .path .join ('array_api_tests ' , 'special_cases' , f'test_dunder_{ func [2 :- 2 ]} .py' )
357
+ py_path = os .path .join ('xptests ' , 'special_cases' , f'test_dunder_{ func [2 :- 2 ]} .py' )
358
358
tests = make_special_case_tests (func , op_special_cases , sigs )
359
359
if tests :
360
360
code = OP_SPECIAL_CASES_HEADER .format (func = func ) + '\n ' .join (tests )
@@ -368,7 +368,7 @@ def {annotated_sig}:{doc}
368
368
iop = f"__i{ name } __"
369
369
iop_special_cases [iop ] = op_special_cases [op ]
370
370
for func in iop_special_cases :
371
- py_path = os .path .join ('array_api_tests ' , 'special_cases' , f'test_dunder_{ func [2 :- 2 ]} .py' )
371
+ py_path = os .path .join ('xptests ' , 'special_cases' , f'test_dunder_{ func [2 :- 2 ]} .py' )
372
372
tests = make_special_case_tests (func , iop_special_cases , sigs )
373
373
if tests :
374
374
code = IOP_SPECIAL_CASES_HEADER .format (func = func , operator = func [2 :- 2 ]) + '\n ' .join (tests )
@@ -377,7 +377,7 @@ def {annotated_sig}:{doc}
377
377
with open (py_path , 'w' ) as f :
378
378
f .write (code )
379
379
380
- init_path = os .path .join ('array_api_tests ' , 'function_stubs' , '__init__.py' )
380
+ init_path = os .path .join ('xptests ' , 'function_stubs' , '__init__.py' )
381
381
if args .write :
382
382
with open (init_path , 'w' ) as f :
383
383
f .write (INIT_HEADER )
0 commit comments