Skip to content
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

3D Volume initialization from numpy #306

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

steinraf
Copy link
Contributor

@steinraf steinraf commented Sep 3, 2024

Category

  • New feature
  • Bugfix
  • Breaking change
  • Refactoring
  • Documentation
  • Other (please explain)

Description

The current Volume.load_from_numpy method mistakenly initializes a 1D numpy array with values (target_shape[0], target_shape[1], target_shape[2], 3) instead of that shape.

Changelog

  • In case bg_value is multidimensional, correctly initialize an array filled by the bg_value
  • Adding a test which is not passed by the original version
  • Running ruff format

Before your PR is "Ready for review"

  • Do you agree to the terms under which contributions are accepted as described in Section 9 the Warp License?
  • Have you read the Contributor Guidelines?
  • Have you written any new necessary tests?
  • Have you added or updated any necessary documentation?
  • Have you added any files modified by compiling Warp and building the documentation to this PR (.e.g. stubs.py, functions.rst)?
  • Does your code pass ruff check and ruff format --check?

@shi-eric
Copy link
Contributor

shi-eric commented Sep 3, 2024

Thanks @steinraf. It seems like your pull request makes a lot of unrelated formatting changes, perhaps from a code editor setting that adds trailing commas everywhere, or maybe a max-line-length setting. Can you please update your pull request so that it only has the changes relevant for your bugfix?

@gdaviet
Copy link
Contributor

gdaviet commented Sep 4, 2024

Thanks @steinraf, this is indeed a bug and the fix looks good to me!
Ideally we would also verify the sampled values in the test, but it looks like the exsiting test_volume_from_numpy was not doing that either, so that's something we can add on our side

@shi-eric shi-eric merged commit 8b8932c into NVIDIA:main Sep 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants