Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit 93a7df8

Browse files
committed
Comment out numpy package until rust-lang/rust#67743 is fixed
1 parent 82b8ff0 commit 93a7df8

File tree

4 files changed

+38
-124
lines changed

4 files changed

+38
-124
lines changed

.github/workflows/rust_build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252
toolchain: nightly
5353
override: true
5454

55-
# - name: Run cargo check
56-
# uses: actions-rs/cargo@v1
57-
# with:
58-
# command: check
55+
- name: Run cargo check
56+
uses: actions-rs/cargo@v1
57+
with:
58+
command: check
5959

6060
- name: Test
6161
run: cargo test --verbose --release

Cargo.lock

-86
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
cute = "0.3.0"
13-
numpy = "0.7.0"
14-
ndarray = "0.13"
13+
#numpy = "0.7.0"
14+
#ndarray = "0.13"
1515

1616
[dependencies.pyo3]
1717
version = "0.8.4"

src/lib.rs

+32-32
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,36 @@ impl Point2Collection {
123123
}
124124
}
125125

126-
use ndarray::{ArrayD, ArrayViewD, ArrayViewMutD};
127-
use numpy::{IntoPyArray, PyArrayDyn};
128-
// Numpy examples
129-
130-
// immutable example
131-
fn mult_with_return(a: f64, x: ArrayViewD<f64>) -> ArrayD<f64> {
132-
&x * a
133-
// Also works:
134-
// a * &x
135-
}
136-
137-
// mutable example (no return)
138-
fn mult_mutable(a: f64, mut x: ArrayViewMutD<f64>) {
139-
x *= a;
140-
}
141-
142-
// wrapper of `axpy`
143-
#[pyfunction]
144-
fn mult_with_return_py(py: Python, a: f64, x: &PyArrayDyn<f64>) -> Py<PyArrayDyn<f64>> {
145-
let x = x.as_array();
146-
mult_with_return(a, x).into_pyarray(py).to_owned()
147-
}
148-
149-
// wrapper of `mult`
150-
#[pyfunction]
151-
fn mult_mutable_py(_py: Python, a: f64, x: &PyArrayDyn<f64>) -> PyResult<()> {
152-
let x = x.as_array_mut();
153-
mult_mutable(a, x);
154-
Ok(())
155-
}
126+
//use ndarray::{ArrayD, ArrayViewD, ArrayViewMutD};
127+
//use numpy::{IntoPyArray, PyArrayDyn};
128+
//// Numpy examples
129+
//
130+
//// immutable example
131+
//fn mult_with_return(a: f64, x: ArrayViewD<f64>) -> ArrayD<f64> {
132+
// &x * a
133+
// // Also works:
134+
// // a * &x
135+
//}
136+
//
137+
//// mutable example (no return)
138+
//fn mult_mutable(a: f64, mut x: ArrayViewMutD<f64>) {
139+
// x *= a;
140+
//}
141+
//
142+
//// wrapper of `axpy`
143+
//#[pyfunction]
144+
//fn mult_with_return_py(py: Python, a: f64, x: &PyArrayDyn<f64>) -> Py<PyArrayDyn<f64>> {
145+
// let x = x.as_array();
146+
// mult_with_return(a, x).into_pyarray(py).to_owned()
147+
//}
148+
//
149+
//// wrapper of `mult`
150+
//#[pyfunction]
151+
//fn mult_mutable_py(_py: Python, a: f64, x: &PyArrayDyn<f64>) -> PyResult<()> {
152+
// let x = x.as_array_mut();
153+
// mult_mutable(a, x);
154+
// Ok(())
155+
//}
156156

157157
mod pathfinding;
158158
// Simple examples
@@ -192,8 +192,8 @@ fn my_library(_py: Python, m: &PyModule) -> PyResult<()> {
192192
m.add_wrapped(wrap_pyfunction!(sum_as_string))?;
193193
m.add_wrapped(wrap_pyfunction!(factorial))?;
194194
m.add_wrapped(wrap_pyfunction!(factorial_iter))?;
195-
m.add_wrapped(wrap_pyfunction!(mult_with_return_py))?;
196-
m.add_wrapped(wrap_pyfunction!(mult_mutable_py))?;
195+
// m.add_wrapped(wrap_pyfunction!(mult_with_return_py))?;
196+
// m.add_wrapped(wrap_pyfunction!(mult_mutable_py))?;
197197

198198
// Classes to be exported
199199
m.add_class::<Point2>()?;

0 commit comments

Comments
 (0)