Skip to content

Add uv inline script metadata and fix shebang lines#67

Merged
dave3d merged 4 commits into
mainfrom
add-uv-inline-metadata
Jul 15, 2026
Merged

Add uv inline script metadata and fix shebang lines#67
dave3d merged 4 commits into
mainfrom
add-uv-inline-metadata

Conversation

@dave3d

@dave3d dave3d commented Jun 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates executable headers across test and utility scripts to use uv run with inline script metadata, and modernizes parts of the main dicom2stl CLI module with type hints and clearer output/docs.

Changes:

  • Replaced legacy #!/usr/bin/env python shebangs with #!/usr/bin/env -S uv run and added inline script metadata blocks (Python + dependencies).
  • Updated dicom2stl/Dicom2STL.py with type hints, expanded docstrings, and small pipeline/print/debug behavior improvements.
  • Normalized various log/print strings and minor robustness tweaks (e.g., safer modality handling).

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
tests/write_series.py Add uv run shebang + inline script dependency metadata.
tests/test_vtkutils.py Add uv run shebang + inline script dependency metadata.
tests/test_vtk2sitk.py Add uv run shebang + inline script dependency metadata.
tests/test_sitkutils.py Add uv run shebang + inline script dependency metadata.
tests/test_sitk2vtk.py Add uv run shebang + inline script dependency metadata.
tests/test_dicomutils.py Add uv run shebang + inline script dependency metadata.
tests/megatest.py Add uv run shebang + inline script dependency metadata.
tests/create_data.py Add uv run shebang + inline script dependency metadata.
tests/compare_stats.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/vtkutils.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/vtk2sitk.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/sitk2vtk.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/regularize.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/parseargs.py Add uv run shebang + inline script dependency metadata.
dicom2stl/utils/dicomutils.py Add uv run shebang + inline script dependency metadata.
dicom2stl/Dicom2STL.py Add uv run shebang + inline script metadata; add typing/doc improvements and pipeline tweaks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dicom2stl/Dicom2STL.py
Comment on lines +2 to +9
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "SimpleITK>=2.5.3",
# "simpleitkutilities>=0.3.0",
# "vtk>=9.5.2",
# ]
# ///
Comment thread dicom2stl/Dicom2STL.py
Comment on lines 43 to 45
from dicom2stl.utils import dicomutils
from dicom2stl.utils import vtkutils
from dicom2stl.utils import parseargs
Comment thread dicom2stl/Dicom2STL.py
Comment on lines +64 to +67
Args:
fname: List of file paths or patterns to load
tempDir: Temporary directory for zip extraction (optional)
verbose: Verbosity level (0=quiet, 1=basic, 2=detailed)
Comment thread dicom2stl/Dicom2STL.py
Comment on lines +274 to +278
smoothN: int = 25,
reduceFactor: float = 0.9,
rotation: List[Union[str, float]] = ["X", 0.0],
debug: bool = False,
) -> vtk.vtkPolyData:
Comment thread tests/write_series.py
Comment on lines +2 to +8
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "numpy>=2.4.1",
# "SimpleITK>=2.5.3",
# ]
# ///
Comment on lines +2 to +8
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "SimpleITK>=2.5.3",
# "vtk>=9.5.2",
# ]
# ///
Comment on lines +2 to +8
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "SimpleITK>=2.5.3",
# "vtk>=9.5.2",
# ]
# ///
Comment on lines +2 to +7
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "SimpleITK>=2.5.3",
# ]
# ///
Comment thread dicom2stl/utils/parseargs.py Outdated
Comment on lines +3 to +4
# requires-python = ">=3.9"
# dependencies = []
Comment on lines +2 to +8
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "pydicom>=3.0.1",
# "SimpleITK>=2.5.3",
# ]
# ///
@dave3d
dave3d merged commit c194efe into main Jul 15, 2026
2 checks passed
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.

2 participants