Skip to content

🤖 AI Suggested Fixes#1046

Merged
shaneahmed merged 11 commits intodevelopfrom
ai-fixes
Mar 31, 2026
Merged

🤖 AI Suggested Fixes#1046
shaneahmed merged 11 commits intodevelopfrom
ai-fixes

Conversation

@shaneahmed
Copy link
Copy Markdown
Member

@shaneahmed shaneahmed commented Mar 30, 2026

This PR updates documentation and improves code clarity across the project. It revises Python version references to reflect supported/testing versions, fixes typos and formatting issues, and enhances several docstrings. Minor code quality improvements include clearer error messages, corrected variable names, and removal of redundant statements. The NuClick post‑processing logic is updated for compatibility with newer scikit‑image behavior. No functional or API-breaking changes are introduced.

@shaneahmed shaneahmed added this to the Release 2.0.2 milestone Mar 30, 2026
@shaneahmed shaneahmed self-assigned this Mar 30, 2026
@shaneahmed shaneahmed requested a review from Jiaqi-Lv March 30, 2026 09:47
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 applies a small set of cleanup fixes across visualization, engine docs, package init, and documentation.

Changes:

  • Removes a duplicated __setattr__ call in TileServer.update_renderer.
  • Fixes type annotation syntax in docstrings for return_predictions.
  • Tweaks _lazy_import error raising and fixes minor documentation formatting (Python code examples).

Reviewed changes

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

Show a summary per file
File Description
tiatoolbox/visualization/tileserver.py Cleans up renderer update logic and adjusts annotation overlay loading branching.
tiatoolbox/models/engine/multi_task_segmentor.py Docstring typing fix for return_predictions.
tiatoolbox/models/engine/engine_abc.py Removes redundant/unused lines in inference and validation helpers.
tiatoolbox/__init__.py Comment typo fix and updates _lazy_import error construction.
docs/pretrained.rst Adds missing commas in code examples for valid Python syntax.
Comments suppressed due to low confidence (1)

tiatoolbox/visualization/tileserver.py:644

  • In _add_annotation_overlay, the else branch calls sq.dump(tmp_path) but sq is still None for any suffix that isn't .geojson, .dat, or .db (e.g., .tif appears in the overlay file list). This will raise an AttributeError. Restructure the logic so sq is always initialized before dumping (e.g., create/load a store for supported non-DB formats then dump to a temp .db, or raise a clear error for unsupported suffixes).
        else:
            # make a temporary db for the new annotations
            tmp_path = Path(tempfile.gettempdir()) / f"temp_{session_id}.db"
            sq.dump(tmp_path)
            sq = SQLiteStore(tmp_path)

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.88%. Comparing base (44558a8) to head (5bdf429).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1046      +/-   ##
===========================================
- Coverage    99.88%   99.88%   -0.01%     
===========================================
  Files           85       85              
  Lines        11577    11576       -1     
  Branches      1513     1513              
===========================================
- Hits         11564    11563       -1     
  Misses           6        6              
  Partials         7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shaneahmed shaneahmed merged commit abbd2a3 into develop Mar 31, 2026
15 of 17 checks passed
@shaneahmed shaneahmed deleted the ai-fixes branch March 31, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants