Skip to content

added new unittests#109

Merged
Hendrik-code merged 1 commit into
mainfrom
c_coverage
May 27, 2026
Merged

added new unittests#109
Hendrik-code merged 1 commit into
mainfrom
c_coverage

Conversation

@Hendrik-code
Copy link
Copy Markdown
Owner

increase code coverage by adding lots of new unittests

@Hendrik-code Hendrik-code self-assigned this May 27, 2026
Copilot AI review requested due to automatic review settings May 27, 2026 15:04
@Hendrik-code Hendrik-code added the enhancement New feature or request label May 27, 2026
Copy link
Copy Markdown
Contributor

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 expands unit test coverage across several TPTBox core modules (vertebra constants, NumPy utilities, and NII I/O / morphology) and cleans up some boilerplate (sys.path hacks, duplicate imports) in existing test files. It also adds a pytest.ini_options section to silence deprecation/future warnings and refines the coverage exclude patterns.

Changes:

  • Add new test classes covering Vertebra_Instance region accessors, navigation helpers, Location enum, and vert_subreg_labels.
  • Add new test classes covering many np_utils functions (bbox, point coords, translate-to-center, convex hull, Betti numbers, majority label overlap, top-k indices) and NII I/O + morphology (erode_msk, dilate_msk, fill_holes, get_seg_array, from_numpy, save/load round-trip).
  • Remove sys.path manipulation and redundant imports from existing test files; configure pytest warning filters and tighten coverage exclude regex patterns in pyproject.toml.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
unit_tests/test_vertconstants.py Drops sys.path boilerplate; adds tests for region accessors, navigation helpers, and Location enum.
unit_tests/test_nputils.py Removes sys.path/noqa boilerplate from import block.
unit_tests/test_nputils_extended.py Adds tests for bbox, point coords, translate-to-center, convex hull, Betti numbers, majority label overlap, top-k.
unit_tests/test_nii.py Removes unused sys/Path imports and a duplicate nibabel import inside a method.
unit_tests/test_nii_io.py New file: save/load round-trip and from_numpy factory tests.
unit_tests/test_nii_extended.py Adds tests for erode_msk/dilate_msk, fill_holes, and get_seg_array.
pyproject.toml Adds pytest warning filters; refines coverage exclude patterns.

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

@Hendrik-code Hendrik-code merged commit 3906165 into main May 27, 2026
6 checks passed
@Hendrik-code Hendrik-code deleted the c_coverage branch May 27, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants