Repository navigation
feat(cameras): allow admins to update a camera's angle of view - #716
Conversation
Add PATCH /cameras/{camera_id}/angle_of_view (admin only), following the
existing /name and /trustable routes, so a camera's field of view can be
corrected after calibration without recreating the camera.
Existing sequences keep the cone computed with the previous angle; only new
detections use the corrected value.
Closes pyronear#694
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
MateoLostanlen
left a comment
There was a problem hiding this comment.
Hi @Majyles thanks a lot for this PR ! Can you just fix the conflict and we are good to merge 😄
…f-view # Conflicts: # src/tests/endpoints/test_cameras.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #716 +/- ##
==========================================
+ Coverage 94.57% 94.59% +0.01%
==========================================
Files 60 60
Lines 3247 3254 +7
==========================================
+ Hits 3071 3078 +7
Misses 176 176
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @MateoLostanlen ! Conflict fixed (it was just #713 adding a test next to mine, both are kept). All checks pass (except triage, which fails on fork PRs since the labeler only gets a read-only token there). Thanks for the review! |
MateoLostanlen
left a comment
There was a problem hiding this comment.
Thanks for the edit @Majyles
What
Adds PATCH /cameras/{camera_id}/angle_of_view (admin only) so a camera's field of view can be corrected after calibration, without recreating the camera.
How
Follows the existing /name and /trustable routes: a dedicated CameraAngleOfView schema with the same bounds as at creation (0 < angle_of_view <= 360), telemetry event cameras-update-angle-of-view, and the schema added to CameraCRUD's update types.
Note
Existing sequences keep the cone computed with the previous angle; only new detections use the corrected value. Recomputing past cones could be a future improvement.
Tests
Parametrized tests on the new route: 401 / 403 (agent, user) / 404 / 422 (0, > 360, missing field) / 200, also checking that other camera fields are untouched. Full suite, ruff and ty pass locally.
Closes #694