Skip to content

Comments

update to Python 3.13#71

Merged
kfrey-idm merged 7 commits intomainfrom
3.13
Feb 5, 2026
Merged

update to Python 3.13#71
kfrey-idm merged 7 commits intomainfrom
3.13

Conversation

@YeChen-IDM
Copy link
Collaborator

should we bump a minor version?

@YeChen-IDM YeChen-IDM requested a review from Copilot February 5, 2026 17:57
Copy link

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 updates the codebase to support Python 3.13 by adopting modern Python type hint syntax and string formatting conventions.

Changes:

  • Replaced legacy typing module 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}",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
_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}",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
_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}",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
_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}",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
  Replace | operator with Union/Optional to support Python 3.9+.
  Keep modern list/dict syntax which works in Python 3.9+.
@kfrey-idm kfrey-idm merged commit 0268324 into main Feb 5, 2026
17 of 27 checks passed
@kfrey-idm kfrey-idm deleted the 3.13 branch February 5, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants