Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Dec 12, 2024
1 parent 4d47374 commit 188a05e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
10 changes: 9 additions & 1 deletion build.mill
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mill.scalalib.publish.Scope.Test

import $ivy.`com.github.lolgab::mill-crossplatform::0.2.4`
import $ivy.`io.github.quafadas:millSite_mill0.12_2.13:0.0.36`
import $ivy.`io.github.quafadas:millSite_mill0.12_2.13:0.0.37-DIRTYafea46f4`
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`com.lihaoyi::mill-contrib-jmh:`
import $ivy.`com.goyeau::mill-scalafix::0.4.2`
Expand Down Expand Up @@ -178,6 +178,12 @@ object jsSite extends SiteJSModule {
override def moduleDeps = Seq(vecxt.js, vecxtensions.js)
override def scalaVersion = vecxt.js.scalaVersion
override def scalaJSVersion = vecxt.js.scalaJSVersion

override def scalaJsCompilerVersion: String = "3.6.2"


// override def allScalacOptions: T[Seq[String]] = super.allScalacOptions`() ++ Seq("-experimental", "-language:experimental.namedTuples")
override def scalacOptions: T[Seq[String]] = super.scalacOptions() ++ Seq("-experimental", "-language:experimental.namedTuples")
override def moduleKind = ModuleKind.ESModule
override def ivyDeps = super.ivyDeps() ++ Agg(
ivy"org.scala-js::scalajs-dom::2.8.0",
Expand Down Expand Up @@ -206,4 +212,6 @@ object site extends SiteModule {
override def moduleDeps = Seq(vecxt.jvm)
override def scalaDocOptions = super.scalaDocOptions

override def scalacOptions: T[Seq[String]] = super.scalacOptions() ++ Seq("-experimental", "-language:experimental.namedTuples")

}
2 changes: 2 additions & 0 deletions jsSite/src/BenchmarkPlots.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import scala.NamedTuple.AnyNamedTuple
import scala.annotation.meta.field
import upickle.default.*
import NamedTupleReadWriter.given
import scala.annotation.experimental

@experimental()
object BenchmarkPlots:
def addScalarBenchmark: String =
val thePlot = BenchmarkPlotElements.schema ++
Expand Down
4 changes: 2 additions & 2 deletions jsSite/src/PlotElements.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package vecxt.plot

import scala.NamedTuple.*
// import scala.NamedTuple.*
import scala.annotation.meta.field
import upickle.default.*
import NamedTupleReadWriter.given
import scala.collection.immutable.Stream.Empty

object BenchmarkPlotElements:
final val schema = (`$schema` = "https://vega.github.io/schema/vega-lite/v5.json")
final val schema: ($schema: String) = (`$schema` = "https://vega.github.io/schema/vega-lite/v5.json")

val fakeData = (
data = (
Expand Down
2 changes: 2 additions & 0 deletions jsSite/src/facade.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import org.scalajs.dom.Element
import scala.util.Random
import org.scalajs.dom.Element
import org.scalajs.dom.XMLHttpRequest
import scala.annotation.experimental

@experimental()
object showJsDocs:
def apply(path: String, node: Element, width: Int = 50) =
val child = dom.document.createElement("div")
Expand Down
1 change: 1 addition & 0 deletions site/docs/_docs/benchmarks/sum.mdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ And the function left in vexct over time (against regressions)
```scala mdoc:js sc:nocompile
import vecxt.plot.*
import vecxt.facades.*

showJsDocs.fromSpec(BenchmarkPlots.sumBenchmarkOverTime, node)
```

Expand Down
4 changes: 2 additions & 2 deletions site/docs/_docs/examples.mdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ cosineSimilarity(v1, v2)
(v1(v1 <= 2)).printArr

```
And Ints
And Ints. Note that the API here is more limited at the moment.

```scala mdoc
```scala mdoc:reset
import vecxt.all.*
import narr.*
import vecxt.BoundsCheck.DoBoundsCheck.yes
Expand Down
10 changes: 0 additions & 10 deletions vecxt/js/src/array.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ object arrays:
end for
result
end ||

// def copy: Array[Boolean] =
// val copyOfThisVector: Array[Boolean] = new Array[Boolean](vec.length)
// var i = 0
// while i < vec.length do
// copyOfThisVector(i) = vec(i)
// i = i + 1
// end while
// copyOfThisVector
// end copy
end extension

extension (vec: NArray[Double])
Expand Down
1 change: 1 addition & 0 deletions vecxt/jvm/src/arrays.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ object arrays:
end extension

extension (vec: Array[Int])

inline def =:=(num: Int): Array[Boolean] =
logicalIdx(VectorOperators.EQ, num)

Expand Down

0 comments on commit 188a05e

Please sign in to comment.