Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing parts of VisibleTimeRange API #6276

Closed
jleibs opened this issue May 9, 2024 · 2 comments · Fixed by #6306
Closed

Confusing parts of VisibleTimeRange API #6276

jleibs opened this issue May 9, 2024 · 2 comments · Fixed by #6306
Assignees
Labels
🟦 blueprint The data that defines our UI 🐍 Python API Python logging API
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented May 9, 2024

The TimeBoundary requires passing in a TimeInt.

  • In our set_time_seconds APIs, we allow floating point seconds values.
  • At the moment if you mistakenly pass a float in seconds, it's converted to an int implicitly (and incorrectly)
  • Proposal: make this require a rwarg: seq, seconds, or nanos

API doesn't make it clear you can't specify a time range more than one

  • Because the input takes the form of a list, it's not clear that you can't do:
    time_ranges=[
        rrb.VisibleTimeRange(
            "time",
            start=rrb.TimeRangeBoundary.absolute(0),
            end=rrb.TimeRangeBoundary.absolute(10),
        ),
        rrb.VisibleTimeRange(
            "time",
            start=rrb.TimeRangeBoundary.absolute(20),
            end=rrb.TimeRangeBoundary.absolute(30),
        ),
    ]

as a user I might expect this to give me the union of the two ranges. Instead I believe it's simply first-value-wins for the timeline key.

  • At a minimum we should probably warn on duplicate values here.
@jleibs jleibs added 🐍 Python API Python logging API 🟦 blueprint The data that defines our UI labels May 9, 2024
@jleibs jleibs added this to the 0.16 milestone May 9, 2024
@jleibs jleibs changed the title TimeBoundary types should also support floating point seconds Confusing parts of VisibleTimeRange API May 9, 2024
@Wumpf
Copy link
Member

Wumpf commented May 13, 2024

nothing to add to the first point and I think it's quite important to improve this as suggested.

API doesn't make it clear you can't specify a time range more than one

it is documented that it's a first value wins situation /// If a timeline is listed twice, the first entry will be used..
We could look into making this also take a dictionary but that gets tricky to map out to the existing data structures. I'm not convinced yet this is that much of a problem to justify a lot more time spent on it.

@jleibs
Copy link
Member Author

jleibs commented May 13, 2024

it is documented that it's a first value wins situation

Not in the doc visible in the editor:
Image

This other thing I was thinking we could do would just be scan them and print a warning.

Wumpf added a commit that referenced this issue May 13, 2024
…hon (#6298)

### What

* First half of #6276

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6298?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6298?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6298)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Wumpf added a commit that referenced this issue May 14, 2024
### What

* Fixes #6276
* Better doc visibility
* Warn if a timeline is specified twice

Collateral:
* generate `__hash__` methods for trivial python classes
* fix issue with `pixi run py-test`

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6306?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6306?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6306)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🟦 blueprint The data that defines our UI 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants