Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let user decide which cupy version to use #67

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Interface for using cupy in xarray, providing convenience accessors.

## Installation

> `cupy-xarray` will use an existing cupy installation, hence cupy needs to be installed manually! Please follow cupy's install instructions at <https://docs.cupy.dev/en/stable/install.html>.

From anaconda:

```console
Expand Down
12 changes: 11 additions & 1 deletion cupy_xarray/accessors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import warnings
from typing import TYPE_CHECKING, Any

import cupy as cp
try:
import cupy as cp
except ImportError as e:
warnings.warn(
"Cupy is not installed. cupy-xarray expects cupy to be manually installed. Please install "
"cupy by following the instructions at https://docs.cupy.dev/en/stable/install.html.",
ImportWarning,
stacklevel=2,
)
raise e
from xarray import (
DataArray,
Dataset,
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ CuPy-Xarray is a Python library that leverages [CuPy](https://cupy.dev/), a GPU

## Installation

> `cupy-xarray` will use an existing cupy installation, hence cupy needs to be installed manually! Please follow cupy's install instructions at <https://docs.cupy.dev/en/stable/install.html>.

CuPy-Xarray can be installed using `pip` or `conda`:

From Conda Forge:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
"cupy",
"xarray>=2024.02.0",
]

Expand Down
Loading