Add uv inline script metadata and fix shebang lines#67
Merged
Conversation
There was a problem hiding this comment.
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 pythonshebangs with#!/usr/bin/env -S uv runand added inline script metadata blocks (Python + dependencies). - Updated
dicom2stl/Dicom2STL.pywith 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 on lines
+2
to
+9
| # /// script | ||
| # requires-python = ">=3.9" | ||
| # dependencies = [ | ||
| # "SimpleITK>=2.5.3", | ||
| # "simpleitkutilities>=0.3.0", | ||
| # "vtk>=9.5.2", | ||
| # ] | ||
| # /// |
Comment on lines
43
to
45
| from dicom2stl.utils import dicomutils | ||
| from dicom2stl.utils import vtkutils | ||
| from dicom2stl.utils import parseargs |
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 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 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 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", | ||
| # ] | ||
| # /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.