Small fixes in module names and suffix handling#17
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR renames the package’s conversion submodules to avoid name collisions with the top-level stl2mask package, and introduces helpers to correctly handle multi-extension filenames (e.g. .nii.gz) when computing/validating output paths in the CLIs.
Changes:
- Rename/adjust imports in tests and package exports to use
stl_to_maskandmask_to_stlmodules. - Add
full_suffix()/with_suffix()helpers and use them in both CLIs to handle multi-extension suffixes correctly. - Add dedicated tests for the new suffix helpers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_stl2mask.py | Updates imports/mocking to the renamed stl_to_mask module. |
| tests/test_mask2stl.py | Updates imports/mocking to the renamed mask_to_stl module and adjusts expected output name handling. |
| tests/test_helpers.py | Adds unit tests for multi-extension suffix handling helpers. |
| src/stl2mask/stl_to_mask.py | Uses new helpers for default output naming and suffix mismatch checking. |
| src/stl2mask/mask_to_stl.py | Uses new helpers for default output naming and suffix mismatch checking. |
| src/stl2mask/helpers.py | Introduces full_suffix() and with_suffix() utilities. |
| src/stl2mask/init.py | Updates package exports to the renamed submodules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jwmbeenakker
approved these changes
Mar 6, 2026
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.
The submodule
stl2maskis the same as the package name, making debugging the separate modules impossible (or at least impractical). The submodules have been renamed to fix this.I also added helper functions for handling files with multiple extensions, e.g.
Path("example.nii.gz").with_suffix(".stl")would result inexample.nii.stlandPath("example.nii.gz").suffixreturns.gz. The helper functions replace / return all suffixes.