|
24 | 24 | "2023.12",
|
25 | 25 | )
|
26 | 26 |
|
| 27 | +draft_version = "2024.12" |
| 28 | + |
27 | 29 | API_VERSION = default_version = "2023.12"
|
28 | 30 |
|
29 | 31 | BOOLEAN_INDEXING = True
|
@@ -70,8 +72,8 @@ def set_array_api_strict_flags(
|
70 | 72 | ----------
|
71 | 73 | api_version : str, optional
|
72 | 74 | The version of the standard to use. Supported versions are:
|
73 |
| - ``{supported_versions}``. The default version number is |
74 |
| - ``{default_version!r}``. |
| 75 | + ``{supported_versions}``, plus the draft version ``{draft_version}``. |
| 76 | + The default version number is ``{default_version!r}``. |
75 | 77 |
|
76 | 78 | Note that 2021.12 is supported, but currently gives the same thing as
|
77 | 79 | 2022.12 (except that the fft extension will be disabled).
|
@@ -134,10 +136,12 @@ def set_array_api_strict_flags(
|
134 | 136 | global API_VERSION, BOOLEAN_INDEXING, DATA_DEPENDENT_SHAPES, ENABLED_EXTENSIONS
|
135 | 137 |
|
136 | 138 | if api_version is not None:
|
137 |
| - if api_version not in supported_versions: |
| 139 | + if api_version not in [*supported_versions, draft_version]: |
138 | 140 | raise ValueError(f"Unsupported standard version {api_version!r}")
|
139 | 141 | if api_version == "2021.12":
|
140 | 142 | warnings.warn("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12", stacklevel=2)
|
| 143 | + if api_version == draft_version: |
| 144 | + warnings.warn(f"The {draft_version} version of the array API specification is in draft status. Not all features are implemented in array_api_strict, and behaviors are subject to change before the final standard release.") |
141 | 145 | API_VERSION = api_version
|
142 | 146 | array_api_strict.__array_api_version__ = API_VERSION
|
143 | 147 |
|
@@ -169,6 +173,7 @@ def set_array_api_strict_flags(
|
169 | 173 | supported_versions=supported_versions,
|
170 | 174 | default_version=default_version,
|
171 | 175 | default_extensions=default_extensions,
|
| 176 | + draft_version=draft_version, |
172 | 177 | )
|
173 | 178 |
|
174 | 179 | def get_array_api_strict_flags():
|
|
0 commit comments