diff --git a/array_api_compat/common/_helpers.py b/array_api_compat/common/_helpers.py index 5e59c7ea..e5e80f8e 100644 --- a/array_api_compat/common/_helpers.py +++ b/array_api_compat/common/_helpers.py @@ -16,6 +16,7 @@ import sys import math import inspect +import warnings def is_numpy_array(x): # Avoid importing NumPy if it isn't already @@ -77,8 +78,10 @@ def is_array_api_obj(x): or hasattr(x, '__array_namespace__') def _check_api_version(api_version): - if api_version is not None and api_version != '2021.12': - raise ValueError("Only the 2021.12 version of the array API specification is currently supported") + if api_version == '2021.12': + warnings.warn("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12") + elif api_version is not None and api_version != '2022.12': + raise ValueError("Only the 2022.12 version of the array API specification is currently supported") def array_namespace(*xs, api_version=None, _use_compat=True): """