Conversation
There was a problem hiding this comment.
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.
worldengine/simulations/humidity.py
Outdated
| @@ -20,17 +20,20 @@ def _calculate(world): | |||
| irrigationWeight = 3 | |||
| data = numpy.zeros((world.height, world.width), dtype=float) | |||
There was a problem hiding this comment.
This assignment to 'data' is unnecessary as it is redefined before this value is used.
There was a problem hiding this comment.
@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 * |
There was a problem hiding this comment.
Import pollutes the enclosing namespace, as the imported module worldengine.model.world does not define 'all'.
There was a problem hiding this comment.
@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"])) |
There was a problem hiding this comment.
Call to World.init with too few arguments; should be no fewer than 4.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: psi29a <1122069+psi29a@users.noreply.github.com>
Co-authored-by: psi29a <1122069+psi29a@users.noreply.github.com>
Replace wildcard imports with explicit imports in blessed image generator
Remove dead code in HumiditySimulation
Uh oh!
There was an error while loading. Please reload this page.