Skip to content

Commit

Permalink
Merge branch 'master' into to_dataframe_imrovements
Browse files Browse the repository at this point in the history
# Conflicts:
#	plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/api/toDataFrame.kt
#	plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/utils/Names.kt
  • Loading branch information
AndreiKingsley committed Mar 5, 2025
2 parents de710b0 + e760eea commit 3223e9c
Show file tree
Hide file tree
Showing 127 changed files with 3,069 additions and 13,873 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ kotlin.jvmToolchain(11)
allprojects {
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
jvmTarget = JvmTarget.JVM_11
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}

// Attempts to configure ktlint for each sub-project that uses the plugin
Expand Down
6,385 changes: 843 additions & 5,542 deletions core/api/core.api

Large diffs are not rendered by default.

41 changes: 35 additions & 6 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.google.devtools.ksp.gradle.KspTask
import com.google.devtools.ksp.gradle.KspTaskJvm
import io.github.devcrocod.korro.KorroTask
import nl.jolanrensen.kodex.gradle.creatingRunKodexTask
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import xyz.ronella.gradle.plugin.simple.git.task.GitTask

Expand All @@ -19,6 +21,7 @@ plugins {
alias(simpleGit)
alias(buildconfig)
alias(binary.compatibility.validator)
alias(shadow)

// generates keywords using the :generator module
alias(keywordGenerator)
Expand Down Expand Up @@ -65,7 +68,6 @@ dependencies {
api(libs.kotlin.reflect)
implementation(libs.kotlin.stdlib)
kotlinCompilerPluginClasspathSamples(project(":plugins:expressions-converter"))
implementation(libs.kotlin.stdlib.jdk8)

api(libs.commonsCsv)
implementation(libs.commonsIo)
Expand Down Expand Up @@ -174,6 +176,37 @@ tasks.withType<KorroTask> {
dependsOn(copySamplesOutputs)
}

// region shadow

tasks.withType<ShadowJar> {
dependencies {
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
exclude(dependency("org.jetbrains.kotlin:kotlin-stdlib:.*"))
exclude(dependency("org.jetbrains.kotlinx:kotlinx-datetime-jvm:.*"))
exclude(dependency("commons-io:commons-io:.*"))
exclude(dependency("commons-io:commons-csv:.*"))
exclude(dependency("org.slf4j:slf4j-api:.*"))
exclude(dependency("io.github.microutils:kotlin-logging-jvm:.*"))
exclude(dependency("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:.*"))
exclude(dependency("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:.*"))
exclude(dependency("commons-codec:commons-codec:.*"))
exclude(dependency("com.squareup:kotlinpoet-jvm:.*"))
exclude(dependency("ch.randelshofer:fastdoubleparser:.*"))
}
exclude("org/jetbrains/kotlinx/dataframe/jupyter/**")
exclude("org/jetbrains/kotlinx/dataframe/io/**")
exclude("org/jetbrains/kotlinx/dataframe/documentation/**")
exclude("org/jetbrains/kotlinx/dataframe/impl/io/**")
exclude("io/github/oshai/kotlinlogging/**")
exclude("apache/**")
exclude("**.html")
exclude("**.js")
exclude("**.css")
minimize()
}

// endregion

// region docPreprocessor

val generatedSourcesFolderName = "generated-sources"
Expand Down Expand Up @@ -364,15 +397,11 @@ kotlin {
explicitApi()
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

tasks.withType<KotlinCompile> {
compilerOptions {
optIn.addAll("kotlin.RequiresOptIn")
freeCompilerArgs.addAll("-Xinline-classes")
freeCompilerArgs.addAll("-Xjvm-default=all")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ public annotation class Interpretable(val interpreter: String)
*/
public annotation class Refine

internal annotation class OptInRefine

@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.FILE, AnnotationTarget.EXPRESSION)
public annotation class DisableInterpretation

@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.EXPRESSION)
public annotation class Import

@Target(AnnotationTarget.PROPERTY)
public annotation class Order(val order: Int)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @see [ColumnsSelectionDsl.cols]
*/
@Suppress("UNCHECKED_CAST")
@Interpretable("All0")
public fun <C> ColumnSet<C>.all(): TransformableColumnSet<C> = allColumnsInternal() as TransformableColumnSet<C>

/**
Expand Down Expand Up @@ -272,7 +273,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @see [ColumnsSelectionDsl.allExcept]
* @see [ColumnsSelectionDsl.cols]
*/
@Interpretable("All0")
@Interpretable("All1")
public fun ColumnsSelectionDsl<*>.all(): TransformableColumnSet<*> = asSingleColumn().allColumnsInternal()

/**
Expand Down Expand Up @@ -323,6 +324,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @see [ColumnsSelectionDsl.allExcept]
* @see [ColumnsSelectionDsl.cols]
*/
@Interpretable("All2")
public fun SingleColumn<DataRow<*>>.allCols(): TransformableColumnSet<*> =
ensureIsColumnGroup().allColumnsInternal()

Expand Down Expand Up @@ -783,6 +785,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column after which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllAfter0")
public fun <C> ColumnSet<C>.allAfter(column: AnyColumnReference): ColumnSet<C> = allAfter(column.path())

/** ## All (Cols) After
Expand Down Expand Up @@ -904,6 +907,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column after which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllAfter1")
public fun <T> ColumnsSelectionDsl<T>.allAfter(column: ColumnSelector<T, *>): ColumnSet<*> =
asSingleColumn().allColsAfter(column)

Expand Down Expand Up @@ -1085,6 +1089,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column after which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllAfter2")
public fun ColumnsSelectionDsl<*>.allAfter(column: AnyColumnReference): ColumnSet<*> = allAfter(column.path())

/** ## All (Cols) After
Expand Down Expand Up @@ -2677,6 +2682,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column from which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllFrom0")
public fun <C> ColumnSet<C>.allFrom(column: AnyColumnReference): ColumnSet<C> = allFrom(column.path())

/** ## All (Cols) From
Expand Down Expand Up @@ -2797,6 +2803,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column from which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllFrom1")
public fun <T> ColumnsSelectionDsl<T>.allFrom(column: ColumnSelector<T, *>): ColumnSet<*> =
asSingleColumn().allColsFrom(column)

Expand Down Expand Up @@ -2978,6 +2985,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column from which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllFrom2")
public fun ColumnsSelectionDsl<*>.allFrom(column: AnyColumnReference): ColumnSet<*> =
asSingleColumn().allColsFrom(column)

Expand Down Expand Up @@ -4569,6 +4577,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column before which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllBefore0")
public fun <C> ColumnSet<C>.allBefore(column: AnyColumnReference): ColumnSet<C> = allBefore(column.path())

/** ## All (Cols) Before
Expand Down Expand Up @@ -4690,6 +4699,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column before which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllBefore1")
public fun <T> ColumnsSelectionDsl<T>.allBefore(column: ColumnSelector<T, *>): ColumnSet<*> =
asSingleColumn().allColsBefore(column)

Expand Down Expand Up @@ -4872,6 +4882,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column before which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllBefore2")
public fun ColumnsSelectionDsl<*>.allBefore(column: AnyColumnReference): ColumnSet<*> = allBefore(column.path())

/** ## All (Cols) Before
Expand Down Expand Up @@ -6462,6 +6473,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column up to which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllUpTo0")
public fun <C> ColumnSet<C>.allUpTo(column: AnyColumnReference): ColumnSet<C> = allUpTo(column.path())

/** ## All (Cols) Up To
Expand Down Expand Up @@ -6582,6 +6594,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column up to which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllUpTo1")
public fun <T> ColumnsSelectionDsl<T>.allUpTo(column: ColumnSelector<T, *>): ColumnSet<*> =
asSingleColumn().allColsUpTo(column)

Expand Down Expand Up @@ -6763,6 +6776,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
* @param [column] The specified column up to which all columns should be taken. This column can be referenced
* to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely.
*/
@Interpretable("AllUpTo2")
public fun ColumnsSelectionDsl<*>.allUpTo(column: AnyColumnReference): ColumnSet<*> =
asSingleColumn().allColsUpTo(column)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.jetbrains.kotlinx.dataframe.AnyRow
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.DataRow
import org.jetbrains.kotlinx.dataframe.Predicate
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
Expand Down Expand Up @@ -175,6 +176,7 @@ public interface ColGroupsColumnsSelectionDsl {
* @see [ColumnsSelectionDsl.frameCols]
* @see [ColumnsSelectionDsl.valueCols]
*/
@Interpretable("ColGroups0")
public fun ColumnSet<*>.colGroups(filter: Predicate<ColumnGroup<*>> = { true }): TransformableColumnSet<AnyRow> =
columnGroupsInternal(filter)

Expand Down Expand Up @@ -210,6 +212,7 @@ public interface ColGroupsColumnsSelectionDsl {
* @see [ColumnsSelectionDsl.frameCols]
* @see [ColumnsSelectionDsl.valueCols]
*/
@Interpretable("ColGroups1")
public fun ColumnsSelectionDsl<*>.colGroups(
filter: Predicate<ColumnGroup<*>> = { true },
): TransformableColumnSet<AnyRow> = asSingleColumn().columnGroupsInternal(filter)
Expand Down Expand Up @@ -246,6 +249,7 @@ public interface ColGroupsColumnsSelectionDsl {
* @see [ColumnsSelectionDsl.frameCols]
* @see [ColumnsSelectionDsl.valueCols]
*/
@Interpretable("ColGroups2")
public fun SingleColumn<DataRow<*>>.colGroups(
filter: Predicate<ColumnGroup<*>> = { true },
): TransformableColumnSet<AnyRow> = this.ensureIsColumnGroup().columnGroupsInternal(filter)
Expand Down
Loading

0 comments on commit 3223e9c

Please sign in to comment.