-
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.
feat: initial array object implementation (#1)
* feat: initial array object implementation * do something with no errors * bump minimal support version to 3.9 for a typing feature * Implemented a few more features. * Move 'import cupy' to an _import module. * Added property and method docstrings and stubs from the specification. * Added in-place and reflected operator implementations. * Move code out of __init__.py. * Final directory rearrangement. * Make files distinct by adding docstrings.
- Loading branch information
Showing
12 changed files
with
1,035 additions
and
29 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
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
""" | ||
Copyright (c) 2023 Jim Pivarski. All rights reserved. | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
ragged: Ragged array library, complying with Python API specification. | ||
""" | ||
Ragged array module. | ||
FIXME: needs more documentation! | ||
from __future__ import annotations | ||
Version 2022.12 is current, so `ragged.v202212.*` is identical to `ragged.*`. | ||
""" | ||
|
||
from ._version import version as __version__ | ||
from __future__ import annotations | ||
|
||
__all__ = ["__version__"] | ||
from .v202212 import * # noqa: F403 |
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,14 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
""" | ||
Generic definitions used by the version-specific modules, such as | ||
`ragged.v202212`. | ||
https://data-apis.org/array-api/latest/API_specification/ | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from ._obj import array | ||
|
||
__all__ = ["array"] |
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,22 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
|
||
def cupy() -> Any: | ||
try: | ||
import cupy as cp # pylint: disable=C0415 | ||
|
||
return cp | ||
except ModuleNotFoundError as err: | ||
error_message = """to use the "cuda" backend, you must install cupy: | ||
pip install cupy | ||
or | ||
conda install -c conda-forge cupy | ||
""" | ||
raise ModuleNotFoundError(error_message) from err |
Oops, something went wrong.