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

Fix tests and deprecations, update requirements #361

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyntcloud/plot/matplotlib_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def plot_with_matplotlib(cloud, **kwargs):

colors = get_colors(cloud, kwargs["use_as_color"], kwargs["cmap"])

ptp = cloud.xyz.ptp()
ptp = np.ptp(cloud.xyz)

plt.figure(figsize=(10, 10))
ax = plt.axes(projection='3d')
Expand Down
3 changes: 2 additions & 1 deletion pyntcloud/plot/pythreejs_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
display = None

from .common import get_colors
import numpy as np


def get_pointcloud_pythreejs(xyz, colors):
Expand Down Expand Up @@ -69,7 +70,7 @@ def plot_with_pythreejs(cloud, **kwargs):

colors = get_colors(cloud, kwargs["use_as_color"], kwargs["cmap"])

ptp = cloud.xyz.ptp()
ptp = np.ptp(cloud.xyz)

children = []
widgets = []
Expand Down
3 changes: 1 addition & 2 deletions pyntcloud/plot/pyvista_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def plot_with_pyvista(cloud, **kwargs):

# TODO: Leverage `kwargs["elev"]` and `kwargs["azim"]`

return plotter.show(use_panel=kwargs.pop("use_panel", None),
title=kwargs.pop("title", None),
return plotter.show(title=kwargs.pop("title", None),
screenshot=kwargs.pop("screenshot", False),
cpos=kwargs.pop("cpos", None) )
3 changes: 2 additions & 1 deletion pyntcloud/plot/threejs_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path

import pandas as pd
import numpy as np

try:
from IPython.display import IFrame
Expand All @@ -31,7 +32,7 @@ def plot_with_threejs(cloud, **kwargs):
else:
mesh = None

ptp = cloud.xyz.ptp()
ptp = np.ptp(cloud.xyz)

BASE_PATH = os.path.dirname(os.path.abspath(__file__))
src = "{}/{}".format(BASE_PATH, "points.html")
Expand Down
2 changes: 1 addition & 1 deletion pyntcloud/plot/voxelgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def plot_voxelgrid_with_threejs(voxel_centers,
centroid, camera_position = get_centroid_and_camera_position(voxel_centers)

if axis:
axis_size = voxel_centers.ptp() * 1.5
axis_size = np.ptp(voxel_centers) * 1.5
else:
axis_size = 0

Expand Down
4 changes: 2 additions & 2 deletions pyntcloud/structures/voxelgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def compute(self):
"""ABC API."""
xyzmin = self._points.min(0)
xyzmax = self._points.max(0)
xyz_range = self._points.ptp(0)
xyz_range = np.ptp(self._points,0)

if self.regular_bounding_box:
#: adjust to obtain a minimum bounding box with all sides of equal length
Expand All @@ -88,7 +88,7 @@ def compute(self):
for n, size in enumerate(self.sizes):
if size is None:
continue
margin = (((self._points.ptp(0)[n] // size) + 1) * size) - self._points.ptp(0)[n]
margin = (((np.ptp(self._points,0)[n] // size) + 1) * size) - np.ptp(self._points,0)[n]
xyzmin[n] -= margin / 2
xyzmax[n] += margin / 2
self.x_y_z[n] = ((xyzmax[n] - xyzmin[n]) / size).astype(int)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy
numpy<2.0.0
scipy>=1.6.0
pandas
laspy
Expand Down
Empty file added tests/__init__.py
Empty file.
Empty file added tests/data/__init__.py
Empty file.
Empty file added tests/integration/__init__.py
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion tests/integration/io/test_to_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pyntcloud import PyntCloud

from test_from_file import assert_points_xyz, assert_points_color, assert_mesh
from .test_from_file import assert_points_xyz, assert_points_color, assert_mesh


@pytest.mark.parametrize("extension,color,mesh,comments", [
Expand Down
Empty file.
Empty file.
Empty file.
Empty file added tests/unit/__init__.py
Empty file.
Empty file added tests/unit/filters/__init__.py
Empty file.
Empty file added tests/unit/ransac/__init__.py
Empty file.
Empty file added tests/unit/samplers/__init__.py
Empty file.
Empty file.
Empty file.