@@ -723,6 +723,7 @@ def test_num_bins(self):
723723 hist3 = hg .SparselyBin (origin = 0.0 , binWidth = 1.0 , quantity = unit ('A' ))
724724 hist4 = hg .Bin (num = 20 , low = 0.0 , high = 20. , quantity = unit ('A' ))
725725 hist5 = hg .Bin (num = 20 , low = 0.0 , high = 20. , quantity = unit ('A' ))
726+ hist6 = hg .Bin (num = 201 , low = 0.0 , high = 1.005 )
726727
727728 # fill them
728729 hist2 .fill .numpy (df1 )
@@ -734,16 +735,19 @@ def test_num_bins(self):
734735 assert hist3 .num_bins () == 18
735736 assert hist4 .num_bins () == 20
736737 assert hist5 .num_bins () == 20
738+ assert hist6 .num_bins () == 201
737739
738740 assert hist2 .num_bins (low = 10 , high = 25 ) == 15
739741 assert hist3 .num_bins (low = 10 , high = 25 ) == 15
740742 assert hist4 .num_bins (low = 10 , high = 25 ) == 10
741743 assert hist5 .num_bins (low = 10 , high = 25 ) == 10
744+ assert hist6 .num_bins (low = 0.2089 , high = 0.9333 ) == 146
742745
743746 assert hist2 .num_bins (low = - 10 , high = 28 ) == 38
744747 assert hist3 .num_bins (low = - 10 , high = 28 ) == 38
745748 assert hist4 .num_bins (low = - 10 , high = 28 ) == 20
746749 assert hist5 .num_bins (low = - 10 , high = 28 ) == 20
750+ assert hist6 .num_bins (low = 0.205 , high = 0.935 ) == 146
747751
748752 def test_most_probable_value (self ):
749753 """ Test getting most probable value or label from histogram
@@ -917,6 +921,7 @@ def test_bin_edges(self):
917921 hist3 = hg .SparselyBin (origin = 0.0 , binWidth = 1.0 , quantity = unit ('A' ))
918922 hist4 = hg .Bin (num = 10 , low = 0.0 , high = 10. , quantity = unit ('A' ))
919923 hist5 = hg .Bin (num = 10 , low = 0.0 , high = 10. , quantity = unit ('A' ))
924+ hist6 = hg .Bin (num = 201 , low = 0.0 , high = 1.005 )
920925
921926 # fill them
922927 hist2 .fill .numpy (df1 )
@@ -937,6 +942,10 @@ def test_bin_edges(self):
937942 2. , 3. , 4. , 5. , 6. , 7. , 8. , 9. , 10. ])
938943 np .testing .assert_array_equal (hist5 .bin_edges (low = 1.1 , high = 5.4 ), [1. , 2. , 3. , 4. , 5. , 6. ])
939944
945+ assert len (hist6 .bin_edges ()) == 202
946+ assert len (hist6 .bin_edges (low = 0.2089 , high = 0.9333 )) == 147
947+ assert len (hist6 .bin_edges (low = 0.205 , high = 0.935 )) == 147
948+
940949 def test_bin_width (self ):
941950 """ Test getting the bin width of bin and sparselybin histograms
942951 """
0 commit comments