MCPcopy Create free account
hub / github.com/PyTables/PyTables / array_of_flavor

Function array_of_flavor

tables/flavor.py:206–217  ·  view source on GitHub ↗

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
)

Source from the content-addressed store, hash-verified

204
205
206def 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
220def restrict_flavors(keep: Sequence[FlavorType] = ("python",)) -> None:

Callers 1

convert_to_np_atomFunction · 0.85

Calls 2

array_of_flavor2Function · 0.85
flavor_ofFunction · 0.85

Tested by

no test coverage detected