stripe / rainier

Bayesian inference in Scala.
https://rainier.fit
Apache License 2.0
433 stars 51 forks source link

More Cats instances #376

Closed sritchie closed 5 years ago

sritchie commented 5 years ago

This is a draft PR that adds instances for:

Just experimenting with how much we can do here.

I'm running into this on RealGroup's tests:

[info] - Real.group.collect0 *** FAILED ***
[info]   ArithmeticException was thrown during property evaluation.
[info]     Message: Division undefined
[info]     Occurred when passed generated values (
[info]       arg0 = Constant(-1.1327590390904958E-124)
[info]     )
[info] - Real.group.combine all *** FAILED ***
[info]   ArithmeticException was thrown during property evaluation.
[info]     Message: Division undefined
[info]     Occurred when passed generated values (
[info]       arg0 = Vector()
[info]     )
codecov-io commented 5 years ago

Codecov Report

Merging #376 into develop will increase coverage by 0.18%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #376      +/-   ##
===========================================
+ Coverage    46.56%   46.75%   +0.18%     
===========================================
  Files           87       87              
  Lines         3118     3125       +7     
  Branches       136      138       +2     
===========================================
+ Hits          1452     1461       +9     
+ Misses        1666     1664       -2
Impacted Files Coverage Δ
.../scala/com/stripe/rainier/scalacheck/package.scala 83.33% <ø> (+4.16%) :arrow_up:
...e/src/main/scala/com/stripe/rainier/core/RVG.scala 0% <ø> (ø) :arrow_up:
...rc/main/scala/com/stripe/rainier/core/Events.scala 0% <ø> (ø) :arrow_up:
...c/main/scala/com/stripe/rainier/cats/package.scala 96.36% <100%> (+2.61%) :arrow_up:
...ain/scala/com/stripe/rainier/compute/RealOps.scala 77.96% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ef22f0d...b52a33d. Read the comment docs.

sritchie commented 5 years ago

Okay @avi-stripe, this should be my last one for a bit! I played around with adding a monad transformer for Generator, but I don't think it helps anything I'm doing. It's too fun to play around with this stuff.

avi-stripe commented 5 years ago

Awesome. Thank you!