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

build: relax open3d and numpy version requirements #85

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Conversation

yxlao
Copy link
Owner

@yxlao yxlao commented Jan 11, 2025

Open3D >= 0.19.0 has fixed support for NumPy 2.x (Open3D issue #6840). This PR relaxes the version requirements for Open3D and NumPy. The user is responsible for ensuring the versions are compatible. We also provide a runtime check that will print out a warning message if Open3D and NumPy are not compatible.

Compatibility test

test_init.py:

import numpy as np
import open3d as o3d

print(f"Open3D version: {o3d.__version__}")
print(f"Numpy version: {np.__version__}")

mesh = o3d.geometry.TriangleMesh()
mesh.vertices = o3d.utility.Vector3dVector(np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]]))
print(f"Number of vertices: {len(mesh.vertices)}")

Results:

# Previous working case
$ python test_init.py                                                                              
Open3D version: 0.18.0                                                                                                                                  
Numpy version: 1.26.0                                                                                                                                   
Number of vertices: 3

# Incompatible case
$ python test_init.py                                                                              
Open3D version: 0.18.0                                                                                                                                  
Numpy version: 2.2.1                                                                                                                                    
[1]    1844774 segmentation fault  python test_init.py 

# New working case
$ python test_init.py  
Open3D version: 0.19.0
Numpy version: 2.2.1
Number of vertices: 3

yxlao added 2 commits January 10, 2025 21:08
…tibility check

- Refactor version retrieval into a reusable function `_get_package_version`
- Add logging configuration and compatibility check for open3d and numpy
- Warn users if incompatible versions of open3d and numpy are detected
@yxlao yxlao changed the title build: update open3d version build: relax open3d and numpy version requirements Jan 11, 2025
@yxlao yxlao merged commit c0a5fac into main Jan 11, 2025
10 checks passed
@yxlao yxlao deleted the yixing/open3d-update branch January 11, 2025 10:05
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.

1 participant