Skip to content

Commit db0e286

Browse files
authored
Merge pull request #79 from tmillenaar/release_0.10.0
Add release notes for 0.10.0
2 parents e126b51 + bd344a4 commit db0e286

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

docs/source/release_notes.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
Release notes
44
================
55

6+
7+
Version 0.10.0 (April 21, 2024)
8+
------------------------------
9+
Features
10+
- Add :meth:`.GridIndex.sort`
11+
- Allow plotting of RGB(A) values in :func:`.doc_utils.plot_polygons`
12+
- Improve performance of :func:`.doc_utils.plot_polygons`
13+
- Improve performance of initializing a new :class:`.GridIndex` if the supplied indices are already in an appropriate numpy integer ndarray.
14+
15+
Fixes
16+
- Fix incorrect :meth:`.HexGrid.relative_neighbours` and by extension :meth:`.BaseGrid.neighbours` for :class:`.HexGrid` when supplying multiple grid indices at a time
17+
18+
Documentation
19+
- Add example :ref:`2d_diff_hex_anim.py <example diffusion>`
20+
621
Version 0.9.2 (April 03, 2024)
722
------------------------------
823
Features

gridkit/index.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,29 @@ def unique(self, **kwargs):
222222
return GridIndex.from_index_1d(unique)
223223

224224
def sort(self):
225+
"""Sort the grid indices. Multidimentional indices are not supported.
226+
Ravels the indices if indices are multidimentional.
227+
228+
The indices are sorted first by x, then by y.
229+
230+
Returns
231+
-------
232+
:class:`.GridIndex`
233+
The sorted ids
234+
235+
Examples
236+
--------
237+
238+
>>> from gridkit.index import GridIndex
239+
>>> unsorted_ids = GridIndex([[1,1],[0,1],[1,0],[0,0]])
240+
>>> sorted_ids = unsorted_ids.sort()
241+
>>> sorted_ids.index
242+
array([[0, 0],
243+
[0, 1],
244+
[1, 0],
245+
[1, 1]], dtype=int32)
246+
247+
"""
225248
return GridIndex.from_index_1d(numpy.sort(self.index_1d))
226249

227250
def intersection(self, other):

0 commit comments

Comments
 (0)