Repository navigation
Conversation
Co-authored-by: mathdugre <16450132+mathdugre@users.noreply.github.com> Agent-Logs-Url: https://github.com/nipoppy/nipoppy/sessions/a565bd69-2e3b-459b-8088-3003f0c097ba
Co-authored-by: mathdugre <16450132+mathdugre@users.noreply.github.com> Agent-Logs-Url: https://github.com/nipoppy/nipoppy/sessions/a565bd69-2e3b-459b-8088-3003f0c097ba
Copilot
AI
changed the title
[WIP] Convert Optional types to type | None annotation
Modernize type hints: replace Mar 24, 2026
Optional[T] with T | None across codebase
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Contributor
|
This PR is stale because it has had no activity for 45 days. |
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.
This updates type annotations to the Python 3.10+ union style by replacing
Optional[...]with... | None, aligning the codebase with current typing guidance. The change is mechanical and scoped to annotation/style consistency, with one related inline note updated to match the new syntax.Typing modernization (PEP 604)
Optional[T]annotations withT | Nonein core modules and tests.Related cleanup
typing.Optionalimports left unused after conversion.typingimports (Type,List,Tuple) where no longer needed due to pyupgrade normalization.Documentation/comment alignment
nipoppy/layout.pythat described optional field typing so it now referencesOptionalFpathInfo | Noneinstead ofOptional[OptionalFpathInfo].Example transformation applied throughout:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
sandbox.zenodo.org/usr/bin/python /usr/bin/python -u -c import sys;exec(eval(sys.stdin.readline()))(dns block)zenodo.org/usr/bin/python /usr/bin/python -u -c import sys;exec(eval(sys.stdin.readline()))(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Optional[<type>]to<type> | None#935⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.