diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4271670..c5aeb5a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.7, 3.8] + python-version: ["3.7", "3.8", "3.9"] # "3.10" wait for Open3D support env: DISPLAY: ':99.0' @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pip install .[tests] - name: Test with pytest diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ee0832f..d7ffb7a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -7,22 +7,22 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] # macos-latest, - python-version: [3.7, 3.8] + os: [ubuntu-latest, windows-latest] # macos-latest has OpenGL import error + python-version: ["3.7", "3.8", "3.9"] # "3.10" wait for Open3D support steps: - name: Get repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install flake8 pytest + python -m pip install --upgrade pip setuptools wheel + pip install flake8 pip install .[tests] - name: Lint with flake8 diff --git a/labelCloud/__init__.py b/labelCloud/__init__.py index ab55bb1..aed5734 100644 --- a/labelCloud/__init__.py +++ b/labelCloud/__init__.py @@ -1 +1 @@ -__version__ = "0.7.5" +__version__ = "0.7.6" diff --git a/labelCloud/control/pcd_manager.py b/labelCloud/control/pcd_manager.py index a22d190..dcda7b5 100644 --- a/labelCloud/control/pcd_manager.py +++ b/labelCloud/control/pcd_manager.py @@ -7,10 +7,9 @@ from shutil import copyfile from typing import TYPE_CHECKING, List, Optional, Tuple -import pkg_resources - import numpy as np import open3d as o3d +import pkg_resources from ..io.pointclouds import BasePointCloudHandler, Open3DHandler from ..model import BBox, Perspective, PointCloud @@ -97,7 +96,9 @@ def get_next_pcd(self) -> None: self.current_id += 1 self.save_current_perspective() self.pointcloud = PointCloud.from_file( - self.pcd_path, self.saved_perspective + self.pcd_path, + self.saved_perspective, + write_buffer=self.pointcloud is not None, ) self.update_pcd_infos() else: diff --git a/labelCloud/model/point_cloud.py b/labelCloud/model/point_cloud.py index 51518c6..88cfe35 100644 --- a/labelCloud/model/point_cloud.py +++ b/labelCloud/model/point_cloud.py @@ -3,10 +3,9 @@ from pathlib import Path from typing import List, Optional, Tuple -import pkg_resources - import numpy as np import OpenGL.GL as GL +import pkg_resources from . import Perspective from ..control.config_manager import config @@ -65,6 +64,7 @@ def __init__( colors: Optional[np.ndarray] = None, init_translation: Optional[Tuple[float, float, float]] = None, init_rotation: Optional[Tuple[float, float, float]] = None, + write_buffer: bool = True, ) -> None: start_section(f"Loading {path.name}") self.path = path @@ -89,14 +89,17 @@ def __init__( ) logging.info("Generated colors for colorless point cloud based on height.") - self.write_vbo() + if write_buffer: + self.write_vbo() logging.info(green(f"Successfully loaded point cloud from {path}!")) self.print_details() end_section() @classmethod - def from_file(cls, path: Path, perspective: Optional[Perspective]) -> "PointCloud": + def from_file( + cls, path: Path, perspective: Optional[Perspective], write_buffer: bool = True + ) -> "PointCloud": init_translation, init_rotation = (None, None) if perspective: init_translation = perspective.translation @@ -105,7 +108,7 @@ def from_file(cls, path: Path, perspective: Optional[Perspective]) -> "PointClou points, colors = BasePointCloudHandler.get_handler( path.suffix ).read_point_cloud(path=path) - return cls(path, points, colors, init_translation, init_rotation) + return cls(path, points, colors, init_translation, init_rotation, write_buffer) def to_file(self, path: Optional[Path] = None) -> None: if not path: diff --git a/requirements.txt b/requirements.txt index 2f3ddbd..ef159e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ numpy~=1.21.4 open3d~=0.14.1 PyOpenGL~=3.1.5 PyQt5~=5.14.1 +pytest~=7.1.1 +pytest-qt~=4.0.2 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 1765c3a..3f116a1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = labelCloud -version = attr: labelCloud.__version__ +version = attr: labelCloud.__init__.__version__ maintainer = Christoph Sager maintainer_email = christoph.sager@gmail.com license = GNU General Public License v3.0 @@ -52,8 +52,7 @@ install_requires = numpy open3d PyOpenGL - PyQt5 <= 5.14.1;platform_system=='Windows' - PyQt5;platform_system!='Windows' + PyQt5 python_requires = >=3.6 [options.entry_points]