@@ -36,13 +36,13 @@ If you want to compile for Python2, please add a feature flag in `Cargo.toml` li
36
36
37
37
``` toml
38
38
[dependencies .numpy ]
39
- version = " 0.4.0-alpha.1 "
39
+ version = " 0.4.0"
40
40
features = [" python2" ]
41
41
```
42
42
.
43
43
44
- You can also automatically specify python version in [ setup.py] ( examples/simple-extension/setup.py )
45
- , using [ setuptools-rust] ( https://github.com/PyO3/setuptools-rust ) .
44
+ You can also automatically specify python version in [ setup.py] ( examples/simple-extension/setup.py ) ,
45
+ using [ setuptools-rust] ( https://github.com/PyO3/setuptools-rust ) .
46
46
47
47
48
48
Example
@@ -56,8 +56,8 @@ Example
56
56
name = " numpy-test"
57
57
58
58
[dependencies ]
59
- pyo3 = " ^ 0.5.0-alpha .2"
60
- numpy = " 0.4.0-alpha.1 "
59
+ pyo3 = " 0.5.2"
60
+ numpy = " 0.4.0"
61
61
```
62
62
63
63
``` rust
@@ -78,11 +78,11 @@ fn main() -> Result<(), ()> {
78
78
}
79
79
80
80
fn main_ <'py >(py : Python <'py >) -> PyResult <()> {
81
- let np = get_array_module ( py )? ;
81
+ let np = py . import ( " numpy " )? ;
82
82
let dict = PyDict :: new (py );
83
83
dict . set_item (" np" , np )? ;
84
84
let pyarray : & PyArray1 <i32 > = py
85
- . eval (" np.array([1, 2, 3], dtype='int32')" , Some (& dict ), None )?
85
+ . eval (" np.absolute(np. array([- 1, - 2, - 3], dtype='int32') )" , Some (& dict ), None )?
86
86
. extract ()? ;
87
87
let slice = pyarray . as_slice ();
88
88
assert_eq! (slice , & [1 , 2 , 3 ]);
@@ -100,11 +100,11 @@ name = "rust_ext"
100
100
crate-type = [" cdylib" ]
101
101
102
102
[dependencies ]
103
- numpy = " 0.4.0-alpha.1 "
103
+ numpy = " 0.4.0"
104
104
ndarray = " 0.12"
105
105
106
106
[dependencies .pyo3 ]
107
- version = " ^ 0.5.0-alpha .2"
107
+ version = " 0.5.2"
108
108
features = [" extension-module" ]
109
109
```
110
110
@@ -157,11 +157,13 @@ fn rust_ext(_py: Python, m: &PyModule) -> PyResult<()> {
157
157
Contribution
158
158
-------------
159
159
This project is still in pre-alpha.
160
- We need your feedback. Don't hesitate to open [ issues] ( https://github.com/termoshtt/rust-numpy/issues ) !
160
+
161
+ We need your feedback.
162
+ Don't hesitate to open [ issues] ( https://github.com/termoshtt/rust-numpy/issues ) !
161
163
162
164
Version
163
165
--------
164
- - v0.4.0(coming soon)
166
+ - v0.4.0
165
167
- Duplicate ` PyArrayModule ` and import Numpy API automatically
166
168
- Fix memory leak of ` IntoPyArray ` and add ` ToPyArray ` crate
167
169
- PyArray has dimension as type parameter. Now it looks like ` PyArray<T, D> `
0 commit comments