File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1616import sys
1717import math
1818import inspect
19+ import warnings
1920
2021def is_numpy_array (x ):
2122 # Avoid importing NumPy if it isn't already
@@ -77,8 +78,10 @@ def is_array_api_obj(x):
7778 or hasattr (x , '__array_namespace__' )
7879
7980def _check_api_version (api_version ):
80- if api_version is not None and api_version != '2021.12' :
81- raise ValueError ("Only the 2021.12 version of the array API specification is currently supported" )
81+ if api_version == '2021.12' :
82+ warnings .warn ("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12" )
83+ elif api_version is not None and api_version != '2022.12' :
84+ raise ValueError ("Only the 2022.12 version of the array API specification is currently supported" )
8285
8386def array_namespace (* xs , api_version = None , _use_compat = True ):
8487 """
You can’t perform that action at this time.
0 commit comments