Add comprehensive test coverage for base classes and refactored components #52
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 PR introduced abstract base classes (
CellMapBaseDataset,CellMapImageBase) and refactored core components, but Codecov reported 53.33% patch coverage with 224 missing lines across key files.Changes
New test suites (72 tests):
test_base_classes.py- Validates ABC contract enforcement: instantiation failures for incomplete implementations, successful instantiation with all abstract methods implemented, type annotation verificationtest_subdataset.py- Previously untestedCellMapSubsetclass: property delegation to parent dataset, device transfers, transform setters, random sampling with/without replacement, edge cases (empty/single-index subsets)test_dataset_edge_cases.py- Special methods and properties inCellMapDataset: pickling (__reduce__), executor lifecycle (__del__, lazy init, fork handling), property getters (center, bounding boxes, sampling shapes), negative/out-of-bounds index handlingtest_image_edge_cases.py- Edge cases inCellMapImage: axis/scale/shape mismatch handling, device selection logic, spatial transforms, property getters, pad/interpolation parametersCoverage targets
Focused on files with most missing coverage from Codecov report:
base_dataset.py(6 lines) - ABC contract testsbase_image.py(6 lines) - ABC contract testssubdataset.py(untested) - Full coveragedataset.py(91 lines) - Special methods, properties, edge casesimage.py(17 lines) - Device handling, transforms, propertiesAll 255 tests passing.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.