Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 189ed21

Browse files
committedDec 20, 2024·
DAS-2280: Fix typo and make random type explicit.
1 parent 78ee92c commit 189ed21

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Changelog](http://keepachangelog.com/en/1.0.0/).
1515
`NODATA_IDX` (255) in its stead. A color of (0,0,0,0) was previosly set to
1616
both the indexes (254 and 255) in the ouput PNGs and now only 255 will have
1717
this value. This change ensures the roundtrip from single band to RGBA to
18-
Paletted PNG is consistent.
18+
paletted PNG is consistent.
1919

2020
## [v2.1.0] - 2024-12-13
2121

‎tests/unit/test_browse.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def test_convert_5_multiband_to_raster(self):
654654
)
655655

656656
def test_standardize_raster_for_writing_jpeg_3band(self):
657-
raster = self.random.integers(255, size=(3, 5, 6))
657+
raster = self.random.integers(255, size=(3, 5, 6), dtype='uint8')
658658
count = 'irrelevant'
659659
driver = 'JPEG'
660660
expected_raster = np.copy(raster)
@@ -667,7 +667,7 @@ def test_standardize_raster_for_writing_jpeg_3band(self):
667667
np.testing.assert_array_equal(expected_raster, actual_raster, strict=True)
668668

669669
def test_standardize_raster_for_writing_jpeg_4band(self):
670-
raster = self.random.integers(255, size=(4, 7, 8))
670+
raster = self.random.integers(255, size=(4, 7, 8), dtype='uint8')
671671
driver = 'JPEG'
672672
count = 'irrelevant'
673673
expected_raster = np.copy(raster[0:3, :, :])
@@ -680,7 +680,7 @@ def test_standardize_raster_for_writing_jpeg_4band(self):
680680

681681
@patch('hybig.browse.palettize_raster')
682682
def test_standardize_raster_for_writing_png_4band(self, palettize_mock):
683-
raster = self.random.integers(255, size=(4, 7, 8))
683+
raster = self.random.integers(255, size=(4, 7, 8), dtype='uint8')
684684
driver = 'PNG'
685685
count = 'not 1'
686686

@@ -690,7 +690,7 @@ def test_standardize_raster_for_writing_png_4band(self, palettize_mock):
690690

691691
@patch('hybig.browse.palettize_raster')
692692
def test_standardize_raster_for_writing_png_3band(self, palettize_mock):
693-
raster = self.random.integers(255, size=(3, 7, 8))
693+
raster = self.random.integers(255, size=(3, 7, 8), dtype='uint8')
694694
driver = 'PNG'
695695
count = 'not 1'
696696

@@ -700,7 +700,7 @@ def test_standardize_raster_for_writing_png_3band(self, palettize_mock):
700700

701701
@patch('hybig.browse.palettize_raster')
702702
def test_prepare_1band_raster_for_writing_png(self, palettize_mock):
703-
raster = self.random.integers(255, size=(1, 7, 8))
703+
raster = self.random.integers(255, size=(1, 7, 8), dtype='uint8')
704704
driver = 'PNG'
705705
count = 1
706706
palettize_mock.return_value = (None, None)
@@ -711,7 +711,7 @@ def test_prepare_1band_raster_for_writing_png(self, palettize_mock):
711711
@patch('hybig.browse.get_color_map_from_image')
712712
def test_palettize_raster_no_alpha_layer(self, get_color_map_mock, image_mock):
713713
"""Test that the quantize function is called by a correct image."""
714-
raster = self.random.integers(255, dtype='uint8', size=(3, 10, 11))
714+
raster = self.random.integers(255, size=(3, 10, 11), dtype='uint8')
715715

716716
quantized_output = Image.fromarray(
717717
self.random.integers(254, size=(10, 11), dtype='uint8')
@@ -733,7 +733,7 @@ def test_palettize_raster_no_alpha_layer(self, get_color_map_mock, image_mock):
733733
@patch('hybig.browse.get_color_map_from_image')
734734
def test_palettize_raster_with_alpha_layer(self, get_color_map_mock, image_mock):
735735
"""Test that the quantize function is called by a correct image."""
736-
raster = self.random.integers(255, dtype='uint8', size=(4, 10, 11))
736+
raster = self.random.integers(255, size=(4, 10, 11), dtype='uint8')
737737
# No transparent pixels
738738
raster[3, :, :] = 255
739739

0 commit comments

Comments
 (0)
Please sign in to comment.