Skip to content

Commit 5bc26f5

Browse files
Merge branch 'master' into count_kdocs
# Conflicts: # core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt
2 parents febc355 + 28781e9 commit 5bc26f5

File tree

280 files changed

+11473
-3103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+11473
-3103
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Explore [**documentation**](https://kotlin.github.io/dataframe) for details.
4242
You could find the following articles there:
4343

4444
* [Guides and Examples](https://kotlin.github.io/dataframe/guides-and-examples.html)
45-
* [Get started with Kotlin DataFrame](https://kotlin.github.io/dataframe/gettingstarted.html)
45+
* [Get started with Kotlin DataFrame](https://kotlin.github.io/dataframe/setup.html)
4646
* [Working with Data Schemas](https://kotlin.github.io/dataframe/schemas.html)
4747
* [Setup compiler plugin in Gradle project](https://kotlin.github.io/dataframe/compiler-plugin.html)
4848
* [Full list of all supported operations](https://kotlin.github.io/dataframe/operations.html)
@@ -61,7 +61,7 @@ Check out this [notebook with new features](examples/notebooks/feature_overviews
6161
## Setup
6262

6363
> For more detailed instructions on how to get started with Kotlin DataFrame, refer to the
64-
> [Getting Started](https://kotlin.github.io/dataframe/gettingstarted.html).
64+
> [Getting Started](https://kotlin.github.io/dataframe/setup.html).
6565
6666
### Kotlin Notebook
6767

build.gradle.kts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ plugins {
2222
alias(dokka)
2323
// alias(kover)
2424
alias(ktlint)
25-
alias(korro) apply false
26-
alias(kodex) apply false
25+
26+
// TODO cannot define korro and kodex here due to leaking them kotlin-compiler-embeddable into the build classpath
27+
// alias(korro) apply false
28+
// alias(kodex) apply false
29+
2730
alias(simpleGit) apply false
2831
alias(dependencyVersions)
2932
alias(buildconfig) apply false
@@ -155,6 +158,7 @@ val modulesUsingJava11 = with(projects) {
155158
dataframeGeo,
156159
examples.ideaExamples.titanic,
157160
tests,
161+
plugins.dataframeGradlePlugin,
158162
)
159163
}.map { it.path }
160164

@@ -204,6 +208,7 @@ allprojects {
204208
configure<BuildConfigExtension> {
205209
packageName = "org.jetbrains.kotlinx.dataframe"
206210
className = "BuildConfig"
211+
buildConfigField("KOTLIN_VERSION", libs.versions.kotlin.asProvider().get())
207212
buildConfigField("VERSION", "${project.version}")
208213
buildConfigField("DEBUG", findProperty("kotlin.dataframe.debug")?.toString()?.toBoolean() ?: false)
209214
}
@@ -248,8 +253,8 @@ kotlinPublications {
248253
fairDokkaJars = false
249254

250255
sonatypeSettings(
251-
project.findProperty("kds.sonatype.user") as String?,
252-
project.findProperty("kds.sonatype.password") as String?,
256+
project.findProperty("kds.sonatype.central.username") as String?,
257+
project.findProperty("kds.sonatype.central.password") as String?,
253258
"dataframe project, v. ${project.version}",
254259
)
255260

core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and [tests/.../samples/api](../tests/src/test/kotlin/org/jetbrains/kotlinx/dataf
1818
and they are copied over to Markdown files in [docs/StardustDocs/topics](../docs/StardustDocs/topics)
1919
by [Korro](https://github.com/devcrocod/korro).
2020

21-
### Explainer dataframes
21+
### ~~Explainer dataframes~~ NOTE: This is being moved to [tests](../tests)
2222

2323
Aside from code samples, `@TransformDataFrameExpressions` annotated test functions also generate sample
2424
dataframe HTML files that can be used as iFrames on the documentation website.

core/api/core.api

Lines changed: 237 additions & 229 deletions
Large diffs are not rendered by default.

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ internal interface FillNulls {
5555
* `[ `__`.`__[**`at`**][org.jetbrains.kotlinx.dataframe.api.Update.at]**`(`**[`rowIndices`][org.jetbrains.kotlinx.dataframe.api.CommonUpdateAtFunctionDoc.RowIndicesParam]**`)`**` ]`
5656
*
5757
* &nbsp;&nbsp;&nbsp;&nbsp;
58+
* `[ `__`.`__[**`notNull`**][org.jetbrains.kotlinx.dataframe.api.Update.notNull]**`()`**` ]`
59+
*
60+
* &nbsp;&nbsp;&nbsp;&nbsp;
5861
* __`.`__[**`with`**][org.jetbrains.kotlinx.dataframe.api.Update.with]**` { `**[`rowExpression`][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]**` }`**
5962
*
6063
* &nbsp;&nbsp;&nbsp;&nbsp;
@@ -389,6 +392,9 @@ internal interface FillNaNs {
389392
* `[ `__`.`__[**`at`**][org.jetbrains.kotlinx.dataframe.api.Update.at]**`(`**[`rowIndices`][org.jetbrains.kotlinx.dataframe.api.CommonUpdateAtFunctionDoc.RowIndicesParam]**`)`**` ]`
390393
*
391394
* &nbsp;&nbsp;&nbsp;&nbsp;
395+
* `[ `__`.`__[**`notNull`**][org.jetbrains.kotlinx.dataframe.api.Update.notNull]**`()`**` ]`
396+
*
397+
* &nbsp;&nbsp;&nbsp;&nbsp;
392398
* __`.`__[**`with`**][org.jetbrains.kotlinx.dataframe.api.Update.with]**` { `**[`rowExpression`][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]**` }`**
393399
*
394400
* &nbsp;&nbsp;&nbsp;&nbsp;
@@ -662,6 +668,9 @@ internal interface FillNA {
662668
* `[ `__`.`__[**`at`**][org.jetbrains.kotlinx.dataframe.api.Update.at]**`(`**[`rowIndices`][org.jetbrains.kotlinx.dataframe.api.CommonUpdateAtFunctionDoc.RowIndicesParam]**`)`**` ]`
663669
*
664670
* &nbsp;&nbsp;&nbsp;&nbsp;
671+
* `[ `__`.`__[**`notNull`**][org.jetbrains.kotlinx.dataframe.api.Update.notNull]**`()`**` ]`
672+
*
673+
* &nbsp;&nbsp;&nbsp;&nbsp;
665674
* __`.`__[**`with`**][org.jetbrains.kotlinx.dataframe.api.Update.with]**` { `**[`rowExpression`][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]**` }`**
666675
*
667676
* &nbsp;&nbsp;&nbsp;&nbsp;
@@ -964,6 +973,15 @@ public fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false, columns: Co
964973
}
965974
}
966975

976+
@Refine
977+
@Interpretable("DropNulls0")
978+
@Deprecated(
979+
"DataFrame conventional name for filterNot* functions is drop*",
980+
ReplaceWith("dropNulls(columns = columns)"),
981+
DeprecationLevel.ERROR,
982+
)
983+
public fun <T> DataFrame<T>.filterNotNull(columns: ColumnsSelector<T, *>): DataFrame<T> = dropNulls(columns = columns)
984+
967985
/**
968986
* ## The Drop Nulls Operation
969987
*
@@ -1256,6 +1274,8 @@ public fun <T> DataFrame<T>.dropNA(vararg columns: AnyColumnReference, whereAllN
12561274
* If `true`, rows are dropped if all selected cells are [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA].
12571275
* If `false`, rows are dropped if any of the selected cells is [`NA`][org.jetbrains.kotlinx.dataframe.documentation.NA].
12581276
*/
1277+
@Refine
1278+
@Interpretable("DropNa1")
12591279
public fun <T> DataFrame<T>.dropNA(whereAllNA: Boolean = false): DataFrame<T> = dropNA(whereAllNA) { all() }
12601280

12611281
/**

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/add.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import org.jetbrains.kotlinx.dataframe.ColumnsContainer
1010
import org.jetbrains.kotlinx.dataframe.DataColumn
1111
import org.jetbrains.kotlinx.dataframe.DataFrame
1212
import org.jetbrains.kotlinx.dataframe.DataRow
13-
import org.jetbrains.kotlinx.dataframe.RowExpression
1413
import org.jetbrains.kotlinx.dataframe.Selector
1514
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
1615
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
@@ -257,27 +256,27 @@ public class AddDsl<T>(
257256
internal inline fun <reified R> add(
258257
name: String,
259258
infer: Infer = Infer.Nulls,
260-
noinline expression: RowExpression<T, R>,
259+
noinline expression: AddExpression<T, R>,
261260
): Boolean = add(df.mapToColumn(name, infer, expression))
262261

263262
public inline fun <reified R> expr(
264263
infer: Infer = Infer.Nulls,
265-
noinline expression: RowExpression<T, R>,
264+
noinline expression: AddExpression<T, R>,
266265
): DataColumn<R> = df.mapToColumn("", infer, expression)
267266

268267
@Interpretable("From")
269-
public inline infix fun <reified R> String.from(noinline expression: RowExpression<T, R>): Boolean =
268+
public inline infix fun <reified R> String.from(noinline expression: AddExpression<T, R>): Boolean =
270269
add(this, Infer.Nulls, expression)
271270

272271
// TODO: use path instead of name
273272
@Deprecated(DEPRECATED_ACCESS_API)
274273
@AccessApiOverload
275-
public inline infix fun <reified R> ColumnAccessor<R>.from(noinline expression: RowExpression<T, R>): Boolean =
274+
public inline infix fun <reified R> ColumnAccessor<R>.from(noinline expression: AddExpression<T, R>): Boolean =
276275
name().from(expression)
277276

278277
@Deprecated(DEPRECATED_ACCESS_API)
279278
@AccessApiOverload
280-
public inline infix fun <reified R> KProperty<R>.from(noinline expression: RowExpression<T, R>): Boolean =
279+
public inline infix fun <reified R> KProperty<R>.from(noinline expression: AddExpression<T, R>): Boolean =
281280
add(name, Infer.Nulls, expression)
282281

283282
public infix fun String.from(column: AnyColumnReference): Boolean = add(column.rename(this))
@@ -420,15 +419,15 @@ public fun <T> DataFrame<T>.add(body: AddDsl<T>.() -> Unit): DataFrame<T> {
420419
public inline fun <reified R, T, G> GroupBy<T, G>.add(
421420
name: String,
422421
infer: Infer = Infer.Nulls,
423-
noinline expression: RowExpression<G, R>,
422+
noinline expression: AddExpression<G, R>,
424423
): GroupBy<T, G> = updateGroups { add(name, infer, expression) }
425424

426425
@Deprecated(DEPRECATED_ACCESS_API)
427426
@AccessApiOverload
428427
public inline fun <reified R, T, G> GroupBy<T, G>.add(
429428
column: ColumnAccessor<G>,
430429
infer: Infer = Infer.Nulls,
431-
noinline expression: RowExpression<G, R>,
430+
noinline expression: AddExpression<G, R>,
432431
): GroupBy<T, G> = add(column.name(), infer, expression)
433432

434433
public class AddGroup<T>(internal val body: AddDsl<T>.() -> Unit)

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
225225
*/
226226
@Suppress("UNCHECKED_CAST")
227227
@Interpretable("All0")
228-
public fun <C> ColumnSet<C>.all(): TransformableColumnSet<C> = allColumnsInternal() as TransformableColumnSet<C>
228+
public fun <C> ColumnSet<C>.all(): ColumnSet<C> = allColumnsInternal().cast()
229229

230230
/**
231231
* ## All (Cols)
@@ -276,7 +276,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
276276
* @see [ColumnsSelectionDsl.cols]
277277
*/
278278
@Interpretable("All1")
279-
public fun ColumnsSelectionDsl<*>.all(): TransformableColumnSet<*> = asSingleColumn().allColumnsInternal()
279+
public fun ColumnsSelectionDsl<*>.all(): ColumnSet<*> = asSingleColumn().allColumnsInternal()
280280

281281
/**
282282
* ## All (Cols)
@@ -327,8 +327,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
327327
* @see [ColumnsSelectionDsl.cols]
328328
*/
329329
@Interpretable("All2")
330-
public fun SingleColumn<DataRow<*>>.allCols(): TransformableColumnSet<*> =
331-
ensureIsColumnGroup().allColumnsInternal()
330+
public fun SingleColumn<DataRow<*>>.allCols(): ColumnSet<*> = ensureIsColumnGroup().allColumnsInternal()
332331

333332
/**
334333
* ## All (Cols)
@@ -378,7 +377,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
378377
* @see [ColumnsSelectionDsl.allExcept]
379378
* @see [ColumnsSelectionDsl.cols]
380379
*/
381-
public fun String.allCols(): TransformableColumnSet<*> = columnGroup(this).allCols()
380+
public fun String.allCols(): ColumnSet<*> = columnGroup(this).allCols()
382381

383382
/**
384383
* ## All (Cols)
@@ -430,7 +429,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
430429
*/
431430
@Deprecated(DEPRECATED_ACCESS_API)
432431
@AccessApiOverload
433-
public fun KProperty<*>.allCols(): TransformableColumnSet<*> = columnGroup(this).allCols()
432+
public fun KProperty<*>.allCols(): ColumnSet<*> = columnGroup(this).allCols()
434433

435434
/**
436435
* ## All (Cols)
@@ -480,7 +479,7 @@ public interface AllColumnsSelectionDsl<out _UNUSED> {
480479
* @see [ColumnsSelectionDsl.allExcept]
481480
* @see [ColumnsSelectionDsl.cols]
482481
*/
483-
public fun ColumnPath.allCols(): TransformableColumnSet<*> = columnGroup(this).allCols()
482+
public fun ColumnPath.allCols(): ColumnSet<*> = columnGroup(this).allCols()
484483

485484
// endregion
486485

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cast.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.jetbrains.kotlinx.dataframe.DataColumn
99
import org.jetbrains.kotlinx.dataframe.DataFrame
1010
import org.jetbrains.kotlinx.dataframe.DataRow
1111
import org.jetbrains.kotlinx.dataframe.annotations.Check
12+
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
1213
import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor
1314
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
1415
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
@@ -19,8 +20,6 @@ import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
1920
import org.jetbrains.kotlinx.dataframe.columns.SingleColumn
2021
import org.jetbrains.kotlinx.dataframe.columns.ValueColumn
2122
import org.jetbrains.kotlinx.dataframe.impl.api.convertToImpl
22-
import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet
23-
import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn
2423
import kotlin.reflect.typeOf
2524

2625
@Check
@@ -86,18 +85,16 @@ public fun <T> ColumnGroup<*>.cast(): ColumnGroup<T> = this as ColumnGroup<T>
8685

8786
public fun <T> ColumnWithPath<*>.cast(): ColumnWithPath<T> = this as ColumnWithPath<T>
8887

88+
@Interpretable("ColumnAccessorCast")
8989
public fun <T> ColumnAccessor<*>.cast(): ColumnAccessor<T> = this as ColumnAccessor<T>
9090

91+
@Interpretable("ColumnSetCast")
9192
public fun <C> ColumnSet<*>.cast(): ColumnSet<C> = this as ColumnSet<C>
9293

9394
public fun <C> ColumnsResolver<*>.cast(): ColumnsResolver<C> = this as ColumnsResolver<C>
9495

9596
public fun <C> SingleColumn<*>.cast(): SingleColumn<C> = this as SingleColumn<C>
9697

97-
public fun <C> TransformableColumnSet<*>.cast(): TransformableColumnSet<C> = this as TransformableColumnSet<C>
98-
99-
public fun <C> TransformableSingleColumn<*>.cast(): TransformableSingleColumn<C> = this as TransformableSingleColumn<C>
100-
10198
public fun <C> ColumnReference<*>.cast(): ColumnReference<C> = this as ColumnReference<C>
10299

103100
public fun <T, G> GroupBy<*, *>.cast(): GroupBy<T, G> = this as GroupBy<T, G>

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.jetbrains.kotlinx.dataframe.ColumnGroupReference
55
import org.jetbrains.kotlinx.dataframe.DataFrame
66
import org.jetbrains.kotlinx.dataframe.DataRow
77
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
8+
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
89
import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor
910
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
1011
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
@@ -672,6 +673,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
672673
*/
673674
@Suppress("INAPPLICABLE_JVM_NAME")
674675
@JvmName("colUnTyped")
676+
@Interpretable("Col")
675677
public fun col(name: String): ColumnAccessor<*> = column<Any?>(name)
676678

677679
/**
@@ -724,6 +726,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
724726
* @param [name] The name of the column.
725727
* @param [C] The type of the column.
726728
*/
729+
@Interpretable("ColUntyped")
727730
public fun <C> col(name: String): ColumnAccessor<C> = column(name)
728731

729732
/**
@@ -992,6 +995,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
992995
*/
993996
@Suppress("INAPPLICABLE_JVM_NAME")
994997
@JvmName("colUnTyped")
998+
@Interpretable("StringNestedColUntyped")
995999
public fun String.col(name: String): ColumnAccessor<*> = col<Any?>(name)
9961000

9971001
/**
@@ -1044,6 +1048,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
10441048
* @param [name] The name of the column.
10451049
* @param [C] The type of the column.
10461050
*/
1051+
@Interpretable("StringNestedCol")
10471052
public fun <C> String.col(name: String): ColumnAccessor<C> =
10481053
columnGroup(this)
10491054
.ensureIsColumnGroup()
@@ -1210,6 +1215,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
12101215
*/
12111216
@Suppress("INAPPLICABLE_JVM_NAME")
12121217
@JvmName("colUnTyped")
1218+
@Interpretable("ColumnPathColUntyped")
12131219
public fun ColumnPath.col(name: String): ColumnAccessor<*> = col<Any?>(name)
12141220

12151221
/**
@@ -1262,6 +1268,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
12621268
* @param [name] The name of the column.
12631269
* @param [C] The type of the column.
12641270
*/
1271+
@Interpretable("ColumnPathCol")
12651272
public fun <C> ColumnPath.col(name: String): ColumnAccessor<C> =
12661273
columnGroup(this).ensureIsColumnGroup().column(name)
12671274

0 commit comments

Comments
 (0)