Skip to content

Commit ac269b6

Browse files
committed
Two bugs noticed...
setup.py: builtin/image.py directly imports wordcloud but that is not in setup.py Not sure why this wasn't seen before. Maybe some other package pulls it it in implicity? However if it is imported here, it should be mentioned in setup.py mathics/builtin/image.py: now that from_python distinguishs ints from bools image data needs to be converted to an "int" not a "bool". Otherwise, we get: 1867 ( 4): TEST ImageData[Image[{{0, 1}, {1, 0}, {1, 1}}], "Bit"] Test failed: ImageData in Reference of Built-in Symbols / Image[] and image related functions. ImageData[Image[{{0, 1}, {1, 0}, {1, 1}}], "Bit"] Result: {{False, True}, {True, False}, {True, True}} Wanted: {{0, 1}, {1, 0}, {1, 1}}
1 parent f3682e5 commit ac269b6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

mathics/builtin/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ def apply(self, image, stype, evaluation):
18231823
elif stype == "Bit16":
18241824
pixels = pixels_as_uint(pixels)
18251825
elif stype == "Bit":
1826-
pixels = pixels.astype(numpy.bool)
1826+
pixels = pixels.astype(numpy.int)
18271827
else:
18281828
return evaluation.message("ImageData", "pixelfmt", stype)
18291829
return from_python(numpy_to_matrix(pixels))

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def read(*rnames):
9292
"python-dateutil",
9393
"llvmlite",
9494
"requests",
95+
"wordcloud", # Used in builtin/image.py by WordCloud()
9596
]
9697

9798

0 commit comments

Comments
 (0)