-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: numpy compatibility #18
Conversation
@ruseinov Thank you for the contribution. I think for the time being I want to avoid having to maintain individual versions to support different library sets. However, I welcome anyone coming across this to use your fork. If you need to patch it so that other crates are forced to use it as well, you can do the following: [patch.crates-io]
nshare = { git = "https://github.com/ruseinov/nshare.git", rev = "365650125139ee92d73b5da909acf9ccd702b3ee" } Adding this to your Cargo.toml will override this dependency, even for other crates depending on |
@vadixidav I'm curious why For example, Python's Pillow puts channel last, which actually makes total sense. If we look at how OpenCV works - it's exactly the same. Would you consider a contribution that changes that? |
I have introduced the change in that same PR, but I can isolate it if the contribution is of interest. |
The reason for this is that the |
A resource that might help is the following https://docs.rs/ndarray/latest/ndarray/type.Array.html#method.push_column. Note that when you append an axis to the end, you are appending the one with the longest stride. Therefore, the leftmost axis is the one with the shortest stride, hence color in this case. This is probably confusing, but the axes are listed in minor to major order. This may be what tripped you up. |
Thanks for the explanation! |
The behavior is likely correct, but it wont follow the standard convention from |
Unfortunately, numpy does not currently work with ndarray 0.16 as seen here.
Since 0.9.0 version is using an older version of
image
crate - I have decided to fork this for the time being.Please let me know if we could perhaps release this as
0.10.0-numpy-compat
or similar to avoid having to supply a git dependency. Then I'll make appropriate changes toCargo.toml
.