Skip to content

Commit 5ec02ae

Browse files
committed
Update CHANGELOG and fix CLI help message; refactor test file format handling
1 parent 9ff13f7 commit 5ec02ae

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

CHANGELOG.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ Added
1212
~~~~~~
1313
- exporting of las file using laspy
1414

15+
Changed
16+
~~~~~~
17+
- CLI exporting direct via pointcloud and not via pyntcloud
18+
1519
Fixed
1620
~~~~~~
17-
- wrong helpt for pointcloudset convert CLI: the bag or mcap dir needs to come right after the command
21+
- wrong help for pointcloudset convert CLI: the bag or mcap dir needs to come right after the command
1822

1923
0.10.1- (2025-04-28)
2024
-------------

src/pointcloudset/io/dataset/commandline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _gen_file_paths(file_name):
146146

147147
def _gen_folder(folder_to_write: str, ros_file_path: str, output_format: str) -> Path:
148148
"""Generate the folder to write the converted files to."""
149-
suffix = "_pointcloudset" if output_format == "POINTCLOUDSET" else f"_{output_format.lower()}"
149+
suffix = "_pointcloudset" if output_format == "POINTCLOUDSET" else ""
150150
folder_to_write_path = Path(folder_to_write).joinpath(Path(ros_file_path).stem + suffix)
151151
folder_to_write_path.mkdir(exist_ok=False, parents=True)
152152
return folder_to_write_path

tests/cli/test_rosbagconvert.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
import pytest
44
import pytest_check as check
5-
from pyntcloud.io import TO_FILE
65
from typer.testing import CliRunner
76

87
from pointcloudset import Dataset
8+
from pointcloudset.io import POINTCLOUD_TO_FILE
99
from pointcloudset.io.dataset.commandline import app
1010

11-
TO_FILE_PYNTCLOUD = list(TO_FILE.keys())
11+
TO_FILE_FORMATS = list(POINTCLOUD_TO_FILE.keys())
12+
1213

1314
runner = CliRunner()
1415

@@ -53,9 +54,7 @@ def test_convert_one_rosfile_to_dir(ros_files, tmp_path: Path):
5354
check.equal(len(read_dataset.timestamps), 2)
5455

5556

56-
def test_convert_all_rosfiles_to_dir(
57-
tmp_path: Path, testdata_path: Path, monkeypatch: pytest.MonkeyPatch
58-
):
57+
def test_convert_all_rosfiles_to_dir(tmp_path: Path, testdata_path: Path, monkeypatch: pytest.MonkeyPatch):
5958
monkeypatch.chdir(testdata_path)
6059
out_path = tmp_path.joinpath("cli_dirs")
6160
result = runner.invoke(
@@ -83,7 +82,7 @@ def test_convert_all_rosfiles_to_dir(
8382
check.equal(len(read_dataset.timestamps), 2)
8483

8584

86-
@pytest.mark.parametrize("fileformat", TO_FILE_PYNTCLOUD)
85+
@pytest.mark.parametrize("fileformat", TO_FILE_FORMATS)
8786
def test_convert_one_ros_file_frames_to_files(ros_files, tmp_path: Path, fileformat):
8887
out_path = tmp_path.joinpath("cli_files")
8988
result = runner.invoke(
@@ -107,7 +106,7 @@ def test_convert_one_ros_file_frames_to_files(ros_files, tmp_path: Path, filefor
107106
check.equal(files[0].suffix.replace(".", ""), fileformat.lower())
108107

109108

110-
@pytest.mark.parametrize("fileformat", TO_FILE_PYNTCLOUD)
109+
@pytest.mark.parametrize("fileformat", TO_FILE_FORMATS)
111110
def test_convert_one_ros_file_one_frame_to_files(ros_files, tmp_path: Path, fileformat):
112111
out_path = tmp_path.joinpath("cli_1file")
113112
result = runner.invoke(
@@ -135,9 +134,7 @@ def test_convert_one_ros_file_one_frame_to_files(ros_files, tmp_path: Path, file
135134
check.equal(files[0].suffix.replace(".", ""), fileformat.lower())
136135

137136

138-
def test_convert_all_bags_frames_files(
139-
tmp_path: Path, testdata_path: Path, monkeypatch: pytest.MonkeyPatch
140-
):
137+
def test_convert_all_bags_frames_files(tmp_path: Path, testdata_path: Path, monkeypatch: pytest.MonkeyPatch):
141138
monkeypatch.chdir(testdata_path)
142139
out_path = tmp_path.joinpath("cli_dirs_frames")
143140
result = runner.invoke(
@@ -164,9 +161,7 @@ def test_convert_all_bags_frames_files(
164161

165162
@pytest.mark.slow
166163
@pytest.mark.parametrize("filename", ["big_uncomp.bag", "big_comp.bag"])
167-
def test_convert_large_file_complete(
168-
testdata_path_large: Path, tmp_path: Path, filename: str
169-
):
164+
def test_convert_large_file_complete(testdata_path_large: Path, tmp_path: Path, filename: str):
170165
if testdata_path_large.exists():
171166
len_target = 250
172167
testbag = testdata_path_large.joinpath(filename)

0 commit comments

Comments
 (0)