Skip to content

Conversation

@psi29a
Copy link
Member

@psi29a psi29a commented Nov 17, 2025

  • updated to support python 3.14 (min ver: 3.9)
  • dropped support for python 2
  • requires PyPlatec 1.4.2
  • refactored; but worldengine-data was never modified and still passes
  • dropped travis and appveyor
  • added github actions for all 3 major platforms
  • packages are built on github; used for pypi

Copy link
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 pull request represents a major infrastructure overhaul focused on modernizing the codebase for Python 3 compatibility, code formatting standardization, and dependency updates.

Purpose: Modernize the worldengine project by removing Python 2 support, applying consistent code formatting (likely via Black/autopep8), updating dependencies, and regenerating protobuf code with newer compiler versions.

Key Changes:

  • Migration from Python 2 to Python 3 (removing six, updating metaclass syntax, using f-strings)
  • Code formatting standardization (double quotes, spacing, line wrapping)
  • Protobuf code regeneration with version 6.33.1
  • Tox configuration updates for Python 3.9-3.14
  • Dependency modernization in requirements

Reviewed Changes

Copilot reviewed 63 out of 74 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
worldengine/protobuf/World_pb2.py Regenerated protobuf code using protoc 6.33.1 with modern API patterns
worldengine/biome.py Removed six dependency, updated metaclass syntax to Python 3 style
worldengine/hdf5_serialization.py Updated HDF5 API calls from deprecated .value to [()] accessor
worldengine/draw.py Added numpy type conversion to prevent uint8 overflow in NumPy 2.x
worldengine/step.py Removed object inheritance, updated to Python 3 class syntax
worldengine/simulations/*.py Standardized formatting and removed object inheritance
worldengine/model/world.py Updated string formatting to f-strings, improved code layout
tox.ini Updated to support Python 3.9-3.14 with modern tox configuration
tests/*.py Updated assertions from assertEquals to assertEqual
requirements*.txt Removed outdated dependency files (consolidated into setup/tox)

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

humids = world.humids
precipitationWeight = 1.0
irrigationWeight = 3
data = numpy.zeros((world.height, world.width), dtype=float)
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

This assignment to 'data' is unnecessary as it is redefined before this value is used.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

from worldengine.model.world import *
from worldengine.draw import *
from worldengine.image_io import PNGWriter
from worldengine.model.world import *
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

Import pollutes the enclosing namespace, as the imported module worldengine.model.world does not define 'all'.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@classmethod
def from_dict(cls, in_dict):
instance = World(in_dict['name'], Size(in_dict['width'], in_dict['height']))
instance = World(in_dict["name"], Size(in_dict["width"], in_dict["height"]))
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

Call to World.init with too few arguments; should be no fewer than 4.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <[email protected]>
Copy link
Contributor

Copilot AI commented Nov 17, 2025

@psi29a I've opened a new pull request, #272, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 17, 2025

@psi29a I've opened a new pull request, #273, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 17, 2025

@psi29a I've opened a new pull request, #274, to work on those changes. Once the pull request is ready, I'll request review from you.

@psi29a psi29a merged commit 6783f4c into master Nov 17, 2025
23 checks passed
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