v1.0.0
GridKit v1.0.0 Release Notes
This is the first major release of GridKit!
It contains several breaking changes. One of the most notable is the re-definition of the origin and cell size of the TriGrid.
If you are having trouble migrating, you might find inspiration by comparing the v0.14.1 examples to the v1.0.0 examples.
Features
- Introduced
DataTileclass to replaceBoundedGridfor representing rotated tiles. count(),sum(), andmean()now also apply to data tiles.TriGridorigin moved and size definition halved to better matchRectGridandHexGrid. See issue #94.- Added both flat and pointy versions of
TriGrid. - Fixed offset ordering for flat
HexGrids—now uses(x, y)instead of(y, x). - Added
set_zoom_to_boundsoption todoc_utils.plot_polygons()to allow disabling zooming to bounds. - Added
io.raster_to_data_tile()for reading raster files asDataTiles. io.write_raster()can now write bothBoundedRectGridandDataTile, as long as theDataTileis on aRectGrid.
Fixes
- Adjusted example
flower_of_life.pyto work with Shapely 2.1.0. - Properly raise an error if
BaseGrid.align_bounds()orBaseGrid.are_bounds_aligned()is called on a rotated grid (previously gave unreliable results).
Deprecations
- Dropped support for Python 3.9.
- Removed
filledkeyword argument fromgridkit.doc_utils.plot_polygons()in favor offill.
Future Deprecations
- All bounded grids (
BoundedTriGrid,BoundedRectGrid,BoundedHexGrid) will be deprecated in a future update.- Defining an area by its bounds becomes ambiguous when the grid is rotated.
DataTiles serve the same role, and support rotation via origin, width, and height.- Unlike the inheritance-based bounded grids,
DataTileuses composition, which might require an adjustment in approach. - To understand the difference, compare the Example Gallery from v1.0.0+ (using
DataTiles) with v0.14.1 or earlier (using bounded grids).
- The
as_multipolygonargument fromBaseGrid.to_shapely()will be removed.- It will always return a Shapely object; to get an iterable, use
.geoms. - Rationale:
to_shapely()already created a Shapely object, and.geomswas always accessed whenas_multipolygon=False. Making it explicit improves clarity.
- It will always return a Shapely object; to get an iterable, use
Documentation
- Documentation is now published for historical versions as well as the nightly “dev” version.
- A version selector drop-down is available in the bottom left of the docs.
- Updated the contributing guide to reflect documentation build changes.
- Replaced usage of bounded grids in examples with
DataTiles. - Added example
game_of_life.pydemonstrating Conway’s Game of Life. - Added example
hexagonal_automata.pyshowcasing cellular automata on a hexagonal grid.
Misc
- Moved
BaseGrid.anchorto Rust. - Removed
DeprecationWarningfor flatHexGrids, as they are still useful forDataTileand bounded grid contexts.