-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
EnsureChannelFirst behaves wrong when loading npy files #5206
Comments
7 tasks
thanks for reporting, @SachidanandAlle also asked about the same issue and I had some updates but forgot to create a PR.. |
wyli
added a commit
that referenced
this issue
Sep 25, 2022
…5208) Signed-off-by: Wenqi Li <[email protected]> Fixes #5206 ### Description changes to `EnsureChannelFirst` so that the input `channel_dim` has a higher priority than `metatensor.meta['original_channel_dim']` ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]>
wyli
added a commit
that referenced
this issue
Oct 24, 2022
…5208) Signed-off-by: Wenqi Li <[email protected]> Fixes #5206 ### Description changes to `EnsureChannelFirst` so that the input `channel_dim` has a higher priority than `metatensor.meta['original_channel_dim']` ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]>
wyli
added a commit
that referenced
this issue
Oct 24, 2022
…5208) Signed-off-by: Wenqi Li <[email protected]> Fixes #5206 ### Description changes to `EnsureChannelFirst` so that the input `channel_dim` has a higher priority than `metatensor.meta['original_channel_dim']` ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]>
KumoLiu
pushed a commit
that referenced
this issue
Nov 2, 2022
…5208) Signed-off-by: Wenqi Li <[email protected]> Fixes #5206 ### Description changes to `EnsureChannelFirst` so that the input `channel_dim` has a higher priority than `metatensor.meta['original_channel_dim']` ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]> Signed-off-by: KumoLiu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When we are loading .npy files EnsureChannelFirst does not behave as expected because it casts the .npy data to MetaTensor if it is not one and then it picks the channel dimension from the MetaTensor ignoring the passed channel_dim that was passed at construction.
Expected behavior
If a channel_dim is passed then EnsureChannelFirst should move that channel_dim to the first dimension while ignoring the information in the MetaTensor and overwriting the required fields in the MetaTensor.
Environment
Ensuring you use the relevant python executable, please paste the output of:
The text was updated successfully, but these errors were encountered: