Skip to content

Commit 16edcd7

Browse files
committed
docs(example): add uv annotation for standalone exec
1 parent 4800f80 commit 16edcd7

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

examples/validation/camera_jump.py

100644100755
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
#!/usr/bin/env -S uv run --script
2+
#
3+
# /// script
4+
# requires-python = ">=3.12"
5+
# dependencies = [
6+
# "trame>=3.13.2",
7+
# "trame-vtklocal>=1",
8+
# "vtk==9.6.20260517.dev0",
9+
# ]
10+
#
11+
# [[tool.uv.index]]
12+
# url = "https://wheels.vtk.org"
13+
# ///
14+
115
import asyncio
216

317
# Required for vtk factory
@@ -100,7 +114,8 @@ async def _animate(self):
100114
if resolution < 4:
101115
self.delta = +1
102116

103-
self.on_resolution_change(resolution + self.delta)
117+
with self.state:
118+
self.state.resolution = resolution + self.delta
104119

105120
def _build_ui(self):
106121
with DivLayout(self.server) as self.ui:

0 commit comments

Comments
 (0)