Skip to content

Commit 21d31db

Browse files
jose.cambronerosryza
authored andcommitted
space added after maps and renamed uniform index variable for clarity
1 parent 0b3a756 commit 21d31db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/scala/com/cloudera/sparkts/TimeSeriesRDD.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
295295
}
296296
// each record contains a value per time series, in original order
297297
// and records are ordered by time
298-
val unifIndex = index.asInstanceOf[UniformDateTimeIndex]
299-
val instants = this.toInstants(nPartitions)
300-
val start = unifIndex.first()
301-
val rows = instants.map{ x =>
302-
val rowIndex = unifIndex.frequency.difference(start, x._1)
298+
val uniformIndex = index.asInstanceOf[UniformDateTimeIndex]
299+
val instants = toInstants(nPartitions)
300+
val start = uniformIndex.first()
301+
val rows = instants.map { x =>
302+
val rowIndex = uniformIndex.frequency.difference(start, x._1)
303303
val rowData = Vectors.dense(x._2.toArray)
304304
IndexedRow(rowIndex, rowData)
305305
}
@@ -316,8 +316,8 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
316316
* @return an equivalent RowMatrix
317317
*/
318318
def toRowMatrix(nPartitions: Int = -1): RowMatrix = {
319-
val instants = this.toInstants(nPartitions)
320-
val rows = instants.map{ x => Vectors.dense(x._2.toArray) }
319+
val instants = toInstants(nPartitions)
320+
val rows = instants.map { x => Vectors.dense(x._2.toArray) }
321321
new RowMatrix(rows)
322322
}
323323

0 commit comments

Comments
 (0)