Repository navigation
Conversation
Use const accessors and Eigen maps in all four copying conversion helpers. Preserve contiguity conversion and correct the shared double-vector comment. Document read-only input and add parameterized tests for five constructors, input layouts, dtype conversion, preserved input flags and independent storage. Validation: pinned style checks, Python AST parsing and diff checks pass. Against the existing unmodified binary, focused tests report 88 passes and 10 expected readonly-input failures. Rebuilt binding validation is pending; no existing build was available. Related upstream report: isl-org#2557.
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Motivation and Context
A C-contiguous, correctly typed NumPy array with
writeable=Falsecurrently raisesValueError: array is not writeablein an Eigen vector constructor, although the constructor only copies its input. For example:After this fix, construction succeeds and the vector remains independently owned and writable. The input values and readonly flag remain unchanged.
Checklist:
python util/check_style.py --applyto apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
Use
unchecked<2>()andEigen::Map<const EigenVector>in all four array-to-vector conversion helpers. Preserve dtype conversion, contiguity handling from #7343, shape validation and copying semantics. Correct the shared double-helper comment and document readonly input in the example.Add 60 parameterized cases across five public vector constructors, writable/readonly inputs, empty and C/Fortran/strided/reversed arrays, and dtype conversion. Tests check values, dtype, input flags, independent storage and mutation isolation; existing invalid-shape tests remain in place. The allocator helper variants receive the same const change; the tests exercise the public constructors rather than adding test-only bindings.
Plan and scope: restrict the fix to the copying bindings, demonstrate the readonly failure, then validate the rebuilt bindings and available CPU suites. No algorithm or ownership changes.
Validation
Windows x64 Release, VS2022/MSVC 19.44, Python 3.14.3, NumPy 2.4.6, rebuilt Open3D 0.20.0+306764175. Verified the package and native extension load from the build output.
python/test/test_open3d_eigen.py: 99 passed, including all 60 new cases and the existing benchmark.pytest python/test/ --ignore=python/test/ml_ops --randomly-seed=20261022: 625 passed, 15 skipped. Excluded ML operations because those bindings were not built. Skips cover Linux-only rendering, SYCL/GPU, RealSense, unavailable ML visualization, four existing dataset skips, and optionalmsgpack.Build includes Python bindings, C++ tests, GUI, ISPC and IPP. CUDA/SYCL, TensorFlow/PyTorch ops, bundled ML, WebRTC/Jupyter and camera SDKs were disabled. Tests used eight logical CPUs. Other operating systems and GPU configurations were not validated.