Skip to content

bug: Python scatter3d demo fails to save due to missing output directory #1076

@krystophny

Description

@krystophny

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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions