Get a version of the given `array` in a different `dst_flavor`. The flavor of the input `array` is guessed, and the returned array will be of the given `dst_flavor`. If the conversion is not supported, a ``FlavorError`` is raised.
(
array: npt.ArrayLike, dst_flavor: FlavorType
)
| 204 | |
| 205 | |
| 206 | def array_of_flavor( |
| 207 | array: npt.ArrayLike, dst_flavor: FlavorType |
| 208 | ) -> Any | list[Any] | np.ndarray: |
| 209 | """Get a version of the given `array` in a different `dst_flavor`. |
| 210 | |
| 211 | The flavor of the input `array` is guessed, and the returned array |
| 212 | will be of the given `dst_flavor`. |
| 213 | |
| 214 | If the conversion is not supported, a ``FlavorError`` is raised. |
| 215 | |
| 216 | """ |
| 217 | return array_of_flavor2(array, flavor_of(array), dst_flavor) |
| 218 | |
| 219 | |
| 220 | def restrict_flavors(keep: Sequence[FlavorType] = ("python",)) -> None: |
no test coverage detected