Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
atonderski committed Apr 22, 2024
1 parent 54c698d commit 122dd9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions tests/test_run_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@
def test_run_tutorial():
result = subprocess.run(["jupyter", "nbconvert", "--execute", "--inplace", "examples/devkit_tutorial.ipynb"])
assert result.returncode == 0


if __name__ == "__main__":
test_run_tutorial()
8 changes: 7 additions & 1 deletion zod/data_classes/sequence.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Any, List, Optional

from zod.constants import AnnotationProject, Lidar
from zod.constants import AnnotationProject, Lidar, NotAnnotatedError
from zod.utils.compensation import motion_compensate_scanwise

from .calibration import Calibration
Expand Down Expand Up @@ -57,8 +57,14 @@ def vehicle_data(self) -> VehicleData:
self._vehicle_data = VehicleData.from_hdf5(self.info.vehicle_data_path)
return self._vehicle_data

def is_annotated(self, project: AnnotationProject) -> bool:
"""Check if the frame is annotated for a given project."""
return project in self.info.annotations

def get_annotation(self, project: AnnotationProject) -> List[Any]:
"""Get the annotation for a given project."""
if not self.is_annotated(project):
raise NotAnnotatedError(f"Project {project} is not annotated for sequence {self.info.id}.")
return self.info.annotations[project].read()

def get_lidar(self, start: int = 0, end: Optional[int] = None) -> List[LidarData]:
Expand Down

0 comments on commit 122dd9f

Please sign in to comment.