Skip to content

Commit

Permalink
v1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerbrandl committed Oct 15, 2024
1 parent 14bb0a1 commit fdb5f87
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 147 deletions.
136 changes: 0 additions & 136 deletions build.gradle

This file was deleted.

92 changes: 92 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
plugins {
kotlin("jvm") version "2.0.21"
`maven-publish`
signing

id("io.github.gradle-nexus.publish-plugin") version "1.2.0"
id("org.jetbrains.kotlin.jupyter.api") version "0.12.0-285"
}



group = "com.github.holgerbrandl"
version = "1.0"


repositories {
mavenCentral()
mavenLocal()
}

dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-reflect:2.0.21")

api("org.jetbrains.kotlinx:dataframe-core:0.14.1")
api("com.github.holgerbrandl:kdfutils:1.4.0")
api("org.apache.commons:commons-math3:3.6.1")

implementation("org.rosuda.REngine:REngine:2.1.0")
implementation("org.rosuda.REngine:Rserve:1.8.1")

testImplementation("junit:junit:4.13.1")
testImplementation("io.kotest:kotest-assertions-core:5.0.3")
testImplementation("org.jetbrains.kotlin:kotlin-script-runtime:2.0.21")
}

tasks.processJupyterApiResources {
libraryProducers = listOf("kravis.device.jupyter.JupyterIntegration")
}

tasks.javadoc {
exclude("**/PlotResultPanel.java")
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("kravis")
description.set("kravis is a Kotlin wrapper around ggplot2 to enable data visualization on the JVM")
url.set("https://github.com/holgerbrandl/kravis")
licenses {
license {
name.set("BSD-2")
url.set("https://github.com/holgerbrandl/kravis/blob/master/LICENSE.txt")
}
}
developers {
developer {
id.set("holgerbrandl")
name.set("Holger Brandl")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:github.com/holgerbrandl/kravis.git")
developerConnection.set("scm:git:ssh://github.com/holgerbrandl/kravis.git")
url.set("https://github.com/holgerbrandl/kravis.git")
}
}
}
}
}

nexusPublishing {
repositories {
sonatype {
snapshotRepositoryUrl.set(uri(project.findProperty("sonatypeStagingProfileId") ?: "not_defined"))
username.set(project.findProperty("ossrhUsername")?.toString() ?: "not_defined")
password.set(project.findProperty("ossrhPassword")?.toString() ?: "not_defined")
}
}
}

signing {
sign(publishing.publications["mavenJava"])
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions modules/kravis-javafx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ version = "0.5-SNAPSHOT"

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rootProject.name = 'kravis'
rootProject.name = "kravis"

include(":modules:kravis-javafx")
7 changes: 3 additions & 4 deletions src/main/kotlin/kravis/IteratorApi.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package kravis

import com.github.holgerbrandl.kdfutils.toKotlinDF
import krangl.deparseRecords
import kravis.util.deparseRecords
import org.jetbrains.kotlinx.dataframe.datasets.sleepData
import org.jetbrains.kotlinx.dataframe.datasets.sleepPatterns
import skipNull
Expand Down Expand Up @@ -33,7 +32,7 @@ inline fun <reified T> Iterable<T>.plot(vararg aes2data: Pair<Aesthetic, PropExt
val df = this.deparseRecords(*rulez.toList().toTypedArray())


return GGPlot(data = df.toKotlinDF(), mapping = Aes(*aes.toTypedArray()))
return GGPlot(data = df, mapping = Aes(*aes.toTypedArray()))
}

/**
Expand Down Expand Up @@ -132,7 +131,7 @@ inline fun <reified T> Iterable<T>.plot(
name to deparseFormula
}

val deparsedReceiver = deparseRecords(*deparseFormulae.toTypedArray()).toKotlinDF()
val deparsedReceiver = deparseRecords(*deparseFormulae.toTypedArray())


// build new mapping
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/kravis/ggplot/AbstractSvgPlotRegression.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ abstract class AbstractSvgPlotRegression {
fun setup() {
// SessionPrefs.RENDER_BACKEND = RserveEngine()
// SessionPrefs.RENDER_BACKEND = Docker("holgerbrandl/kravis_core:3.5.1")
// SessionPrefs.RENDER_BACKEND = LocalR()
SessionPrefs.RENDER_BACKEND = Docker("kravis_test")
SessionPrefs.RENDER_BACKEND = LocalR()
// SessionPrefs.RENDER_BACKEND = Docker("kravis_test")
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/kravis/ggplot/CoreRegressions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import kravis.demo.IrisData.SepalWidth
import kravis.nshelper.plot
import kravis.plot
import org.jetbrains.kotlinx.dataframe.api.add
import org.jetbrains.kotlinx.dataframe.api.aggregate
import org.jetbrains.kotlinx.dataframe.api.groupBy
import org.jetbrains.kotlinx.dataframe.api.mean
import org.jetbrains.kotlinx.dataframe.datasets.irisData
Expand Down
1 change: 0 additions & 1 deletion src/test/kotlin/kravis/ggplot/GeomRegressions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.junit.Test
import java.io.File


@Suppress("UNUSED_EXPRESSION")
/**
* @author Holger Brandl
*/
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/kravis/samples/ExtractorPlots.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package kravis.samples

import krangl.SleepPattern
import kravis.plot
import org.jetbrains.kotlinx.dataframe.api.head
import org.jetbrains.kotlinx.dataframe.api.print
import org.jetbrains.kotlinx.dataframe.api.toDataFrame
import org.jetbrains.kotlinx.dataframe.api.toListOf
import org.jetbrains.kotlinx.dataframe.datasets.SleepPattern
import org.jetbrains.kotlinx.dataframe.datasets.sleepData

internal object ExtractorPlots {
Expand Down
4 changes: 3 additions & 1 deletion src/test/kotlin/kravis/samples/SleepPatternsExample.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package kravis.samples

import kravis.GGPlot
import kravis.SessionPrefs
import kravis.geomPoint
import kravis.plot
import kravis.render.LocalR
import org.jetbrains.kotlinx.dataframe.datasets.SleepPattern
import org.jetbrains.kotlinx.dataframe.datasets.sleepPatterns
import kotlin.reflect.KProperty0
Expand All @@ -11,7 +13,7 @@ internal object SleepPatternsExample {

@JvmStatic
fun main(args: Array<String>) {

SessionPrefs.RENDER_BACKEND = LocalR()

// extractor lambda
sleepPatterns.plot(
Expand Down

0 comments on commit fdb5f87

Please sign in to comment.