3737class Tileset (MutableMapping [int , "NDArray[np.uint8]" ]):
3838 """A collection of graphical tiles.
3939
40- .. versionchanged:: Unreleased
40+ .. versionchanged:: 20.1
4141 Is now a :class:`collections.abc.MutableMapping` type.
4242 """
4343
@@ -86,7 +86,7 @@ def __copy__(self) -> Self:
8686
8787 This is not an exact copy. :any:`remap` will not work on the clone.
8888
89- .. versionadded:: Unreleased
89+ .. versionadded:: 20.1
9090 """
9191 clone = self .__class__ (self .tile_width , self .tile_height )
9292 for codepoint , tile in self .items ():
@@ -109,7 +109,7 @@ def __iadd__(
109109 ) -> Self :
110110 """Add tiles to this tileset inplace, prefers replacing tiles.
111111
112- .. versionadded:: Unreleased
112+ .. versionadded:: 20.1
113113 """
114114 for codepoint , tile in self ._iter_items (other ):
115115 self [codepoint ] = tile
@@ -122,7 +122,7 @@ def __add__(
122122 ) -> Self :
123123 """Combine tiles with this tileset, prefers replacing tiles.
124124
125- .. versionadded:: Unreleased
125+ .. versionadded:: 20.1
126126 """
127127 clone = copy .copy (self )
128128 clone += other
@@ -135,7 +135,7 @@ def __ior__(
135135 ) -> Self :
136136 """Add tiles to this tileset inplace, keeps existing tiles instead of replacing them.
137137
138- .. versionadded:: Unreleased
138+ .. versionadded:: 20.1
139139 """
140140 for codepoint , tile in self ._iter_items (other ):
141141 if codepoint not in self :
@@ -149,7 +149,7 @@ def __or__(
149149 ) -> Self :
150150 """Combine tiles with this tileset, prefers keeping existing tiles instead of replacing them.
151151
152- .. versionadded:: Unreleased
152+ .. versionadded:: 20.1
153153 """
154154 clone = copy .copy (self )
155155 clone |= other
@@ -170,7 +170,7 @@ def __getitem__(self, codepoint: int, /) -> NDArray[np.uint8]:
170170 The tile will have a shape of (height, width, rgba) and a dtype of uint8.
171171 Note that most grey-scale tilesets will only use the alpha channel with a solid white color channel.
172172
173- .. versionadded:: Unreleased
173+ .. versionadded:: 20.1
174174 """
175175 if codepoint not in self :
176176 raise KeyError (codepoint )
@@ -227,7 +227,7 @@ def __setitem__(self, codepoint: int, tile: ArrayLike | NDArray[np.uint8], /) ->
227227 sprite_rgba = np.append(sprite_rgb, sprite_alpha, axis=2)
228228 tileset[0x100003] = sprite_rgba
229229
230- .. versionadded:: Unreleased
230+ .. versionadded:: 20.1
231231 """
232232 tile = np .ascontiguousarray (tile , dtype = np .uint8 )
233233 if tile .shape == self .tile_shape :
@@ -266,7 +266,7 @@ def __delitem__(self, codepoint: int, /) -> None:
266266
267267 Tilesets are optimized for set-and-forget, deleting a tile may not free up memory.
268268
269- .. versionadded:: Unreleased
269+ .. versionadded:: 20.1
270270 """
271271 if codepoint not in self :
272272 raise KeyError (codepoint )
@@ -275,14 +275,14 @@ def __delitem__(self, codepoint: int, /) -> None:
275275 def __len__ (self ) -> int :
276276 """Return the total count of codepoints assigned in this tileset.
277277
278- .. versionadded:: Unreleased
278+ .. versionadded:: 20.1
279279 """
280280 return int ((self ._get_character_map () > 0 ).sum ())
281281
282282 def __iter__ (self ) -> Iterator [int ]:
283283 """Iterate over the assigned codepoints of this tileset.
284284
285- .. versionadded:: Unreleased
285+ .. versionadded:: 20.1
286286 """
287287 # tolist makes a copy, otherwise the reference to character_map can dangle during iteration
288288 for i , v in enumerate (self ._get_character_map ().tolist ()):
@@ -307,7 +307,7 @@ def get_tile(self, codepoint: int) -> NDArray[np.uint8]:
307307 def set_tile (self , codepoint : int , tile : ArrayLike | NDArray [np .uint8 ]) -> None :
308308 """Upload a tile into this array.
309309
310- .. deprecated:: Unreleased
310+ .. deprecated:: 20.1
311311 Was replaced with :any:`Tileset.__setitem__`.
312312 Use ``tileset[codepoint] = tile`` syntax instead of this method.
313313 """
@@ -544,7 +544,7 @@ def procedural_block_elements(*, tileset: Tileset | None = None, shape: tuple[in
544544
545545 .. versionadded:: 13.1
546546
547- .. versionchanged:: Unreleased
547+ .. versionchanged:: 20.1
548548 Added `shape` parameter, now returns a `Tileset`.
549549 `tileset` parameter is deprecated.
550550
0 commit comments