Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the codebase to support Python 3.13 by adopting modern Python type hint syntax and string formatting conventions.
Changes:
- Replaced legacy
typingmodule imports with built-in type hints (e.g.,List[int]→list[int],Union[str, int]→str | int) - Converted old-style string formatting (
.format()and%operator) to f-strings - Added Python 3.13 to supported versions in pyproject.toml and updated CI/CD workflows to use Python 3.13
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added Python version classifiers 3.9-3.14 to declare compatibility |
| emod_api/weather/weather.py | Modernized type hints by replacing typing module imports with built-in generics |
| emod_api/spatialreports/spatial.py | Updated type annotations to use native list/dict types |
| emod_api/serialization/dtkFileUtility.py | Converted format strings to f-strings throughout |
| emod_api/serialization/dtkFileTools.py | Replaced .format() calls with f-strings in error messages |
| emod_api/serialization/SerializedPopulation.py | Updated type hints and replaced typing.Union with pipe operator |
| emod_api/demographics/*.py | Modernized type hints and converted string formatting to f-strings across multiple distribution modules |
| emod_api/config/*.py | Updated type hints and converted to f-string formatting |
| emod_api/channelreports/*.py | Replaced typing module imports with native type hints |
| emod_api/campaign.py | Converted string formatting to f-string |
| docs/index.md | Added Python 3.13 version documentation |
| README.md | Added Python version requirement notice |
| .github/workflows/*.yml | Updated CI/CD workflows to use Python 3.13 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _validation_messages = { | ||
| 'fixed_value_check': { | ||
| True: "key: %s value: %s does not match expected value: %s", | ||
| True: "key: {0} value: {1} does not match expected value: {2}", |
There was a problem hiding this comment.
The validation message still uses positional format placeholders ({0}, {1}, {2}) instead of f-string syntax. While this works with .format(), consider using named placeholders or converting to f-strings for consistency with the rest of the PR changes.
| _validation_messages = { | ||
| 'fixed_value_check': { | ||
| True: "key: %s value: %s does not match expected value: %s", | ||
| True: "key: {0} value: {1} does not match expected value: {2}", |
There was a problem hiding this comment.
The validation message uses positional format placeholders ({0}, {1}, {2}) instead of f-string syntax. While this works with .format(), consider using named placeholders or converting to f-strings for consistency with the rest of the PR changes.
| _validation_messages = { | ||
| 'fixed_value_check': { | ||
| True: "key: %s value: %s does not match expected value: %s", | ||
| True: "key: {0} value: {1} does not match expected value: {2}", |
There was a problem hiding this comment.
The validation message uses positional format placeholders ({0}, {1}, {2}) instead of f-string syntax. While this works with .format(), consider using named placeholders or converting to f-strings for consistency with the rest of the PR changes.
| _validation_messages = { | ||
| 'fixed_value_check': { | ||
| True: "key: %s value: %s does not match expected value: %s", | ||
| True: "key: {0} value: {1} does not match expected value: {2}", |
There was a problem hiding this comment.
The validation message uses positional format placeholders ({0}, {1}, {2}) instead of f-string syntax. While this works with .format(), consider using named placeholders or converting to f-strings for consistency with the rest of the PR changes.
Replace | operator with Union/Optional to support Python 3.9+. Keep modern list/dict syntax which works in Python 3.9+.
should we bump a minor version?