Skip to content

Commit

Permalink
typo(comment add) (strawlab#117)
Browse files Browse the repository at this point in the history
I deleted the comment by merging mistake, so I modified the code.
  I deleted garbled comments.
  use size property
  __getbuffer__ modified(parameter timing change : _view_count)

Appveyor setting modified(use test.py -> test_pcl.py)
test item add(test_pcl.py modified test_asarray[copy test.py])

* use size property

* __getbuffer__ modified(always _view_count add)

* Appveyor modified(use test.py -> test_pcl.py)
test item add(test_pcl.py modified test_asarray[copy test.py])
__getbuffer__ modified(always _view_count add[other PointCloud pxi])
  • Loading branch information
Sirokujira authored Aug 28, 2017
1 parent e15d6d4 commit 45a9fc0
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ test_script:
# - dir "%PYTHON%\Lib\site-packages\python_pcl-0.2-py3.4-win32.egg\*.pyd" /b /a-d /s
# - "%CMD_IN_ENV% python tests\\test.py"
- python sys_path_check.py
- python tests\test.py
- python tests\test_pcl.py
# examples_command_160.txt
# Filtering
- python examples\official\Filtering\PassThroughFilter.py
Expand Down
2 changes: 1 addition & 1 deletion pcl/_pcl.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# cython: embedsignature=True


Expand Down
3 changes: 1 addition & 2 deletions pcl/minipcl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void mpcl_extract_VFH(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud)
/*
// pcl1.6
#include <pcl/keypoints/harris_keypoint3D.h>
// use 1.7�`
// use 1.7
#include <pcl/keypoints/harris_3d.h>
// HarrisKeypoint3D
Expand Down Expand Up @@ -302,7 +302,6 @@ void mpcl_features_NormalEstimationMethod_compute(pcl::IntegralImageNormalEstima
{
// NG : out Variant Function end error
printf("compute start.\n");
// �Q�ƃJ�E���g��NG?(�֐����������ɃG���[)
ne.compute (out);
// pcl 1.7.2 error
// printf("out = %p.\n", out);
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZ.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ cdef class PointCloud:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 3
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZI.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ cdef class PointCloud_PointXYZI:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZI_172.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ cdef class PointCloud_PointXYZI:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZI_180.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ cdef class PointCloud_PointXYZI:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGB.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGB:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGBA.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGBA:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGBA_172.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGBA:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGBA_180.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGBA:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGB_172.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGB:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZRGB_180.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ cdef class PointCloud_PointXYZRGB:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 4
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZ_172.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ cdef class PointCloud:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 3
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion pcl/pxi/PointCloud_PointXYZ_180.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ cdef class PointCloud:
cdef Py_ssize_t npoints = self.thisptr().size()

if self._view_count == 0:
self._view_count += 1
self._shape[0] = npoints
self._shape[1] = 3
self._view_count += 1

buffer.buf = <char *>&(idx.getptr_at(self.thisptr(), 0).x)
buffer.format = 'f'
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_asarray(self):
b = np.asarray(p)
del b

self.assertRaises(ValueError, p.resize, 2 * len(p))
self.assertRaises(ValueError, p.resize, 2 * p.size)

def test_pickle(self):
"""Test pickle support."""
Expand Down
25 changes: 13 additions & 12 deletions tests/test_pcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ def test_asarray(self):
a[:] += 6
assert_array_almost_equal(p[0], a[0])

# Regression test: deleting a second view would previously
# reset the view count to zero.
b = np.asarray(p)
del b

self.assertRaises(ValueError, p.resize, 2 * p.size)

def test_pickle(self):
"""Test pickle support."""
# In this testcase because picking reduces to pickling NumPy arrays.
Expand Down Expand Up @@ -225,9 +232,7 @@ def tearDown(self):
shutil.rmtree(self.tmpdir)

def testSave(self):
# for ext in ["pcd", "ply"]:
# Mac ply read/write NG
for ext in ["pcd"]:
for ext in ["pcd", "ply"]:
d = os.path.join(self.tmpdir, "foo." + ext)
pcl.save(self.p, d)
p = pcl.load(d)
Expand Down Expand Up @@ -277,12 +282,11 @@ def testIndex(self):
self.assertRaises(IndexError, self.p.__getitem__, self.p.size)
self.assertRaises(Exception, self.p.get_point, self.p.size, 1)

# Mac resize method NG
# def testResize(self):
# # XXX MemoryError isn't actually the prettiest exception for a
# # negative argument. Don't hesitate to change this test to reflect
# # better exceptions.
# self.assertRaises(MemoryError, self.p.resize, -1)
def testResize(self):
# XXX MemoryError isn't actually the prettiest exception for a
# negative argument. Don't hesitate to change this test to reflect
# better exceptions.
self.assertRaises(MemoryError, self.p.resize, -1)


class TestSegmenterNormal(unittest.TestCase):
Expand Down Expand Up @@ -370,7 +374,6 @@ def testFilterBoth(self):


class TestKdTree(unittest.TestCase):

def setUp(self):
rng = np.random.RandomState(42)
# Define two dense sets of points of sizes 30 and 170, resp.
Expand Down Expand Up @@ -446,7 +449,6 @@ def testRadiusSearch(self):
self.assertEqual(len(rs[0]), 19730)
self.assertEqual(len(rs[1]), 19730)


# class TestOctreePointCloudChangeDetector(unittest.TestCase):
#
# def setUp(self):
Expand All @@ -468,7 +470,6 @@ def testRadiusSearch(self):
# self.assertEqual(len(rs[0]), 19730)
# self.assertEqual(len(rs[1]), 19730)


# class TestCropHull(unittest.TestCase):
#
# def setUp(self):
Expand Down

0 comments on commit 45a9fc0

Please sign in to comment.