Skip to content

Commit aed2a12

Browse files
committed
Minor typing fixes, refactor launcher into its own package
1 parent 4ac8d67 commit aed2a12

10 files changed

Lines changed: 26 additions & 122 deletions

File tree

.github/workflows/website.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v6
2020
- uses: astral-sh/setup-uv@v7
21-
22-
- run: ln readme.md website/index.md
23-
- run: uvx zensical build
24-
21+
- run: ln readme.md website/index.md
22+
- run: uvx zensical build
23+
- run: mv site _site
2524
- uses: actions/upload-pages-artifact@v4
26-
with:
27-
path: site
28-
2925
- uses: actions/deploy-pages@v4
26+

examples/basic/demo.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@ class Assets:
1919
@staticmethod
2020
def street() -> Path:
2121
import pooch
22-
return pooch.retrieve(
22+
return Path(pooch.retrieve(
2323
url="https://w.wallhaven.cc/full/e7/wallhaven-e778vr.jpg",
2424
known_hash="xxh128:60f452b021f2ccb1e4a06d54bd27959d",
2525
path=shaderflow.directories.user_data_path,
2626
progressbar=True,
27-
)
27+
))
2828

2929
@staticmethod
3030
def ethereal() -> Path:
3131
import pooch
32-
return pooch.retrieve(
32+
return Path(pooch.retrieve(
3333
url="https://w.wallhaven.cc/full/ex/wallhaven-ex6kmr.jpg",
3434
known_hash="xxh128:86ceea1b29cae24b2c3b58d1c6a58c27",
3535
path=shaderflow.directories.user_data_path,
3636
progressbar=True,
37-
)
37+
))
3838

3939
@staticmethod
4040
def chungus() -> Path:
4141
"""Big Buck Bunny video (CC BY-SA 3.0)"""
4242
import pooch
43-
return pooch.retrieve(
43+
return Path(pooch.retrieve(
4444
url="https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_60fps_normal.mp4.zip",
4545
known_hash="xxh128:497645dbba6435312c9e5779c9c4cb70",
4646
path=shaderflow.directories.user_data_path,
4747
processor=pooch.Unzip(),
4848
progressbar=True,
49-
)[0]
49+
)[0])
5050

5151
# ---------------------------------------------------------------------------- #
5252

@@ -65,7 +65,7 @@ def build(self):
6565
# ---------------------------------------------------------------------------- #
6666

6767
class MultiShader(ShaderScene):
68-
"""Basic scene with two shaders acting together, main shader referencing the child"""
68+
"""Basic scene with two shaders acting together"""
6969

7070
def build(self):
7171
self.child = ShaderProgram(scene=self, name="child")
@@ -91,7 +91,7 @@ def build(self):
9191
# ---------------------------------------------------------------------------- #
9292

9393
class Multipass(ShaderScene):
94-
"""Many Layers ('Buffers') done on a single shader"""
94+
"""Multi layers done on a single shader"""
9595

9696
def build(self):
9797
ShaderTexture(scene=self, name="background").from_image(Assets.street())
@@ -101,7 +101,7 @@ def build(self):
101101
# ---------------------------------------------------------------------------- #
102102

103103
class MotionBlur(ShaderScene):
104-
"""Poor's man Motion Blur. If you dislike the effect, definitely don't run this"""
104+
"""Poor's man Motion Blur"""
105105

106106
def build(self):
107107
ShaderTexture(scene=self, name="background").from_image(Assets.street())

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies = [
1919
"numpy-quaternion",
2020
"numpy",
2121
"ordered-set~=4.1",
22+
"parsenaut",
2223
"pillow",
2324
"platformdirs~=4.0",
2425
"pooch~=1.0",

shaderflow/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from importlib.metadata import metadata
44

5-
__meta__: dict = metadata(__package__)
6-
__about__: str = __meta__.get("Summary")
7-
__author__: str = __meta__.get("Author")
8-
__version__: str = __meta__.get("Version")
5+
__meta__ = metadata(str(__package__))
6+
__about__ = __meta__.get("Summary")
7+
__author__ = __meta__.get("Author")
8+
__version__ = __meta__.get("Version")
99

1010
from pathlib import Path
1111

shaderflow/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import sys
22

3+
from parsenaut._cyclopts import Launcher
4+
35
import shaderflow
4-
from shaderflow.launcher import SceneLauncher
56

67

78
def main():
8-
app = SceneLauncher()
9-
app.common(package=shaderflow.package)
9+
app = Launcher(keyword="Scene")
10+
app.smart(package=shaderflow.package)
1011
app.cli(sys.argv[1:])
1112

1213
if __name__ == "__main__":

shaderflow/frametimer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def update(self):
2525
while len(self.frametimes) > self.length:
2626
self.frametimes.popleft()
2727

28-
def percent(self, percent: float=1) -> float:
28+
def percent(self, percent: float=1) -> np.ndarray:
2929
cut = int(len(self.frametimes) * (percent/100))
3030
return np.sort(self.frametimes)[-cut:]
3131

shaderflow/launcher.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

shaderflow/scene.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from cyclopts import App as Cyclopts
1717
from cyclopts import Parameter
1818
from imgui_bundle import imgui
19+
from parsenaut._cyclopts import Launcher
1920

2021
import shaderflow
2122
from shaderflow import logger
@@ -30,7 +31,6 @@
3031
from shaderflow.scheduler import Scheduler
3132
from shaderflow.shader import ShaderProgram
3233
from shaderflow.temp.imgui_window import ModernglWindowRenderer
33-
from shaderflow.utils import CycloUtils
3434
from shaderflow.variable import ShaderVariable, Uniform
3535

3636
if TYPE_CHECKING:
@@ -209,7 +209,7 @@ def __attrs_post_init__(self) -> None:
209209
self.ffmpeg.cli_vcodecs(self.cli)
210210
self.ffmpeg.cli_acodecs(self.cli)
211211
self.cli.command(self.main)
212-
CycloUtils.chain(self.cli)
212+
Launcher.chain(self.cli)
213213

214214
# -------------------------------------------------------------------------|
215215
# Temporal

shaderflow/utils.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

website/about/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ icon: material/file-document-edit
1111
- Move website to tremeschin.com domain
1212
- Fix `Scene.resolution = (w, h)` using positionals in `Scene.resize`
1313
- Simplify remove `scene._scale` field in favor of `.main()` or `.resize()` argument
14+
- Refactor scene launcher and cyclopts utils in own package [`parsenaut`](https://pypi.org/project/parsenaut/)
1415

1516
### 📦 v0.10.0 <small>March 12, 2026</small> {#v0.10.0}
1617

0 commit comments

Comments
 (0)