Skip to content

v1.0.0

Choose a tag to compare

@tmillenaar tmillenaar released this 29 Jun 16:29
· 18 commits to main since this release
751d3eb

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 DataTile class to replace BoundedGrid for representing rotated tiles.
  • count(), sum(), and mean() now also apply to data tiles.
  • TriGrid origin moved and size definition halved to better match RectGrid and HexGrid. 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_bounds option to doc_utils.plot_polygons() to allow disabling zooming to bounds.
  • Added io.raster_to_data_tile() for reading raster files as DataTiles.
  • io.write_raster() can now write both BoundedRectGrid and DataTile, as long as the DataTile is on a RectGrid.

Fixes

  • Adjusted example flower_of_life.py to work with Shapely 2.1.0.
  • Properly raise an error if BaseGrid.align_bounds() or BaseGrid.are_bounds_aligned() is called on a rotated grid (previously gave unreliable results).

Deprecations

  • Dropped support for Python 3.9.
  • Removed filled keyword argument from gridkit.doc_utils.plot_polygons() in favor of fill.

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, DataTile uses 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_multipolygon argument from BaseGrid.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 .geoms was always accessed when as_multipolygon=False. Making it explicit improves clarity.

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.py demonstrating Conway’s Game of Life.
  • Added example hexagonal_automata.py showcasing cellular automata on a hexagonal grid.

Misc

  • Moved BaseGrid.anchor to Rust.
  • Removed DeprecationWarning for flat HexGrids, as they are still useful for DataTile and bounded grid contexts.