-
Notifications
You must be signed in to change notification settings - Fork 393
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
Part 1 of 2 - Making concrete math transformers #255
Conversation
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.
lgtm, see some comments.
uid: String = UID[ScalarAddTransformer[_, _]] | ||
)( | ||
implicit override val tti: TypeTag[I], | ||
n: Numeric[N] |
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.
val n: Numeric[N]
(here and in other transformers)
)( | ||
implicit override val tti1: TypeTag[I1], | ||
override val tti2: TypeTag[I2] | ||
) extends BinaryTransformer[I1, I2, Real](operationName = "addition", uid = uid){ |
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.
the operation name was "plus"
is there a reason to change it (same with other transformers). I would rather keep it the same as before.
@@ -134,15 +134,55 @@ class RichNumericFeatureTest extends FlatSpec with FeatureTestBase with RichNume | |||
// TODO: add vectorize() test | |||
} | |||
|
|||
Spec[RichRealNNFeature] should "have tests" in { | |||
// TODO: add tests | |||
Spec[RichRealNNFeature] should "perform math functions correctly" in { |
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 the tests!
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.
Is there an easy way to use our OpTransformerSpec
here, or would we have to make a separate test class for each transformer we're trying to test?
n: Numeric[N] | ||
) extends UnaryTransformer[I, Real](operationName = "scalarDivide", uid = uid){ | ||
override def transformFn: I => Real = (i: I) => i.toDouble.map(_ / n.toDouble(scalar)).filter(Number.isValid).toReal | ||
} |
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.
you might need an endline here
@leahmcguire can you also please add a test for each of the transformers using the transformer test spec? |
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
=========================================
Coverage ? 80.94%
=========================================
Files ? 315
Lines ? 10282
Branches ? 556
=========================================
Hits ? 8323
Misses ? 1959
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
==========================================
+ Coverage 86.57% 86.58% +<.01%
==========================================
Files 314 315 +1
Lines 10302 10286 -16
Branches 335 560 +225
==========================================
- Hits 8919 8906 -13
+ Misses 1383 1380 -3
Continue to review full report at Codecov.
|
Related issues
Want to use concrete math transformer classes so they are easier to generate outside of the shortcuts
Describe the proposed solution
Move from lamda definitions of transformers to defined classes
Additional context
Next PR will add more math transformers