-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StreamingHistogram reports incorrect bin counts #2664
Labels
Comments
Hey @metasim can you provide more detailed information on how to reproduce it? I implemented this unit test (see numbers in comments): import geotrellis.spark._
import geotrellis.spark.testkit._
import geotrellis.raster._
import geotrellis.raster.histogram._
import org.scalatest._
class HistogramSpec extends FunSpec
with Matchers
with TestEnvironment {
describe("HistogramSpec") {
it("should count bins number correct") {
val tileSize = 5
def rndTile = {
val data = Array.fill(tileSize * tileSize)(scala.util.Random.nextGaussian())
ArrayTile(data, tileSize, tileSize): Tile
}
val rdd = sc.makeRDD(Seq((1, rndTile), (2, rndTile), (3, rndTile)))
val h = rdd.histogram()
println(h.totalCount()) // 75
println(h.binCounts().map(_._2).sum) // 75
println(h.asInstanceOf[StreamingHistogram].buckets().map(_._2).sum) // 75
}
}
} |
That's really odd. For |
Looks to me like this issue is resolved on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unless I'm misunderstanding the purpose of
binCounts
, it appears to be working incorrectly.Test code:
The text was updated successfully, but these errors were encountered: