Skip to content

Commit d2ef496

Browse files
committed
minor fixes
1 parent 80dfa51 commit d2ef496

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/main/scala/ai/quantnet/bz/DataFrame.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ class DataFrame[R, C, @specialized(Double, Int, Float, Long) V]
160160
: DataFrame[R, C, V] = iloc(colIdx.locRange(start, end, step, keepStart, keepEnd, round).slices)
161161

162162

163-
def iget(ri: Int): Series[R, V] = {
163+
def iget(ci: Int): Series[R, V] = {
164164
var d = data match {
165-
case d: DenseMatrix[V] => d.apply(ri, ::)
166-
case d: SliceMatrix[Int, Int, V] => d.apply(ri, ::)
165+
case d: DenseMatrix[V] => d.apply(::, ci)
166+
case d: SliceMatrix[Int, Int, V] => d.apply(::, ci)
167167
case _ => ???
168168
}
169-
Series(rowIdx, d.t)
169+
Series(rowIdx, d)
170170
}
171171

172172
def get(c: C): Series[R, V] = {

src/main/scala/ai/quantnet/netcdf.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object netcdf {
125125
val assetArray = assetRawArray.map(i => new String(i.filter(c => c != '\u0000')))
126126

127127
// C-order of dimensions: time,asset
128-
val varName = vars.keys.filter(_!="time").filter(_!="field")/*.filter(_!="asset")*/.toArray.apply(0)
128+
val varName = vars.keys.filter(vars(_).getDataType == DataType.DOUBLE).toArray.apply(0)
129129
val values = dataNetcdf.readSection(varName).copyTo1DJavaArray().asInstanceOf[Array[Double]]
130130

131131
val timeIdx = DataIndexVector[LocalDate](timeArray)
@@ -164,7 +164,7 @@ object netcdf {
164164
val assetArray = assetRawArray.map(i => intern(new String(i.filter(c => c != '\u0000'))))
165165

166166
// C-order of dimensions: field,time,asset
167-
val varName = vars.keys.filter(_!="time").filter(_!="field").filter(_!="asset").toArray.apply(0)
167+
val varName = vars.keys.filter(vars(_).getDataType == DataType.DOUBLE).filter(_!="time").toArray.apply(0)
168168
val values = dataNetcdf.readSection(varName).copyTo1DJavaArray().asInstanceOf[Array[Double]]
169169

170170
val timeIdx = DataIndexVector.apply[LocalDate](timeArray)

src/test/scala/ai/quantnet/StatTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class StatTest extends FunSuite {
3030

3131
val s = stats.calcStats(dataSet, output)
3232

33+
val srr = s.colOps.get(stats.fields.relativeReturn)
34+
3335
println(s.toString(headRows = 20))
3436

3537
//println(stats.calcCorrelation(rr))

0 commit comments

Comments
 (0)