Repository navigation
feat(deployments): show camera effort per deployment - #638
Merged
Merged
Conversation
✅ Deploy Preview for lucent-yeot-0cb408 canceled.
|
Ecologists need to read detections against how long each camera actually ran. The Deployments tab now shows camera-days per row, summed per co-located group and study-wide, and replaces the popover's rounded Duration with the same figure. Effort comes from one shared helper (valid interval = both dates parse, end after start) chosen to match the RAI effort rule in PR #637 so the two agree once it lands; it is computed fractionally in the activity query and only rounded for display. Both the observation count and camera-days figures get an explanatory tooltip (headline, scope, plain-language definition) so the numbers are not mistaken for sequence-adjusted or population estimates.
PR #637 landed on main, so the shared helper's comment and the IPC docs now name validateDeploymentIntervals instead of a pending PR.
Chouffe
force-pushed
the
worktree-arthur+deployment-effort
branch
from
September 23, 2026 12:34
f80c1fb to
85e1e6f
Compare
Collaborator
Author
|
would love your review @ioRekz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/shared/effort.js) defines a deployment's effort as its interval in fractional camera-days when both dates parse and the end is after the start, otherwisenull(shown as—, never 0). This is the same validity rule asvalidateDeploymentIntervalsin the RAI effort module from feat(explore): add relative abundance index metrics #637, so per-deployment camera-days agree with Explore's effort denominator. Effort is computed in the existing activity query (no new IPC channel) and rounded to whole days only for display.Notes
cameraDaysuses a looser SQL rule (sumsjuliandaydifferences, including inverted intervals), so its total can differ from this tab on studies with bad dates. Left as is; noted indocs/ipc-api.md.hasTimestamps: false) hide the effort column and summary, matching the sparklines.Test plan
npm test— 1543 passing after rebasing on main (18 new: shared effort rule, activity queryeffortDaysin both branches, group sums/skip counts, label and date-range formatting)TZ=Asia/Tokyo,TZ=Pacific/Pago_Pago, andTZ=UTCnpm run lint,npm run format:check