@@ -10,7 +10,6 @@ Rust bindings for the NumPy C-API.
10
10
- [ Latest release] ( https://docs.rs/numpy )
11
11
- [ Current main] ( https://pyo3.github.io/rust-numpy )
12
12
13
-
14
13
## Requirements
15
14
- Rust >= 1.41.1
16
15
- Basically, our MSRV follows the one of [ PyO3] ( https://github.com/PyO3/pyo3 )
@@ -23,36 +22,8 @@ Rust bindings for the NumPy C-API.
23
22
- [ numpy] ( https://numpy.org/ ) installed in your Python environments (e.g., via ` pip install numpy ` )
24
23
- We recommend ` numpy >= 1.16.0 ` , though older versions may work
25
24
26
-
27
- ## Dependency on ndarray
28
-
29
- This crate uses types from ` ndarray ` in its public API. ` ndarray ` is re-exported
30
- in the crate root so that you do not need to specify it as a direct dependency.
31
-
32
- Furthermore, this crate is compatible with multiple versions of ` ndarray ` and therefore depends
33
- on a range of semver-incompatible versions, currently ` >= 0.13, < 0.16 ` . Cargo does not
34
- automatically choose a single version of ` ndarray ` by itself if you depend directly or indirectly
35
- on anything but that exact range. It can therefore be necessary to manually unify these dependencies.
36
-
37
- For example, if you specify the following dependencies
38
-
39
- ``` toml
40
- numpy = " 0.15"
41
- ndarray = " 0.13"
42
- ```
43
-
44
- this will currently depend on both version ` 0.13.1 ` and ` 0.15.3 ` of ` ndarray ` by default
45
- even though ` 0.13.1 ` is within the range ` >= 0.13, < 0.16 ` . To fix this, you can run
46
-
47
- ``` sh
48
- cargo update ---package ndarray:0.15.3 --precise 0.13.1
49
- ```
50
-
51
- to achieve a single dependency on version ` 0.13.1 ` of ` ndarray ` .
52
-
53
25
## Example
54
26
55
-
56
27
### Execute a Python program from Rust and get results
57
28
58
29
``` toml
@@ -146,6 +117,32 @@ fn rust_ext(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
146
117
}
147
118
```
148
119
120
+ ## Dependency on ndarray
121
+
122
+ This crate uses types from ` ndarray ` in its public API. ` ndarray ` is re-exported
123
+ in the crate root so that you do not need to specify it as a direct dependency.
124
+
125
+ Furthermore, this crate is compatible with multiple versions of ` ndarray ` and therefore depends
126
+ on a range of semver-incompatible versions, currently ` >= 0.13, < 0.16 ` . Cargo does not
127
+ automatically choose a single version of ` ndarray ` by itself if you depend directly or indirectly
128
+ on anything but that exact range. It can therefore be necessary to manually unify these dependencies.
129
+
130
+ For example, if you specify the following dependencies
131
+
132
+ ``` toml
133
+ numpy = " 0.15"
134
+ ndarray = " 0.13"
135
+ ```
136
+
137
+ this will currently depend on both version ` 0.13.1 ` and ` 0.15.3 ` of ` ndarray ` by default
138
+ even though ` 0.13.1 ` is within the range ` >= 0.13, < 0.16 ` . To fix this, you can run
139
+
140
+ ``` sh
141
+ cargo update ---package ndarray:0.15.3 --precise 0.13.1
142
+ ```
143
+
144
+ to achieve a single dependency on version ` 0.13.1 ` of ` ndarray ` .
145
+
149
146
## Contributing
150
147
We welcome [ issues] ( https://github.com/PyO3/rust-numpy/issues )
151
148
and [ pull requests] ( https://github.com/PyO3/rust-numpy/pulls ) .
0 commit comments