diff --git a/.github/workflows/numpy.yml b/.github/workflows/numpy.yml index c8ab1692..262874e7 100644 --- a/.github/workflows/numpy.yml +++ b/.github/workflows/numpy.yml @@ -23,30 +23,30 @@ jobs: python -m pip install -r requirements.txt - name: Run the test suite env: - XPTESTS_MODULE: numpy.array_api + ARRAY_API_TESTS_MODULE: numpy.array_api run: | # Mark some known issues as XFAIL cat << EOF >> xfails.txt # https://github.com/numpy/numpy/issues/18881 - xptests/test_creation_functions.py::test_linspace + array_api_tests/test_creation_functions.py::test_linspace # einsum is not yet completed in the spec - xptests/test_signatures.py::test_has_names[einsum] + array_api_tests/test_signatures.py::test_has_names[einsum] # dlpack support is not yet implemented in NumPy # See https://github.com/numpy/numpy/pull/19083 - xptests/test_signatures.py::test_function_positional_args[__dlpack__] - xptests/test_signatures.py::test_function_positional_args[__dlpack_device__] - xptests/test_signatures.py::test_function_positional_args[from_dlpack] - xptests/test_signatures.py::test_function_positional_args[to_device] - xptests/test_signatures.py::test_function_keyword_only_args[__dlpack__] + array_api_tests/test_signatures.py::test_function_positional_args[__dlpack__] + array_api_tests/test_signatures.py::test_function_positional_args[__dlpack_device__] + array_api_tests/test_signatures.py::test_function_positional_args[from_dlpack] + array_api_tests/test_signatures.py::test_function_positional_args[to_device] + array_api_tests/test_signatures.py::test_function_keyword_only_args[__dlpack__] # floor_divide has an issue related to https://github.com/data-apis/array-api/issues/264 - xptests/test_elementwise_functions.py::test_floor_divide + array_api_tests/test_elementwise_functions.py::test_floor_divide # mesgrid doesn't return all arrays as the promoted dtype - xptests/test_type_promotion.py::test_meshgrid + array_api_tests/test_type_promotion.py::test_meshgrid # https://github.com/numpy/numpy/pull/20066#issuecomment-947056094 - xptests/test_type_promotion.py::test_where + array_api_tests/test_type_promotion.py::test_where # shape mismatches are not handled - xptests/test_type_promotion.py::test_tensordot + array_api_tests/test_type_promotion.py::test_tensordot EOF diff --git a/README.md b/README.md index 5c649518..438ad5e9 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ Ensure you have the array library that you want to test installed. ### Specifying the array module You need to specify the array library to test. It can be specified via the -`XPTESTS_MODULE` environment variable, e.g. +`ARRAY_API_TESTS_MODULE` environment variable, e.g. ```bash -$ export XPTESTS_MODULE=numpy.array_api +$ export ARRAY_API_TESTS_MODULE=numpy.array_api ``` -Alternately, change the `array_module` variable in `xptests/_array_module.py` +Alternately, change the `array_module` variable in `array_api_tests/_array_module.py` line, e.g. ```diff @@ -37,17 +37,17 @@ line, e.g. ### Run the suite -Simply run `pytest` against the `xptests/` folder to run the full suite. +Simply run `pytest` against the `array_api_tests/` folder to run the full suite. ```bash -$ pytest xptests/ +$ pytest array_api_tests/ ``` The suite tries to logically organise its tests. `pytest` allows you to only run a specific test case, which is useful when developing functions. ```bash -$ pytest xptests/test_creation_functions.py::test_zeros +$ pytest array_api_tests/test_creation_functions.py::test_zeros ``` ## What the test suite covers @@ -104,7 +104,7 @@ of the functions and some miscellaneous things. [constants](https://data-apis.org/array-api/latest/API_specification/constants.html) behave expectedly, are roughly the expected value, and that any related functions interact with them correctly. - + Be aware that some aspects of the spec are impractical or impossible to actually test, so they are not covered in the suite diff --git a/xptests/__init__.py b/array_api_tests/__init__.py similarity index 100% rename from xptests/__init__.py rename to array_api_tests/__init__.py diff --git a/xptests/_array_module.py b/array_api_tests/_array_module.py similarity index 92% rename from xptests/_array_module.py rename to array_api_tests/_array_module.py index 15c50271..3ec4e3c4 100644 --- a/xptests/_array_module.py +++ b/array_api_tests/_array_module.py @@ -9,8 +9,8 @@ array_module = None if array_module is None: - if 'XPTESTS_MODULE' in os.environ: - mod_name = os.environ['XPTESTS_MODULE'] + if 'ARRAY_API_TESTS_MODULE' in os.environ: + mod_name = os.environ['ARRAY_API_TESTS_MODULE'] _module, _sub = mod_name, None if '.' in mod_name: _module, _sub = mod_name.split('.', 1) @@ -24,7 +24,7 @@ # submodules that can be imported (like mxnet.nd). mod = import_module(mod_name) else: - raise RuntimeError("No array module specified. Either edit _array_module.py or set the XPTESTS_MODULE environment variable") + raise RuntimeError("No array module specified. Either edit _array_module.py or set the ARRAY_API_TESTS_MODULE environment variable") else: mod = array_module mod_name = mod.__name__ diff --git a/xptests/algos.py b/array_api_tests/algos.py similarity index 100% rename from xptests/algos.py rename to array_api_tests/algos.py diff --git a/xptests/array_helpers.py b/array_api_tests/array_helpers.py similarity index 100% rename from xptests/array_helpers.py rename to array_api_tests/array_helpers.py diff --git a/xptests/dtype_helpers.py b/array_api_tests/dtype_helpers.py similarity index 100% rename from xptests/dtype_helpers.py rename to array_api_tests/dtype_helpers.py diff --git a/xptests/function_stubs/__init__.py b/array_api_tests/function_stubs/__init__.py similarity index 100% rename from xptests/function_stubs/__init__.py rename to array_api_tests/function_stubs/__init__.py diff --git a/xptests/function_stubs/_types.py b/array_api_tests/function_stubs/_types.py similarity index 100% rename from xptests/function_stubs/_types.py rename to array_api_tests/function_stubs/_types.py diff --git a/xptests/function_stubs/array_object.py b/array_api_tests/function_stubs/array_object.py similarity index 100% rename from xptests/function_stubs/array_object.py rename to array_api_tests/function_stubs/array_object.py diff --git a/xptests/function_stubs/constants.py b/array_api_tests/function_stubs/constants.py similarity index 100% rename from xptests/function_stubs/constants.py rename to array_api_tests/function_stubs/constants.py diff --git a/xptests/function_stubs/creation_functions.py b/array_api_tests/function_stubs/creation_functions.py similarity index 100% rename from xptests/function_stubs/creation_functions.py rename to array_api_tests/function_stubs/creation_functions.py diff --git a/xptests/function_stubs/data_type_functions.py b/array_api_tests/function_stubs/data_type_functions.py similarity index 100% rename from xptests/function_stubs/data_type_functions.py rename to array_api_tests/function_stubs/data_type_functions.py diff --git a/xptests/function_stubs/elementwise_functions.py b/array_api_tests/function_stubs/elementwise_functions.py similarity index 100% rename from xptests/function_stubs/elementwise_functions.py rename to array_api_tests/function_stubs/elementwise_functions.py diff --git a/xptests/function_stubs/linalg.py b/array_api_tests/function_stubs/linalg.py similarity index 100% rename from xptests/function_stubs/linalg.py rename to array_api_tests/function_stubs/linalg.py diff --git a/xptests/function_stubs/linear_algebra_functions.py b/array_api_tests/function_stubs/linear_algebra_functions.py similarity index 100% rename from xptests/function_stubs/linear_algebra_functions.py rename to array_api_tests/function_stubs/linear_algebra_functions.py diff --git a/xptests/function_stubs/manipulation_functions.py b/array_api_tests/function_stubs/manipulation_functions.py similarity index 100% rename from xptests/function_stubs/manipulation_functions.py rename to array_api_tests/function_stubs/manipulation_functions.py diff --git a/xptests/function_stubs/searching_functions.py b/array_api_tests/function_stubs/searching_functions.py similarity index 100% rename from xptests/function_stubs/searching_functions.py rename to array_api_tests/function_stubs/searching_functions.py diff --git a/xptests/function_stubs/set_functions.py b/array_api_tests/function_stubs/set_functions.py similarity index 100% rename from xptests/function_stubs/set_functions.py rename to array_api_tests/function_stubs/set_functions.py diff --git a/xptests/function_stubs/sorting_functions.py b/array_api_tests/function_stubs/sorting_functions.py similarity index 100% rename from xptests/function_stubs/sorting_functions.py rename to array_api_tests/function_stubs/sorting_functions.py diff --git a/xptests/function_stubs/statistical_functions.py b/array_api_tests/function_stubs/statistical_functions.py similarity index 100% rename from xptests/function_stubs/statistical_functions.py rename to array_api_tests/function_stubs/statistical_functions.py diff --git a/xptests/function_stubs/utility_functions.py b/array_api_tests/function_stubs/utility_functions.py similarity index 100% rename from xptests/function_stubs/utility_functions.py rename to array_api_tests/function_stubs/utility_functions.py diff --git a/xptests/hypothesis_helpers.py b/array_api_tests/hypothesis_helpers.py similarity index 100% rename from xptests/hypothesis_helpers.py rename to array_api_tests/hypothesis_helpers.py diff --git a/xptests/meta/__init__.py b/array_api_tests/meta/__init__.py similarity index 100% rename from xptests/meta/__init__.py rename to array_api_tests/meta/__init__.py diff --git a/xptests/meta/test_array_helpers.py b/array_api_tests/meta/test_array_helpers.py similarity index 100% rename from xptests/meta/test_array_helpers.py rename to array_api_tests/meta/test_array_helpers.py diff --git a/xptests/meta/test_broadcasting.py b/array_api_tests/meta/test_broadcasting.py similarity index 100% rename from xptests/meta/test_broadcasting.py rename to array_api_tests/meta/test_broadcasting.py diff --git a/xptests/meta/test_hypothesis_helpers.py b/array_api_tests/meta/test_hypothesis_helpers.py similarity index 100% rename from xptests/meta/test_hypothesis_helpers.py rename to array_api_tests/meta/test_hypothesis_helpers.py diff --git a/xptests/meta/test_partial_adopters.py b/array_api_tests/meta/test_partial_adopters.py similarity index 100% rename from xptests/meta/test_partial_adopters.py rename to array_api_tests/meta/test_partial_adopters.py diff --git a/xptests/meta/test_pytest_helpers.py b/array_api_tests/meta/test_pytest_helpers.py similarity index 100% rename from xptests/meta/test_pytest_helpers.py rename to array_api_tests/meta/test_pytest_helpers.py diff --git a/xptests/meta/test_utils.py b/array_api_tests/meta/test_utils.py similarity index 100% rename from xptests/meta/test_utils.py rename to array_api_tests/meta/test_utils.py diff --git a/xptests/pytest_helpers.py b/array_api_tests/pytest_helpers.py similarity index 100% rename from xptests/pytest_helpers.py rename to array_api_tests/pytest_helpers.py diff --git a/xptests/shape_helpers.py b/array_api_tests/shape_helpers.py similarity index 100% rename from xptests/shape_helpers.py rename to array_api_tests/shape_helpers.py diff --git a/xptests/special_cases/__init__.py b/array_api_tests/special_cases/__init__.py similarity index 100% rename from xptests/special_cases/__init__.py rename to array_api_tests/special_cases/__init__.py diff --git a/xptests/special_cases/test_abs.py b/array_api_tests/special_cases/test_abs.py similarity index 100% rename from xptests/special_cases/test_abs.py rename to array_api_tests/special_cases/test_abs.py diff --git a/xptests/special_cases/test_acos.py b/array_api_tests/special_cases/test_acos.py similarity index 100% rename from xptests/special_cases/test_acos.py rename to array_api_tests/special_cases/test_acos.py diff --git a/xptests/special_cases/test_acosh.py b/array_api_tests/special_cases/test_acosh.py similarity index 100% rename from xptests/special_cases/test_acosh.py rename to array_api_tests/special_cases/test_acosh.py diff --git a/xptests/special_cases/test_add.py b/array_api_tests/special_cases/test_add.py similarity index 100% rename from xptests/special_cases/test_add.py rename to array_api_tests/special_cases/test_add.py diff --git a/xptests/special_cases/test_asin.py b/array_api_tests/special_cases/test_asin.py similarity index 100% rename from xptests/special_cases/test_asin.py rename to array_api_tests/special_cases/test_asin.py diff --git a/xptests/special_cases/test_asinh.py b/array_api_tests/special_cases/test_asinh.py similarity index 100% rename from xptests/special_cases/test_asinh.py rename to array_api_tests/special_cases/test_asinh.py diff --git a/xptests/special_cases/test_atan.py b/array_api_tests/special_cases/test_atan.py similarity index 100% rename from xptests/special_cases/test_atan.py rename to array_api_tests/special_cases/test_atan.py diff --git a/xptests/special_cases/test_atan2.py b/array_api_tests/special_cases/test_atan2.py similarity index 100% rename from xptests/special_cases/test_atan2.py rename to array_api_tests/special_cases/test_atan2.py diff --git a/xptests/special_cases/test_atanh.py b/array_api_tests/special_cases/test_atanh.py similarity index 100% rename from xptests/special_cases/test_atanh.py rename to array_api_tests/special_cases/test_atanh.py diff --git a/xptests/special_cases/test_ceil.py b/array_api_tests/special_cases/test_ceil.py similarity index 100% rename from xptests/special_cases/test_ceil.py rename to array_api_tests/special_cases/test_ceil.py diff --git a/xptests/special_cases/test_cos.py b/array_api_tests/special_cases/test_cos.py similarity index 100% rename from xptests/special_cases/test_cos.py rename to array_api_tests/special_cases/test_cos.py diff --git a/xptests/special_cases/test_cosh.py b/array_api_tests/special_cases/test_cosh.py similarity index 100% rename from xptests/special_cases/test_cosh.py rename to array_api_tests/special_cases/test_cosh.py diff --git a/xptests/special_cases/test_divide.py b/array_api_tests/special_cases/test_divide.py similarity index 100% rename from xptests/special_cases/test_divide.py rename to array_api_tests/special_cases/test_divide.py diff --git a/xptests/special_cases/test_dunder_abs.py b/array_api_tests/special_cases/test_dunder_abs.py similarity index 100% rename from xptests/special_cases/test_dunder_abs.py rename to array_api_tests/special_cases/test_dunder_abs.py diff --git a/xptests/special_cases/test_dunder_add.py b/array_api_tests/special_cases/test_dunder_add.py similarity index 100% rename from xptests/special_cases/test_dunder_add.py rename to array_api_tests/special_cases/test_dunder_add.py diff --git a/xptests/special_cases/test_dunder_iadd.py b/array_api_tests/special_cases/test_dunder_iadd.py similarity index 100% rename from xptests/special_cases/test_dunder_iadd.py rename to array_api_tests/special_cases/test_dunder_iadd.py diff --git a/xptests/special_cases/test_dunder_imul.py b/array_api_tests/special_cases/test_dunder_imul.py similarity index 100% rename from xptests/special_cases/test_dunder_imul.py rename to array_api_tests/special_cases/test_dunder_imul.py diff --git a/xptests/special_cases/test_dunder_ipow.py b/array_api_tests/special_cases/test_dunder_ipow.py similarity index 100% rename from xptests/special_cases/test_dunder_ipow.py rename to array_api_tests/special_cases/test_dunder_ipow.py diff --git a/xptests/special_cases/test_dunder_itruediv.py b/array_api_tests/special_cases/test_dunder_itruediv.py similarity index 100% rename from xptests/special_cases/test_dunder_itruediv.py rename to array_api_tests/special_cases/test_dunder_itruediv.py diff --git a/xptests/special_cases/test_dunder_mul.py b/array_api_tests/special_cases/test_dunder_mul.py similarity index 100% rename from xptests/special_cases/test_dunder_mul.py rename to array_api_tests/special_cases/test_dunder_mul.py diff --git a/xptests/special_cases/test_dunder_pow.py b/array_api_tests/special_cases/test_dunder_pow.py similarity index 100% rename from xptests/special_cases/test_dunder_pow.py rename to array_api_tests/special_cases/test_dunder_pow.py diff --git a/xptests/special_cases/test_dunder_truediv.py b/array_api_tests/special_cases/test_dunder_truediv.py similarity index 100% rename from xptests/special_cases/test_dunder_truediv.py rename to array_api_tests/special_cases/test_dunder_truediv.py diff --git a/xptests/special_cases/test_exp.py b/array_api_tests/special_cases/test_exp.py similarity index 100% rename from xptests/special_cases/test_exp.py rename to array_api_tests/special_cases/test_exp.py diff --git a/xptests/special_cases/test_expm1.py b/array_api_tests/special_cases/test_expm1.py similarity index 100% rename from xptests/special_cases/test_expm1.py rename to array_api_tests/special_cases/test_expm1.py diff --git a/xptests/special_cases/test_floor.py b/array_api_tests/special_cases/test_floor.py similarity index 100% rename from xptests/special_cases/test_floor.py rename to array_api_tests/special_cases/test_floor.py diff --git a/xptests/special_cases/test_log.py b/array_api_tests/special_cases/test_log.py similarity index 100% rename from xptests/special_cases/test_log.py rename to array_api_tests/special_cases/test_log.py diff --git a/xptests/special_cases/test_log10.py b/array_api_tests/special_cases/test_log10.py similarity index 100% rename from xptests/special_cases/test_log10.py rename to array_api_tests/special_cases/test_log10.py diff --git a/xptests/special_cases/test_log1p.py b/array_api_tests/special_cases/test_log1p.py similarity index 100% rename from xptests/special_cases/test_log1p.py rename to array_api_tests/special_cases/test_log1p.py diff --git a/xptests/special_cases/test_log2.py b/array_api_tests/special_cases/test_log2.py similarity index 100% rename from xptests/special_cases/test_log2.py rename to array_api_tests/special_cases/test_log2.py diff --git a/xptests/special_cases/test_logaddexp.py b/array_api_tests/special_cases/test_logaddexp.py similarity index 100% rename from xptests/special_cases/test_logaddexp.py rename to array_api_tests/special_cases/test_logaddexp.py diff --git a/xptests/special_cases/test_multiply.py b/array_api_tests/special_cases/test_multiply.py similarity index 100% rename from xptests/special_cases/test_multiply.py rename to array_api_tests/special_cases/test_multiply.py diff --git a/xptests/special_cases/test_pow.py b/array_api_tests/special_cases/test_pow.py similarity index 100% rename from xptests/special_cases/test_pow.py rename to array_api_tests/special_cases/test_pow.py diff --git a/xptests/special_cases/test_round.py b/array_api_tests/special_cases/test_round.py similarity index 100% rename from xptests/special_cases/test_round.py rename to array_api_tests/special_cases/test_round.py diff --git a/xptests/special_cases/test_sign.py b/array_api_tests/special_cases/test_sign.py similarity index 100% rename from xptests/special_cases/test_sign.py rename to array_api_tests/special_cases/test_sign.py diff --git a/xptests/special_cases/test_sin.py b/array_api_tests/special_cases/test_sin.py similarity index 100% rename from xptests/special_cases/test_sin.py rename to array_api_tests/special_cases/test_sin.py diff --git a/xptests/special_cases/test_sinh.py b/array_api_tests/special_cases/test_sinh.py similarity index 100% rename from xptests/special_cases/test_sinh.py rename to array_api_tests/special_cases/test_sinh.py diff --git a/xptests/special_cases/test_sqrt.py b/array_api_tests/special_cases/test_sqrt.py similarity index 100% rename from xptests/special_cases/test_sqrt.py rename to array_api_tests/special_cases/test_sqrt.py diff --git a/xptests/special_cases/test_tan.py b/array_api_tests/special_cases/test_tan.py similarity index 100% rename from xptests/special_cases/test_tan.py rename to array_api_tests/special_cases/test_tan.py diff --git a/xptests/special_cases/test_tanh.py b/array_api_tests/special_cases/test_tanh.py similarity index 100% rename from xptests/special_cases/test_tanh.py rename to array_api_tests/special_cases/test_tanh.py diff --git a/xptests/special_cases/test_trunc.py b/array_api_tests/special_cases/test_trunc.py similarity index 100% rename from xptests/special_cases/test_trunc.py rename to array_api_tests/special_cases/test_trunc.py diff --git a/xptests/test_array_object.py b/array_api_tests/test_array_object.py similarity index 100% rename from xptests/test_array_object.py rename to array_api_tests/test_array_object.py diff --git a/xptests/test_constants.py b/array_api_tests/test_constants.py similarity index 100% rename from xptests/test_constants.py rename to array_api_tests/test_constants.py diff --git a/xptests/test_creation_functions.py b/array_api_tests/test_creation_functions.py similarity index 100% rename from xptests/test_creation_functions.py rename to array_api_tests/test_creation_functions.py diff --git a/xptests/test_linalg.py b/array_api_tests/test_linalg.py similarity index 100% rename from xptests/test_linalg.py rename to array_api_tests/test_linalg.py diff --git a/xptests/test_manipulation_functions.py b/array_api_tests/test_manipulation_functions.py similarity index 100% rename from xptests/test_manipulation_functions.py rename to array_api_tests/test_manipulation_functions.py diff --git a/xptests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py similarity index 100% rename from xptests/test_operators_and_elementwise_functions.py rename to array_api_tests/test_operators_and_elementwise_functions.py diff --git a/xptests/test_searching_functions.py b/array_api_tests/test_searching_functions.py similarity index 100% rename from xptests/test_searching_functions.py rename to array_api_tests/test_searching_functions.py diff --git a/xptests/test_set_functions.py b/array_api_tests/test_set_functions.py similarity index 100% rename from xptests/test_set_functions.py rename to array_api_tests/test_set_functions.py diff --git a/xptests/test_signatures.py b/array_api_tests/test_signatures.py similarity index 100% rename from xptests/test_signatures.py rename to array_api_tests/test_signatures.py diff --git a/xptests/test_sorting_functions.py b/array_api_tests/test_sorting_functions.py similarity index 98% rename from xptests/test_sorting_functions.py rename to array_api_tests/test_sorting_functions.py index 3a527ff7..569da571 100644 --- a/xptests/test_sorting_functions.py +++ b/array_api_tests/test_sorting_functions.py @@ -5,7 +5,7 @@ from hypothesis import strategies as st from hypothesis.control import assume -from xptests.typing import Scalar, ScalarType, Shape +from .typing import Scalar, ScalarType, Shape from . import _array_module as xp from . import dtype_helpers as dh diff --git a/xptests/test_statistical_functions.py b/array_api_tests/test_statistical_functions.py similarity index 100% rename from xptests/test_statistical_functions.py rename to array_api_tests/test_statistical_functions.py diff --git a/xptests/test_type_promotion.py b/array_api_tests/test_type_promotion.py similarity index 100% rename from xptests/test_type_promotion.py rename to array_api_tests/test_type_promotion.py diff --git a/xptests/test_utility_functions.py b/array_api_tests/test_utility_functions.py similarity index 100% rename from xptests/test_utility_functions.py rename to array_api_tests/test_utility_functions.py diff --git a/xptests/typing.py b/array_api_tests/typing.py similarity index 100% rename from xptests/typing.py rename to array_api_tests/typing.py diff --git a/conftest.py b/conftest.py index cf4a5028..64c46df7 100644 --- a/conftest.py +++ b/conftest.py @@ -4,8 +4,8 @@ from pytest import mark from hypothesis import settings -from xptests import _array_module as xp -from xptests._array_module import _UndefinedStub +from array_api_tests import _array_module as xp +from array_api_tests._array_module import _UndefinedStub settings.register_profile('xp_default', deadline=800) @@ -77,7 +77,7 @@ def xp_has_ext(ext: str) -> bool: if xfails_path.exists(): with open(xfails_path) as f: for line in f: - if line.startswith('xptests'): + if line.startswith('array_api_tests'): id_ = line.strip('\n') xfail_ids.append(id_) diff --git a/generate_stubs.py b/generate_stubs.py index ed2e8a43..3dcde542 100755 --- a/generate_stubs.py +++ b/generate_stubs.py @@ -7,7 +7,7 @@ ./generate_stubs.py path/to/clone/of/array-api -This will update the stub files in xptests/function_stubs/ +This will update the stub files in array_api_tests/function_stubs/ """ from __future__ import annotations @@ -218,12 +218,12 @@ def main(): parser.add_argument('-v', '--verbose', help="Print verbose output to the terminal", action='store_true') args = parser.parse_args() - types_path = os.path.join('xptests', 'function_stubs', '_types.py') + types_path = os.path.join('array_api_tests', 'function_stubs', '_types.py') if args.write: with open(types_path, 'w') as f: f.write(TYPES_HEADER) - special_cases_dir = Path('xptests/special_cases') + special_cases_dir = Path('array_api_tests/special_cases') special_cases_dir.mkdir(exist_ok=True) (special_cases_dir / '__init__.py').touch() @@ -256,7 +256,7 @@ def main(): title += " (Extension)" else: py_file = filename.replace('.md', '.py') - py_path = os.path.join('xptests', 'function_stubs', py_file) + py_path = os.path.join('array_api_tests', 'function_stubs', py_file) module_name = py_file.replace('.py', '') modules[module_name] = [] if args.verbose: @@ -342,7 +342,7 @@ def {annotated_sig}:{doc} if filename == 'elementwise_functions.md': special_cases = parse_special_cases(text, verbose=args.verbose) for func in special_cases: - py_path = os.path.join('xptests', 'special_cases', f'test_{func}.py') + py_path = os.path.join('array_api_tests', 'special_cases', f'test_{func}.py') tests = make_special_case_tests(func, special_cases, sigs) if tests: code = SPECIAL_CASES_HEADER.format(func=func) + '\n'.join(tests) @@ -354,7 +354,7 @@ def {annotated_sig}:{doc} elif filename == 'array_object.md': op_special_cases = parse_special_cases(text, verbose=args.verbose) for func in op_special_cases: - py_path = os.path.join('xptests', 'special_cases', f'test_dunder_{func[2:-2]}.py') + py_path = os.path.join('array_api_tests', 'special_cases', f'test_dunder_{func[2:-2]}.py') tests = make_special_case_tests(func, op_special_cases, sigs) if tests: code = OP_SPECIAL_CASES_HEADER.format(func=func) + '\n'.join(tests) @@ -368,7 +368,7 @@ def {annotated_sig}:{doc} iop = f"__i{name}__" iop_special_cases[iop] = op_special_cases[op] for func in iop_special_cases: - py_path = os.path.join('xptests', 'special_cases', f'test_dunder_{func[2:-2]}.py') + py_path = os.path.join('array_api_tests', 'special_cases', f'test_dunder_{func[2:-2]}.py') tests = make_special_case_tests(func, iop_special_cases, sigs) if tests: code = IOP_SPECIAL_CASES_HEADER.format(func=func, operator=func[2:-2]) + '\n'.join(tests) @@ -377,7 +377,7 @@ def {annotated_sig}:{doc} with open(py_path, 'w') as f: f.write(code) - init_path = os.path.join('xptests', 'function_stubs', '__init__.py') + init_path = os.path.join('array_api_tests', 'function_stubs', '__init__.py') if args.write: with open(init_path, 'w') as f: f.write(INIT_HEADER)