簡體   English   中英

Scala鞍座:ScalarTag沒有類別定義

[英]Scala Saddle: No class def for ScalarTag

我嘗試基於鞍的Series類創建一個TimeSeries類。 我在測試中收到以下錯誤:

java.lang.NoClassDefFoundError: org/saddle/scalar/ScalarTag

我的TimeSeries類:

object TimeSeries {

  def apply[V: ST](values: (LocalDate, V)*): TimeSeries[V] = {
    new TimeSeries(Series(values: _*))
  }
}

class TimeSeries[V: ST](values: Series[LocalDate, V]) { ... }

我的測試:

class TimeSeriesTest extends WordSpec with GivenWhenThen with ShouldMatchersForJUnit {
  "TimeSeries" when {

  val d2014_02_01 = new LocalDate(2014, 2, 1);
  val d2014_02_03 = new LocalDate(2014, 2, 3);
  val d2014_02_04 = new LocalDate(2014, 2, 4);

  "created with data points as arguments" should {
    "have the earliest point as start, the latest as the end, and a length" in {                   
      val a = TimeSeries(d2014_02_01 -> 0.6, d2014_02_03 -> 4.5, d2014_02_04 -> 0.9)

      ...
    }
  }
}

我的猜測是,它與TimeSeries類中綁定的上下文有關。 我是那個話題的新手。 有什么建議么?

添加LocalDate后,您的代碼可以正常工作(沒有錯誤)。 嘗試使用此build.sbt:

scalaVersion := "2.10.3"

resolvers ++= Seq(
    "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
      "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"
    )

libraryDependencies ++= Seq(
  "org.scalatest" % "scalatest_2.10" % "2.0" % "test",
  "org.scala-saddle" %% "saddle-core" % "1.3.+",
  "joda-time" % "joda-time" % "2.3",
  "org.joda" % "joda-convert" % "1.2",
  "com.novocode" % "junit-interface" % "0.9" % "test"
  // (OPTIONAL) "org.scala-saddle" %% "saddle-hdf5" % "1.3.+"
  )

https://github.com/goozez/saddle-skeleton

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM