-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy-edit the examples for consistency
- Loading branch information
1 parent
bff49a4
commit ad5f583
Showing
19 changed files
with
83 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "numpy-linalg-example" | ||
name = "rust-linalg" | ||
version = "0.1.0" | ||
authors = ["Yuji Kanagawa <[email protected]>"] | ||
edition = "2018" | ||
|
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,8 +1,7 @@ | ||
# rust-numpy example extension with linalg | ||
# rust-numpy extension using ndarray-linalg | ||
|
||
An example extension with [ndarray-linalg](https://github.com/rust-ndarray/ndarray-linalg). | ||
An example extension using [ndarray-linalg](https://github.com/rust-ndarray/ndarray-linalg). | ||
|
||
Will link against a system-provided OpenBLAS. | ||
|
||
See [simple-extension's README](https://github.com/PyO3/rust-numpy/blob/main/examples/simple-extension/README.md) | ||
for an introduction. | ||
See the [README](../simple/README.md) of the simple extension for more information. |
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,5 +1,5 @@ | ||
[package] | ||
name = "numpy-parallel-example" | ||
name = "rust-parallel" | ||
version = "0.1.0" | ||
authors = ["Yuji Kanagawa <[email protected]>"] | ||
edition = "2018" | ||
|
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,7 +1,5 @@ | ||
# rust-numpy example extension using optional ndarray features | ||
# rust-numpy extension using optional ndarray features | ||
|
||
An example extension using [optional ndarray features](https://docs.rs/ndarray/latest/ndarray/doc/crate_feature_flags/index.html), parallel execution using Rayon and optimized kernels using BLAS in this case. | ||
|
||
See [simple-extension's README](https://github.com/PyO3/rust-numpy/blob/main/examples/simple-extension/README.md) | ||
for an introduction. | ||
An example extension using [optional ndarray features](https://docs.rs/ndarray/latest/ndarray/doc/crate_feature_flags/index.html), in this case parallel execution using Rayon and optimized kernels using BLAS. | ||
|
||
See the [README](../simple/README.md) of the simple extension for more information. |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
examples/simple-extension/Cargo.toml → examples/simple/Cargo.toml
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,5 +1,5 @@ | ||
[package] | ||
name = "numpy-example" | ||
name = "rust-ext" | ||
version = "0.1.0" | ||
authors = ["Toshiki Teramura <[email protected]>", "Yuji Kanagawa <[email protected]>"] | ||
edition = "2018" | ||
|
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,25 @@ | ||
# simple extension | ||
|
||
Here, we use [`maturin`][maturin] for building Python wheels and | ||
[`nox`][nox] for managing Python dependencies and virtualenvs. | ||
|
||
Running `nox` inside this directory creates a virtualenv, | ||
installs Python dependencies and the extension into it | ||
and executes the tests from `tests/test_exp.py`. | ||
|
||
By running | ||
```bash | ||
maturin develop | ||
``` | ||
from inside a virtualenv, you can use the extension from | ||
the Python REPL: | ||
|
||
```python | ||
>>> import numpy as np | ||
>>> import rust_ext | ||
>>> rust_ext.axpy(2.0, np.array([0.0, 1.0]), np.array([2.0, 3.0])) | ||
array([2., 5.]) | ||
``` | ||
|
||
[maturin]: https://github.com/PyO3/maturin | ||
[nox]: https://github.com/theacodes/nox |
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,8 @@ | ||
import nox | ||
|
||
|
||
@nox.session | ||
def tests(session): | ||
session.install("pip", "numpy", "pytest") | ||
session.run("pip", "install", ".", "-v") | ||
session.run("pytest") |
File renamed without changes.
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