Skip to content
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

Some suggested changes to style #88

Merged
merged 1 commit into from
Dec 6, 2016
Merged

Some suggested changes to style #88

merged 1 commit into from
Dec 6, 2016

Conversation

srowen
Copy link
Collaborator

@srowen srowen commented Dec 1, 2016

No description provided.

@@ -155,7 +155,7 @@ class LSAQueryEngine(
val newMat = new BDenseMatrix[Double](mat.rows, mat.cols)
for (r <- 0 until mat.rows) {
val length = math.sqrt((0 until mat.cols).map(c => mat(r, c) * mat(r, c)).sum)
(0 until mat.cols).map(c => newMat.update(r, c, mat(r, c) / length))
(0 until mat.cols).foreach(c => newMat.update(r, c, mat(r, c) / length))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @sryza -- think this might happen to work but should be foreach. Giving a heads up in case it needs to be reflected in text too.

@@ -50,7 +50,7 @@ object RunGeoTime extends Serializable {
}
val hoursUDF = udf(hours)

taxiGood.groupBy(hoursUDF('pickupTime, 'dropoffTime)).count().show()
taxiGood.groupBy(hoursUDF($"pickupTime", $"dropoffTime")).count().show()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwills Spark SQL has (at least) 3 ways to refer to columns. I had used $"..." syntax elsewhere instead of '.... I think it's the same. Is it OK to use $? CCing you in case it needs a text change to go along with it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally fine, and thanks for the heads up!

@@ -106,6 +104,6 @@ object KernelDensity {
x: Double): Double = {
val x0 = x - mean
val x1 = x0 / standardDeviation
FastMath.exp(-0.5 * x1 * x1 - logStandardDeviationPlusHalfLog2Pi)
math.exp(-0.5 * x1 * x1 - logStandardDeviationPlusHalfLog2Pi)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(DIdn't seem like a good reason to use FastMath in just a few places here FWIW)

@sryza
Copy link
Owner

sryza commented Dec 5, 2016

@srowen these seem reasonable to me. Feel free to merge.

@srowen srowen merged commit a525617 into master Dec 6, 2016
@srowen srowen deleted the MaybeStyle branch December 6, 2016 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants