Additional fixes for py3.12: Fix Swin args, update docs workflow#124
Open
C-Achard wants to merge 3 commits into
Open
Additional fixes for py3.12: Fix Swin args, update docs workflow#124C-Achard wants to merge 3 commits into
C-Achard wants to merge 3 commits into
Conversation
Improve SwinUNETR_ initializer error handling: when parent_init raises a TypeError, check for an 'img_size' kwarg and, if present, log a warning about MONAI API compatibility, remove 'img_size' and retry initialization. The previous fallback that forced in_channels=1 has been removed. If 'img_size' is not present, the original TypeError is re-raised so other errors are not silently swallowed.
Restrict the docs extra to "jupyter-book<2" instead of an unbounded "jupyter-book" to prevent automatic upgrades to jupyter-book 2.x, which may introduce breaking changes to the docs build and toolchain compatibility.
Replace the old single-job deploy workflow with a modern two-stage docs workflow: build and deploy. Adds path and pull_request triggers, workflow_dispatch support, concurrency, and read permissions for contents. The build job checks out code, sets up Python 3.12, installs docs dependencies, builds the Jupyter Book and uploads the HTML artifact (skip on PRs). The deploy job runs only on main (non-PR), requests pages and id-token permissions, sets the github-pages environment, and uses actions/deploy-pages@v4 to publish instead of the previous peaceiris action. Also modernizes action versions and enables pip caching.
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.
Scope
Summary
This pull request updates the documentation build workflow and improves compatibility with dependencies in both the GitHub Actions workflow and the codebase. The main changes include a significant refactor of the documentation CI pipeline, a fix for SwinUNETR initialization to handle MONAI API changes, and a restriction on the
jupyter-bookversion to avoid breaking changes.Documentation workflow improvements:
.github/workflows/build_docs.yml: Refactored the GitHub Actions workflow for building and deploying documentation. The workflow now triggers on pushes and pull requests affecting documentation-related files, splits the build and deploy steps, adds concurrency controls, and uses the latest actions and Python 3.12. Deployment is handled with the officialactions/deploy-pagesaction.Dependency compatibility:
pyproject.toml: Restricted thejupyter-bookdependency to versions below 2 to prevent incompatibility issues with breaking changes in newer versions.Model initialization robustness:
napari_cellseg3d/code_models/models/model_SwinUNetR.py: Improved the SwinUNETR model initialization logic to retry without theimg_sizeparameter if aTypeErroroccurs, addressing MONAI API compatibility issues.