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

Incompatible with Python3.10 and/or numpy #19

Closed
langthom opened this issue Nov 8, 2023 · 1 comment
Closed

Incompatible with Python3.10 and/or numpy #19

langthom opened this issue Nov 8, 2023 · 1 comment

Comments

@langthom
Copy link

langthom commented Nov 8, 2023

After an installation via pip (Python 3.10, Ubuntu xy), I got the following stack trace when trying to extract the topology from the LBC.

2023-11-08 07:43:01,538 - PCD #points: 2669
Current volume ratio 1.0. Contraction weights 2048.0. Attraction weights 0.5. Progress LBC: 10%|████████▎ | 2/20 [00:00<00:02, 7.38it/s]Contraction is Done.
2023-11-08 07:43:02,010 - Contraction is Done.
Current volume ratio 1.0. Contraction weights 2048.0. Attraction weights 0.5. Progress LBC: 10%|████████▎ | 2/20 [00:00<00:03, 5.53it/s]
/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/mistree/mst/branches.py:54: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar.
mask_end = np.ones(index_branch_end.shape, dtype=np.bool)
Traceback (most recent call last):
File "/home/me/pcskeletor_test/pcskeletor.py", line 34, in
extract_skeleton(pcd)
File "/home/me/pcskeletor_test/pcskeletor.py", line 20, in extract_skeleton
lbc.extract_topology()
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/pc_skeletor/laplacian.py", line 287, in extract_topology
self.skeleton_graph = self.__extract_skeletal_graph(skeletal_points=skeleton_points)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/pc_skeletor/laplacian.py", line 241, in __extract_skeletal_graph
_, _, _, _, edge_index, _ = extract_mst(points=skeletal_points)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/pc_skeletor/laplacian.py", line 237, in extract_mst
degree, edge_length, branch_length, branch_shape, edge_index, branch_index = mst.get_stats(include_index=True, k_neighbours=self.graph_k_n)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/mistree/mst/get_mst_class.py", line 408, in get_stats
return self._get_stats(include_index=include_index, sub_divisions=sub_divisions,
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/mistree/mst/get_mst_class.py", line 370, in get_stats
self.get_branches(sub_divisions=sub_divisions)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/mistree/mst/get_mst_class.py", line 198, in get_branches
branch_index, rejected_branch_index = branches.get_branch_index(self.edge_index, self.edge_degree)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/mistree/mst/branches.py", line 54, in get_branch_index
mask_end = np.ones(index_branch_end.shape, dtype=np.bool)
File "/home/me/pcskeletor_test/o3d_env/lib/python3.10/site-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'bool
'?

So it seems that the bool type needs to be addressed properly, or depending on the numpy version. Note that because I use Python 3.10, downgrading to numpy<=1.20 does not work as that version does not support Python 3.10.

@meyerls
Copy link
Owner

meyerls commented Nov 8, 2023

Please see issue #13

@meyerls meyerls closed this as completed Nov 8, 2023
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

No branches or pull requests

2 participants