Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #935 +/- ##
========================================
Coverage 99.69% 99.69%
========================================
Files 71 71
Lines 8934 8939 +5
Branches 1171 1170 -1
========================================
+ Hits 8907 8912 +5
Misses 23 23
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Pin tifffile <=v2025.5.10 |
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull Request Overview
Enable strict mypy type checking in the tiatoolbox/wsicore package by refining type hints, default values, and adding missing tests.
- Refined
wsimeta.pywith explicit imports, default fallbacks, and enforced return types - Enhanced
metadata/ngff.pyby adding__iter__toMultiscalesand tighteningWindowfield types - Added tests for non-tiled TIFF detection and
Multiscalesiteration; updated CI to include new files in mypy checks
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tiatoolbox/wsicore/wsimeta.py | Added cast, defaulted level_downsamples, explicit returns, and refactored scale logic for typing |
| tiatoolbox/wsicore/metadata/ngff.py | Implemented __iter__ on Multiscales, changed Window fields to int |
| tests/test_wsireader.py | New test_is_not_tiled_tiff to cover non-tiled TIFF cases |
| tests/test_meta_ngff_dataclasses.py | New test for Multiscales iteration order |
| .github/workflows/mypy-type-check.yml | Included wsicore files and directories in mypy job |
Comments suppressed due to low confidence (2)
tiatoolbox/wsicore/wsimeta.py:124
- A default list of [1.0] is used when
level_downsamplesis None, but there are no tests verifying this fallback. Consider adding tests for this scenario.
else [1.0]
tiatoolbox/wsicore/wsimeta.py:275
- The name 'Resolution' is not imported or defined, causing a NameError. Consider importing or defining the 'Resolution' type alias.
def np_pair(x: Resolution) -> np.ndarray:
shaneahmed
reviewed
May 30, 2025
# Conflicts: # .github/workflows/mypy-type-check.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
shaneahmed
reviewed
Jun 9, 2025
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.
Fix typing for files in
tiatoolbox/wsicore/tiatoolbox/wsicore/__init__.pytiatoolbox/wsicore/wsimeta.pytiatoolbox/wsicore/metadata/Will work on
tiatoolbox/wsicore/wsireader.pyafter #825