Skip to content

fix examples #64

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix examples #64

wants to merge 2 commits into from

Conversation

YangDan-11
Copy link

@YangDan-11 YangDan-11 commented May 19, 2025

Complete the file content adjustment in the example directory to achieve the local environment quick startup function

updates:

  1. The asset resource paths are uniformly adjusted to relative paths, eliminating the reliance on absolute paths and improving code portability
  2. Set the default value of MAKE_DOCS to None, and set environment variables locally to determine whether it is document mode or application mode
  3. Regenerate md files

@YangDan-11 YangDan-11 requested a review from Copilot May 19, 2025 06:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR standardizes example code and documentation by introducing a MAKE_DOCS flag for conditional skips, converting asset paths to relative resolution, and fixing minor typos/formatting in markdown.

  • Add MAKE_DOCS environment flag with nullcontext fallback and update @app.spawn(start=True) usage
  • Switch asset references to dynamic Path-based relative paths
  • Correct typos (e.g., meterialmaterial) and remove extraneous blank lines

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/examples/11_coordinates_markers.md Removed an extra blank line
docs/examples/08_experimental_depth_image.py Added os/nullcontext imports, MAKE_DOCS flag, updated skip & spawn
docs/examples/08_experimental_depth_image.md Updated @app.spawn decorator to include start=True
docs/examples/07b_vr_hud.py Added os/nullcontext imports, MAKE_DOCS flag, updated skip
docs/examples/07_background_image.py Introduced assets_folder via Path, MAKE_DOCS flag, updated reader path, added doc.flush()
docs/examples/07_background_image.md Switched hardcoded path to assets_folder variable
docs/examples/06_depth_texture.py Added os/nullcontext imports, MAKE_DOCS flag, updated skip
docs/examples/06_depth_texture.md Removed an extraneous blank line
docs/examples/05_pointcloud_animation_upsert.md Imported VuerSession, updated handler signature & proxy.upsert call
docs/examples/05_pointcloud_animation.md Removed an extraneous blank line
docs/examples/05_collecting_render_procedural.md Fixed typo meterialmaterial
docs/examples/05_collecting_render.py Changed MAKE_DOCS default to None
docs/examples/05_collecting_render.md Fixed typo meterialmaterial
docs/examples/04_imperative_api.py Minor formatting adjustment (trailing whitespace)
docs/examples/04_imperative_api.md Fixed typo meterialmaterial
docs/examples/02_pointcloud_pcd.py Added import os; conditional skip uses MAKE_DOCS
docs/examples/02_pointcloud_pcd.md Added import os in code snippet
docs/examples/02_pointcloud.md Added a leading blank line
docs/examples/01_trimesh.py Removed port arg, updated MAKE_DOCS default, but missing import os
docs/examples/01_trimesh.md Removed port arg, dropped materialType, formatting adjustments
Comments suppressed due to low confidence (3)

docs/examples/01_trimesh.py:5

  • The code references os.getenv but os is not imported in this file, which will cause a NameError. Please add import os at the top.
MAKE_DOCS = os.getenv("MAKE_DOCS", None)

docs/examples/02_pointcloud_pcd.py:17

  • Both MAKE_DOCS and nullcontext are referenced here but not defined or imported. Please add import os, from contextlib import nullcontext, and define MAKE_DOCS = os.getenv("MAKE_DOCS", None) at the top of the file.
with doc, doc.skip if MAKE_DOCS else nullcontext():

docs/examples/02_pointcloud_pcd.md:10

  • [nitpick] This snippet adds import os but the MAKE_DOCS flag and nullcontext are still undefined when used with doc.skip. Consider including MAKE_DOCS = os.getenv("MAKE_DOCS", None) and from contextlib import nullcontext for clarity.
import os

@YangDan-11 YangDan-11 requested review from crazypisces and geyang May 19, 2025 06: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