Skip to content

Small fixes in module names and suffix handling#17

Merged
crnh merged 6 commits intomainfrom
crnh/fix/rename-modules
Mar 6, 2026
Merged

Small fixes in module names and suffix handling#17
crnh merged 6 commits intomainfrom
crnh/fix/rename-modules

Conversation

@crnh
Copy link
Member

@crnh crnh commented Mar 6, 2026

The submodule stl2mask is 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 in example.nii.stl and Path("example.nii.gz").suffix returns .gz. The helper functions replace / return all suffixes.

@crnh crnh requested a review from jwmbeenakker as a code owner March 6, 2026 12:46
@crnh crnh added the bug Something isn't working label Mar 6, 2026
@crnh crnh self-assigned this Mar 6, 2026
@crnh crnh requested review from Copilot March 6, 2026 12:46
Copy link

Copilot AI left a comment

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 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_mask and mask_to_stl modules.
  • 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings March 6, 2026 13:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@crnh crnh merged commit a8dd666 into main Mar 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants