Skip to content

Commit 69fd5fa

Browse files
committed
Fix tests for newer Numpy versions
New versions of Numpy return different types than before
1 parent 835ca64 commit 69fd5fa

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tcod/console.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ def rgba(self) -> NDArray[Any]:
313313
... (*WHITE, 255),
314314
... (*BLACK, 255),
315315
... )
316-
>>> con.rgba[0, 0]
317-
(88, [255, 255, 255, 255], [ 0, 0, 0, 255])
316+
>>> print(f"{con.rgba[0, 0]=}")
317+
con.rgba[0, 0]=...(88, [255, 255, 255, 255], [ 0, 0, 0, 255])...
318318
319319
.. versionadded:: 12.3
320320
"""
@@ -334,11 +334,11 @@ def rgb(self) -> NDArray[Any]:
334334
>>> con = tcod.console.Console(10, 2)
335335
>>> BLUE, YELLOW, BLACK = (0, 0, 255), (255, 255, 0), (0, 0, 0)
336336
>>> con.rgb[0, 0] = ord("@"), YELLOW, BLACK
337-
>>> con.rgb[0, 0]
338-
(64, [255, 255, 0], [0, 0, 0])
337+
>>> print(f"{con.rgb[0, 0]=}")
338+
con.rgb[0, 0]=...(64, [255, 255, 0], [0, 0, 0])...
339339
>>> con.rgb["bg"] = BLUE
340-
>>> con.rgb[0, 0]
341-
(64, [255, 255, 0], [ 0, 0, 255])
340+
>>> print(f"{con.rgb[0, 0]=}")
341+
con.rgb[0, 0]=...(64, [255, 255, 0], [ 0, 0, 255])...
342342
343343
.. versionadded:: 12.3
344344
"""

tcod/map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Map:
6161
[ True, True, True],
6262
[False, True, True],
6363
[False, False, True]]...)
64-
>>> m.fov[3,1]
64+
>>> m.fov.item(3, 1)
6565
False
6666
6767
.. deprecated:: 11.13

tcod/noise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def __getitem__(self, indexes: Any) -> NDArray[np.float32]:
236236
raise IndexError(
237237
"This noise generator has %i dimensions, but was indexed with %i." % (self.dimensions, len(indexes))
238238
)
239-
indexes = np.broadcast_arrays(*indexes)
239+
indexes = list(np.broadcast_arrays(*indexes))
240240
c_input = [ffi.NULL, ffi.NULL, ffi.NULL, ffi.NULL]
241241
for i, index in enumerate(indexes):
242242
if index.dtype.type == np.object_:

tcod/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ def traversal(self) -> NDArray[Any]:
11411141
>>> i, j = (3, 3) # Starting index.
11421142
>>> path = [(i, j)] # List of nodes from the start to the root.
11431143
>>> while not (pf.traversal[i, j] == (i, j)).all():
1144-
... i, j = pf.traversal[i, j]
1144+
... i, j = pf.traversal[i, j].tolist()
11451145
... path.append((i, j))
11461146
>>> path # Slower.
11471147
[(3, 3), (2, 2), (1, 1), (0, 0)]

0 commit comments

Comments
 (0)