-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
""" | ||
https://data-apis.org/array-api/latest/API_specification/data_type_functions.html | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from ._obj import array | ||
from ._typing import ( | ||
Dtype, | ||
) | ||
|
||
|
||
def astype(x: array, dtype: Dtype, /, *, copy: bool = True) -> array: | ||
""" | ||
Copies an array to a specified data type irrespective of type promotion rules. | ||
Args: | ||
x: Array to cast. | ||
dtype: Desired data type. | ||
copy: Specifies whether to copy an array when the specified `dtype` | ||
matches the data type of the input array `x`. If `True`, a newly | ||
allocated array is always returned. If `False` and the specified | ||
`dtype` matches the data type of the input array, the input array | ||
is returned; otherwise, a newly allocated array is returned. | ||
Returns: | ||
An array having the specified data type. The returned array has the | ||
same `shape` as `x`. | ||
https://data-apis.org/array-api/latest/API_specification/generated/array_api.astype.html | ||
""" | ||
|
||
assert x, "TODO" | ||
assert dtype, "TODO" | ||
assert copy, "TODO" | ||
assert False, "TODO" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
""" | ||
https://data-apis.org/array-api/2022.12/API_specification/creation_functions.html | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from ..common._datatype import ( | ||
astype, | ||
) | ||
|
||
__all__ = [ | ||
"astype", | ||
] |