Skip to content

Commit

Permalink
Update the python API docs site for the new APIs (#3565)
Browse files Browse the repository at this point in the history
### What
 - Builds on top of: #3564
 - Resolves: #3437
 
Replaces the logging functions with the archetypes.
Moves the deprecated function to their own section.

Also fixes the color inversion issue.

### 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 [demo.rerun.io](https://demo.rerun.io/pr/3565) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3565)
- [Docs
preview](https://rerun.io/preview/85bdc0990d13a21c0cf1c2385e6601af2a9edaf8/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/85bdc0990d13a21c0cf1c2385e6601af2a9edaf8/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
jleibs authored Oct 2, 2023
1 parent a044f51 commit 23dd97b
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 57 deletions.
4 changes: 4 additions & 0 deletions rerun_py/docs/css/mkdocstrings.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ html {
background: white;
}

img {
filter: invert(1) contrast(100%) hue-rotate(180deg);
}

body {
font-family: "Plus Jakarta Sans", sans-serif;
font-weight: 500;
Expand Down
106 changes: 59 additions & 47 deletions rerun_py/docs/gen_common_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,88 +54,68 @@ class Section:
class_list=[],
),
Section(
title="Viewer Control",
title="Logging",
module_summary=None,
func_list=["save"],
class_list=[],
),
Section(
title="Time",
module_summary=None,
func_list=["set_time_sequence", "set_time_seconds", "set_time_nanos"],
func_list=["log", "set_time_sequence", "set_time_seconds", "set_time_nanos"],
class_list=[],
),
Section(
title="Spatial Primitives",
module_summary=None,
func_list=[
"log_point",
"log_points",
"log_rect",
"log_rects",
"log_obb",
"log_line_strip",
"log_line_segments",
"log_arrow",
"log_mesh",
"log_meshes",
"log_mesh_file",
func_list=[],
class_list=[
"Points2D",
"Points3D",
"Boxes2D",
"Boxes3D",
"LineStrips2D",
"LineStrips3D",
"Arrows3D",
"Mesh3D",
"Asset3D",
],
class_list=[],
),
Section(
title="Images",
module_summary=None,
func_list=["log_image", "log_image_file", "log_depth_image", "log_segmentation_image"],
class_list=[],
func_list=[],
class_list=["Image", "ImageEncoded", "SegmentationImage", "DepthImage"],
),
Section(
title="Tensors",
module_summary=None,
func_list=["log_tensor"],
class_list=[],
func_list=[],
class_list=["Tensor"],
),
Section(
title="Annotations",
module_summary=None,
func_list=["log_annotation_context"],
class_list=["ClassDescription", "AnnotationInfo"],
),
Section(
title="Extension Components",
module_summary=None,
func_list=["log_extension_components"],
class_list=[],
func_list=[],
class_list=["AnnotationContext", "ClassDescription", "AnnotationInfo"],
),
Section(
title="Plotting",
module_summary=None,
func_list=["log_scalar"],
class_list=[],
func_list=[],
class_list=["TimeSeriesScalar"],
),
Section(
title="Transforms",
module_summary="log_deprecated.transform",
func_list=[
"log_transform3d",
"log_pinhole",
"log_disconnected_space",
"log_view_coordinates",
# "log_rigid3", Intentionally removed from the docs - deprecated since 0.7.
],
class_list=[],
func_list=[],
class_list=["Transform3D"],
),
Section(
title="Text",
module_summary=None,
func_list=["log_text_entry"],
class_list=["LoggingHandler"],
func_list=[],
class_list=["TextDocument", "TextLog", "LoggingHandler"],
),
Section(
title="Clearing Entities",
module_summary=None,
func_list=["log_cleared"],
class_list=[],
func_list=[],
class_list=["Clear"],
),
Section(
title="Helpers",
Expand All @@ -154,6 +134,36 @@ class Section:
],
class_list=[],
),
Section(
title="Deprecated Logging Methods",
module_summary=None,
func_list=[
"log_point",
"log_points",
"log_rect",
"log_rects",
"log_obb",
"log_line_strip",
"log_line_segments",
"log_arrow",
"log_mesh",
"log_meshes",
"log_mesh_file",
"log_image",
"log_image_file",
"log_depth_image",
"log_segmentation_image",
"log_tensor",
"log_scalar",
"log_transform3d",
"log_pinhole",
"log_disconnected_space",
"log_view_coordinates",
"log_text_entry",
"log_cleared",
],
class_list=[],
),
]

# Virtual folder where we will generate the md files
Expand Down Expand Up @@ -228,7 +238,9 @@ def make_slug(s: str) -> str:
# fd.write(f"::: rerun.{class_name}\n")
fd.write(f"::: rerun.{class_name}\n")
fd.write(" options:\n")
fd.write(" show_root_heading: true\n")
fd.write(" heading_level: 4\n")
fd.write(" inherited_members: true\n")

# Write out a table for the section in the index_file
index_file.write(f"## {section.title}\n")
Expand Down
6 changes: 3 additions & 3 deletions rerun_py/docs/package/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Full Package

- [rerun][]: Top-level User-facing APIs. See also: [Common APIs](../common/)
- [rerun.log][]: APIs for logging data
- [rerun.color_conversion][]: Conversion utilities related to colors
- [rerun.components][]: Helpers for constructing arrow components
- [rerun.archetypes][]: Common objects for logging tagged data understood by the viewer, e.g. Points and Lines.
- [rerun.components][]: Individual components of the archetypes, e.g. Positions and Colors.
- [rerun.datatypes][]: Data types used to represent the components, e.g. Vectors and Matrices.
- [rerun_demo][]: Utilities related to running rerun demos
- [rerun_demo.data][]: Specific helpers for generating data
4 changes: 1 addition & 3 deletions rerun_py/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ plugins:
docstring_style: numpy
members_order: source
heading_level: 3
show_root_heading: true
merge_init_into_class: true
inherited_members: true
- gen-files: # https://oprypin.github.io/mkdocs-gen-files
scripts:
- docs/gen_common_index.py
Expand Down Expand Up @@ -62,4 +61,3 @@ extra:
version:
provider: mike
default: latest

12 changes: 8 additions & 4 deletions rerun_py/rerun_sdk/rerun/_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ def __str__(self) -> str:


class ImageEncoded(AsComponents):
"""
A monochrome or color image encoded with a common format (PNG, JPEG, etc).
The encoded image can be loaded from either a a file using its `path` or
provided directly via `contents`.
"""

def __init__(
self,
*,
Expand All @@ -46,10 +53,7 @@ def __init__(
draw_order: DrawOrderLike | None = None,
) -> None:
"""
A monochrome or color image encoded with a common format (PNG, JPEG, etc).
The encoded image can be loaded from either a a file using its `path` or
provided directly via `contents`.
Create a new image with a given format.
Parameters
----------
Expand Down

1 comment on commit 23dd97b

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.

Benchmark suite Current: 23dd97b Previous: a044f51 Ratio
mono_points_arrow/generate_message_bundles 24109750 ns/iter (± 1366670) 18913635 ns/iter (± 823023) 1.27

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.