-
Notifications
You must be signed in to change notification settings - Fork 346
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
Mio/issue 583 #629
base: develop
Are you sure you want to change the base?
Mio/issue 583 #629
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #629 +/- ##
===========================================
- Coverage 82.07% 81.95% -0.13%
===========================================
Files 110 111 +1
Lines 5155 5175 +20
Branches 457 470 +13
===========================================
+ Hits 4231 4241 +10
- Misses 924 934 +10
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! very helpful.
A few minor comments.
case v: AdaptiveVector[_] => v.denseCount | ||
case _ => 0 | ||
} | ||
denseCount(sem.plus(a,a)) == denseCount(a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to capture sem
. Semgroup.plus(a, a)
would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
property("AdaptiveVector[Int] has a monoid") { | ||
// TODO: remove this equiv instance once #583 is resolved. | ||
implicit val equiv = AdaptiveVector.denseEquiv[Int] | ||
property("AdaptiveVector[Int] has a monoid when sparseValue IS monoid.zero") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is up with the IS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change these, I got into doing that as a note-to-self.
build.sbt
Outdated
algebirdBenchmark, | ||
algebirdSpark | ||
algebirdBenchmark//, | ||
//algebirdSpark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not comment out algebirdSpark. It is a pain that 2.12.x
won't build, but CI knows about it. Can build with sbt ++2.11.8 compile
on the command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change, didn't mean to commit this. Cool, I'll build that way.
…sevalue is monoid zero
So, what I discovered is that this is a bit confusing because the algebra of sparse values is entwined with the algebra of values you care about. The clean solution to this would be to make this
|
@mio-stripe is this ready to merge? Seems like it might be? No longer WIP? |
this looks good, but now I'm worried that the plus is so expensive we are killing any optimizations that this class intends to represent. Maybe we should write a benchmark in the algebird-benchmarks and compare |
@johnynek ready to merge! Can we add the benchmark after or should we do it before merging this? |
I needed to publish a version. I don't want to publish this without a benchmark, so I'm going to keep this open until we have the benchmark. I can find time to pair with you if you want sometime soon. |
|
Fixing issue 583 that
AdaptiveVector
monoid fails monoid laws when thesparseValue
ismonoid.zero
.