-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Category: bug
Priority: P2
Summary
- example/python/scatter3d_demo fails to save outputs because the target directory is not created.
Evidence
- Command:
make example_python - Error:
FileNotFoundError: [Errno 2] No such file or directory: 'output/example/python/scatter3d_demo/scatter3d_demo.png'
- Trace excerpt:
File "example/python/scatter3d_demo/scatter3d_demo.py", line 29, in <module>
plt.savefig('output/example/python/scatter3d_demo/scatter3d_demo.png', dpi=100)
FileNotFoundError: [Errno 2] No such file or directory: 'output/example/python/scatter3d_demo/scatter3d_demo.png'
Reproduction
- From project root:
make example_python(Python 3.13)
Root cause (likely)
- The script writes to
output/example/python/scatter3d_demo/...but does not create that directory beforehand. Other Python examples save into their own example directory, so this is also inconsistent.
Proposed fix
- Either save alongside the script (consistent with other examples), e.g.
plt.savefig('scatter3d_demo.png'), or create the output directory first:
from pathlib import Path
outdir = Path('output/example/python/scatter3d_demo')
outdir.mkdir(parents=True, exist_ok=True)
plt.savefig(outdir / 'scatter3d_demo.png', dpi=100)Files
- example/python/scatter3d_demo/scatter3d_demo.py
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working