Skip to content

Sync load_physical_aiavdataset docstring with the code#83

Open
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:docs/load-pai-docstring-accuracy
Open

Sync load_physical_aiavdataset docstring with the code#83
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:docs/load-pai-docstring-accuracy

Conversation

@lonexreb
Copy link
Copy Markdown
Contributor

@lonexreb lonexreb commented May 4, 2026

Summary

Two small accuracy issues in the `load_physical_aiavdataset()` docstring:

1. `t0_us` doesn't actually accept None

The doc says:

`t0_us`: The timestamp (in microseconds)... If None, uses a timestamp 5.1s seconds into the clip.

But the signature is `t0_us: int = 5_100_000` and there's no None-handling. Passing `None` crashes at the precondition check:

```python

t0_us = None
t0_us <= 1_500_000 # history_time_range_us for defaults
TypeError: '<=' not supported between instances of 'NoneType' and 'int'
```

Updated to describe the actual default (`5_100_000`) and surface the implicit precondition (`t0_us > num_history_steps * time_step * 1_000_000`).

2. Default `camera_features` order is misleading

The doc listed the cameras in a different order from the code. Same set of four, just rearranged. Cross-referencing a doc'd order against the code order is needlessly confusing. Updated to match the actual code ordering and added a note that `image_frames` is sorted by camera index in the output regardless of the input order — so this argument controls which cameras load, not the output sequence.

Test plan

  • No code changes — pure docstring fix.
  • `grep` confirmed no other places quote the old camera ordering or the "If None" line.

Out of scope

This doesn't change the parameter annotation to `int | None`. If maintainers want the docstring promise honored at the code level instead, I'm happy to swap the fix direction in a follow-up.

Two small accuracy issues:

1. ``t0_us`` was documented as "If None, uses a timestamp 5.1s seconds into
   the clip." The signature is ``t0_us: int = 5_100_000`` — there is no
   None-handling, and passing None raises ``TypeError`` at the
   ``t0_us <= history_time_range_us`` comparison. Update the doc to describe
   the actual default and the precondition the function enforces.

2. The default ``camera_features`` order in the doc didn't match the code.
   Same set of four cameras, but listed in a different sequence, which is
   misleading when readers cross-reference. Update the doc to match the code
   order, and note that the returned ``image_frames`` are sorted by camera
   index regardless of input order (so this list controls *which* cameras
   load, not *in what order* they appear in the output).

Pure docstring change — no behavioral effect.

Signed-off-by: lonexreb <[email protected]>
@lonexreb lonexreb force-pushed the docs/load-pai-docstring-accuracy branch from 8061a83 to 23c8147 Compare May 4, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant