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

Improve new time_ranges property python api & add snippet for time series view, explaining all its options #6221

Merged
merged 12 commits into from
May 8, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented May 3, 2024

What

Improve VisibleTimeRange python api and add a snippet for time series view which is the primary (but not sole!) user of this feature.

# Create a TimeSeries View
blueprint = rrb.Blueprint(
    rrb.TimeSeriesView(
        origin="/trig",
        # Set a custom Y axis.
        axis_y=rrb.ScalarAxis(range=(-1.0, 1.0), lock_range_during_zoom=True),
        # Configure the legend.
        plot_legend=rrb.PlotLegend(visible=False),
        # Set time different time ranges for different timelines.
        time_ranges=[
            # Sliding window depending on the time cursor for the first timeline.
            rrb.VisibleTimeRange(
                "timeline0",
                start=rrb.TimeRangeBoundary.cursor_relative(-100),
                end=rrb.TimeRangeBoundary.cursor_relative(),
            ),
            # Time range from some point to the end of the timeline for the second timeline.
            rrb.VisibleTimeRange(
                "timeline1",
                start=rrb.TimeRangeBoundary.absolute(300),
                end=rrb.TimeRangeBoundary.infinite(),
            ),
        ],
    )
)

TODO:

  • update usage on checklist test!
  • integrate with snippet reorg pr
  • put the snippet on to timeseries view
  • check again whether we can't make TimeRangeBoundary a union and if we can't or don't want note it down into the fbs file why

* think about how to document time range on other places and how to document usage of VisibleTimeRange type itself
* consider providing several snippets
* update docs on visible time range in the manual with some code examples while we're on it?

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@Wumpf Wumpf added 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API include in changelog labels May 3, 2024
Copy link

github-actions bot commented May 3, 2024

Deployed docs

Commit Link
a1d40e3 https://landing-4o66jbw9b-rerun.vercel.app/docs

@Wumpf Wumpf force-pushed the andreas/nicer-time-range-api branch from b3e6aee to 6ace680 Compare May 3, 2024 16:58
Wumpf added a commit that referenced this pull request May 8, 2024
…#6259)

### What

Part of a train 
* #6257
* #6258
* ➡️ #6259

Replaces a fair chunk of
* #6221

Makes `VisibleTimeRange` a union - the motivator for this pr train in
the first place. Adds a roundtrip test that compares the serialization
of`VisibleTimeRange` archetype across sdk languages. (the archetype is
meant for blueprint only, but I'm simply using the datastore for this
comparision)

### 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/6259?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/6259?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/6259)
- [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 Wumpf force-pushed the andreas/nicer-time-range-api branch from 6ace680 to 39560bb Compare May 8, 2024 14:21
@Wumpf Wumpf force-pushed the andreas/nicer-time-range-api branch from 39560bb to 6dab606 Compare May 8, 2024 14:33
@Wumpf Wumpf marked this pull request as ready for review May 8, 2024 14:34
Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 so much work to get here, but this is awesome!

@Wumpf Wumpf merged commit 8afcafa into main May 8, 2024
34 of 35 checks passed
@Wumpf Wumpf deleted the andreas/nicer-time-range-api branch May 8, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation include in changelog 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants