Skip to content

Commit cd1d7cf

Browse files
Automated commit of generated code
1 parent c0d6075 commit cd1d7cf

File tree

14 files changed

+133
-79
lines changed

14 files changed

+133
-79
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.jetbrains.kotlinx.dataframe.DataColumn
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
@@ -257,6 +258,7 @@ public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
257258
*/
258259
@Suppress("INAPPLICABLE_JVM_NAME")
259260
@JvmName("stringInvokeTyped")
261+
@Interpretable("StringInvokeTyped")
260262
public operator fun <C> String.invoke(): DataColumn<C> = getColumn(this).cast()
261263

262264
/**
@@ -270,6 +272,7 @@ public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
270272
*/
271273
@Suppress("INAPPLICABLE_JVM_NAME")
272274
@JvmName("stringInvokeUntyped")
275+
@Interpretable("StringInvokeUntyped")
273276
public operator fun String.invoke(): DataColumn<*> = getColumn(this)
274277

275278
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ public fun <T> DataFrame<T>.add(vararg dataFrames: AnyFrame): DataFrame<T> = add
114114
* @throws [UnequalColumnSizesException] if columns in an expected result have different sizes.
115115
* @return new [DataFrame] with added columns.
116116
*/
117+
@Refine
118+
@Interpretable("DataFrameAddAll")
117119
public fun <T> DataFrame<T>.addAll(vararg dataFrames: AnyFrame): DataFrame<T> = addAll(dataFrames.asIterable())
118120

119121
/**
@@ -293,6 +295,7 @@ public class AddDsl<T>(
293295

294296
public fun add(column: AnyColumnReference): Boolean = columns.add(column.resolveSingle(df)!!.data)
295297

298+
@Interpretable("AddDslReferencePlus")
296299
public operator fun AnyColumnReference.unaryPlus(): Boolean = add(this)
297300

298301
public operator fun String.unaryPlus(): Boolean = add(df[this])

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public fun <T, C : Comparable<*>?> Grouped<T>.maxFor(
235235
): DataFrame<T> = maxFor(skipNaN) { columns.toColumnSet() }
236236

237237
@Refine
238-
@Interpretable("GroupByMax0")
238+
@Interpretable("GroupByMax2")
239239
public fun <T, C : Comparable<C & Any>?> Grouped<T>.max(
240240
name: String? = null,
241241
skipNaN: Boolean = skipNaNDefault,
@@ -598,13 +598,9 @@ public inline fun <T, reified C : Comparable<C & Any>?> DataFrame<T>.maxByOrNull
598598
public inline fun <T, reified C : Comparable<C & Any>?> DataFrame<T>.maxByOrNull(column: KProperty<C>): DataRow<T>? =
599599
maxByOrNull(column, skipNaN = skipNaNDefault)
600600

601-
@Refine
602-
@Interpretable("GroupByMax1")
603601
@Deprecated(MAX_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
604602
public fun <T> Grouped<T>.max(): DataFrame<T> = max(skipNaN = skipNaNDefault)
605603

606-
@Refine
607-
@Interpretable("GroupByMax0")
608604
@Deprecated(MAX_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
609605
public fun <T, C : Comparable<*>?> Grouped<T>.maxFor(columns: ColumnsForAggregateSelector<T, C>): DataFrame<T> =
610606
maxFor(skipNaN = skipNaNDefault, columns = columns)
@@ -623,8 +619,6 @@ public fun <T, C : Comparable<*>?> Grouped<T>.maxFor(vararg columns: ColumnRefer
623619
public fun <T, C : Comparable<*>?> Grouped<T>.maxFor(vararg columns: KProperty<C>): DataFrame<T> =
624620
maxFor(columns = columns, skipNaN = skipNaNDefault)
625621

626-
@Refine
627-
@Interpretable("GroupByMax0")
628622
@Deprecated(MAX_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
629623
public fun <T, C : Comparable<C & Any>?> Grouped<T>.max(
630624
name: String? = null,
@@ -649,15 +643,12 @@ public fun <T, C : Comparable<C & Any>?> Grouped<T>.max(
649643
name: String? = null,
650644
): DataFrame<T> = max(columns = columns, name = name, skipNaN = skipNaNDefault)
651645

652-
@Refine
653-
@Interpretable("GroupByMaxOf")
654646
@Deprecated(MAX_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
655647
public inline fun <T, reified C : Comparable<C & Any>?> Grouped<T>.maxOf(
656648
name: String? = null,
657649
crossinline expression: RowExpression<T, C>,
658650
): DataFrame<T> = maxOf(name, skipNaN = skipNaNDefault, expression = expression)
659651

660-
@Interpretable("GroupByReduceExpression")
661652
@Deprecated(MAX_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
662653
public inline fun <T, G, reified R : Comparable<R & Any>?> GroupBy<T, G>.maxBy(
663654
crossinline rowExpression: RowExpression<G, R>,

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public fun <T, C : Number?> Grouped<T>.meanFor(
150150
): DataFrame<T> = meanFor(skipNaN) { columns.toColumnSet() }
151151

152152
@Refine
153-
@Interpretable("GroupByMean0")
153+
@Interpretable("GroupByMean2")
154154
public fun <T, C : Number?> Grouped<T>.mean(
155155
name: String? = null,
156156
skipNaN: Boolean = skipNaNDefault,
@@ -353,13 +353,9 @@ public fun <T, C : Number?> DataFrame<T>.mean(vararg columns: KProperty<C>): Dou
353353
public inline fun <T, reified D : Number?> DataFrame<T>.meanOf(crossinline expression: RowExpression<T, D>): Double =
354354
meanOf(skipNaN = skipNaNDefault, expression = expression)
355355

356-
@Refine
357-
@Interpretable("GroupByMean1")
358356
@Deprecated(MEAN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
359357
public fun <T> Grouped<T>.mean(): DataFrame<T> = mean(skipNaN = skipNaNDefault)
360358

361-
@Refine
362-
@Interpretable("GroupByMean0")
363359
@Deprecated(MEAN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
364360
public fun <T, C : Number?> Grouped<T>.meanFor(columns: ColumnsForAggregateSelector<T, C>): DataFrame<T> =
365361
meanFor(skipNaN = skipNaNDefault, columns = columns)
@@ -378,8 +374,6 @@ public fun <T, C : Number?> Grouped<T>.meanFor(vararg columns: ColumnReference<C
378374
public fun <T, C : Number?> Grouped<T>.meanFor(vararg columns: KProperty<C>): DataFrame<T> =
379375
meanFor(columns = columns, skipNaN = skipNaNDefault)
380376

381-
@Refine
382-
@Interpretable("GroupByMean0")
383377
@Deprecated(MEAN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
384378
public fun <T, C : Number?> Grouped<T>.mean(name: String? = null, columns: ColumnsSelector<T, C>): DataFrame<T> =
385379
mean(name, skipNaN = skipNaNDefault, columns = columns)
@@ -398,8 +392,6 @@ public fun <T, C : Number?> Grouped<T>.mean(vararg columns: ColumnReference<C>,
398392
public fun <T, C : Number?> Grouped<T>.mean(vararg columns: KProperty<C>, name: String? = null): DataFrame<T> =
399393
mean(columns = columns, name = name, skipNaN = skipNaNDefault)
400394

401-
@Refine
402-
@Interpretable("GroupByMeanOf")
403395
@Deprecated(MEAN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
404396
public inline fun <T, reified R : Number?> Grouped<T>.meanOf(
405397
name: String? = null,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public fun <T, C : Comparable<*>?> Grouped<T>.medianFor(
353353
): DataFrame<T> = medianFor(skipNaN) { columns.toColumnSet() }
354354

355355
@Refine
356-
@Interpretable("GroupByMedian0")
356+
@Interpretable("GroupByMedian2")
357357
public fun <T, C : Comparable<C & Any>?> Grouped<T>.median(
358358
name: String? = null,
359359
skipNaN: Boolean = skipNaNDefault,

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public fun <T, C : Comparable<*>?> Grouped<T>.minFor(
235235
): DataFrame<T> = minFor(skipNaN) { columns.toColumnSet() }
236236

237237
@Refine
238-
@Interpretable("GroupByMin0")
238+
@Interpretable("GroupByMin2")
239239
public fun <T, C : Comparable<C & Any>?> Grouped<T>.min(
240240
name: String? = null,
241241
skipNaN: Boolean = skipNaNDefault,
@@ -598,13 +598,9 @@ public inline fun <T, reified C : Comparable<C & Any>?> DataFrame<T>.minByOrNull
598598
public inline fun <T, reified C : Comparable<C & Any>?> DataFrame<T>.minByOrNull(column: KProperty<C>): DataRow<T>? =
599599
minByOrNull(column, skipNaN = skipNaNDefault)
600600

601-
@Refine
602-
@Interpretable("GroupByMin1")
603601
@Deprecated(MIN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
604602
public fun <T> Grouped<T>.min(): DataFrame<T> = min(skipNaN = skipNaNDefault)
605603

606-
@Refine
607-
@Interpretable("GroupByMin0")
608604
@Deprecated(MIN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
609605
public fun <T, C : Comparable<*>?> Grouped<T>.minFor(columns: ColumnsForAggregateSelector<T, C>): DataFrame<T> =
610606
minFor(skipNaN = skipNaNDefault, columns = columns)
@@ -623,8 +619,6 @@ public fun <T, C : Comparable<*>?> Grouped<T>.minFor(vararg columns: ColumnRefer
623619
public fun <T, C : Comparable<*>?> Grouped<T>.minFor(vararg columns: KProperty<C>): DataFrame<T> =
624620
minFor(columns = columns, skipNaN = skipNaNDefault)
625621

626-
@Refine
627-
@Interpretable("GroupByMin0")
628622
@Deprecated(MIN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
629623
public fun <T, C : Comparable<C & Any>?> Grouped<T>.min(
630624
name: String? = null,
@@ -649,15 +643,12 @@ public fun <T, C : Comparable<C & Any>?> Grouped<T>.min(
649643
name: String? = null,
650644
): DataFrame<T> = min(columns = columns, name = name, skipNaN = skipNaNDefault)
651645

652-
@Refine
653-
@Interpretable("GroupByMinOf")
654646
@Deprecated(MIN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
655647
public inline fun <T, reified C : Comparable<C & Any>?> Grouped<T>.minOf(
656648
name: String? = null,
657649
crossinline expression: RowExpression<T, C>,
658650
): DataFrame<T> = minOf(name, skipNaN = skipNaNDefault, expression = expression)
659651

660-
@Interpretable("GroupByReduceExpression")
661652
@Deprecated(MIN_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
662653
public inline fun <T, G, reified R : Comparable<R & Any>?> GroupBy<T, G>.minBy(
663654
crossinline rowExpression: RowExpression<G, R>,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public fun <T, C : Comparable<*>?> Grouped<T>.percentileFor(
421421
): DataFrame<T> = percentileFor(percentile, skipNaN) { columns.toColumnSet() }
422422

423423
@Refine
424-
@Interpretable("GroupByPercentile0")
424+
@Interpretable("GroupByPercentile2")
425425
public fun <T, C : Comparable<C & Any>?> Grouped<T>.percentile(
426426
percentile: Double,
427427
name: String? = null,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public fun <T, C : Number?> Grouped<T>.stdFor(
160160
): DataFrame<T> = stdFor(skipNaN, ddof) { columns.toColumnSet() }
161161

162162
@Refine
163-
@Interpretable("GroupByStd0")
163+
@Interpretable("GroupByStd2")
164164
public fun <T, C : Number?> Grouped<T>.std(
165165
name: String? = null,
166166
skipNaN: Boolean = skipNaNDefault,

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public fun <T, C : Number?> Grouped<T>.sumFor(
263263
): DataFrame<T> = sumFor(skipNaN) { columns.toColumnSet() }
264264

265265
@Refine
266-
@Interpretable("GroupBySum0")
266+
@Interpretable("GroupBySum2")
267267
public fun <T, C : Number?> Grouped<T>.sum(
268268
name: String? = null,
269269
skipNaN: Boolean = skipNaNDefault,
@@ -500,13 +500,9 @@ public inline fun <T, reified C : Number?> DataFrame<T>.sum(vararg columns: KPro
500500
public inline fun <T, reified C : Number?> DataFrame<T>.sumOf(crossinline expression: RowExpression<T, C>): C & Any =
501501
sumOf(skipNaN = skipNaNDefault, expression = expression)
502502

503-
@Refine
504-
@Interpretable("GroupBySum1")
505503
@Deprecated(SUM_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
506504
public fun <T> Grouped<T>.sum(): DataFrame<T> = sum(skipNaN = skipNaNDefault)
507505

508-
@Refine
509-
@Interpretable("GroupBySum0")
510506
@Deprecated(SUM_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
511507
public fun <T, C : Number?> Grouped<T>.sumFor(columns: ColumnsForAggregateSelector<T, C>): DataFrame<T> =
512508
sumFor(skipNaN = skipNaNDefault, columns = columns)
@@ -525,8 +521,6 @@ public fun <T, C : Number?> Grouped<T>.sumFor(vararg columns: ColumnReference<C>
525521
public fun <T, C : Number?> Grouped<T>.sumFor(vararg columns: KProperty<C>): DataFrame<T> =
526522
sumFor(columns = columns, skipNaN = skipNaNDefault)
527523

528-
@Refine
529-
@Interpretable("GroupBySum0")
530524
@Deprecated(SUM_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
531525
public fun <T, C : Number?> Grouped<T>.sum(name: String? = null, columns: ColumnsSelector<T, C>): DataFrame<T> =
532526
sum(name, skipNaN = skipNaNDefault, columns = columns)
@@ -545,8 +539,6 @@ public fun <T, C : Number?> Grouped<T>.sum(vararg columns: ColumnReference<C>, n
545539
public fun <T, C : Number?> Grouped<T>.sum(vararg columns: KProperty<C>, name: String? = null): DataFrame<T> =
546540
sum(columns = columns, name = name, skipNaN = skipNaNDefault)
547541

548-
@Refine
549-
@Interpretable("GroupBySumOf")
550542
@Deprecated(SUM_NO_SKIPNAN, level = DeprecationLevel.HIDDEN)
551543
public inline fun <T, reified R : Number?> Grouped<T>.sumOf(
552544
resultName: String? = null,

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
1111
import org.jetbrains.kotlinx.dataframe.annotations.Refine
1212
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
1313
import org.jetbrains.kotlinx.dataframe.impl.ColumnNameGenerator
14-
import org.jetbrains.kotlinx.dataframe.impl.api.canBeUnfolded
1514
import org.jetbrains.kotlinx.dataframe.impl.api.createDataFrameImpl
1615
import org.jetbrains.kotlinx.dataframe.impl.asList
1716
import org.jetbrains.kotlinx.dataframe.impl.columnName
@@ -21,28 +20,21 @@ import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
2120
import kotlin.reflect.KCallable
2221
import kotlin.reflect.KClass
2322
import kotlin.reflect.KProperty
23+
import kotlin.reflect.typeOf
2424

2525
// region read DataFrame from objects
2626

2727
@Refine
2828
@Interpretable("toDataFrameDefault")
2929
public inline fun <reified T> Iterable<T>.toDataFrame(): DataFrame<T> =
3030
toDataFrame {
31-
// check if type is value: primitives, primitive arrays, datetime types etc.,
32-
// or has no properties
33-
if (!T::class.canBeUnfolded) {
34-
// create a single `value` column
35-
ValueProperty<T>::value.name from { it }
36-
} else {
37-
// otherwise creates columns based on properties
38-
properties()
39-
}
31+
properties()
4032
}
4133

4234
@Refine
4335
@Interpretable("toDataFrameDsl")
4436
public inline fun <reified T> Iterable<T>.toDataFrame(noinline body: CreateDataFrameDsl<T>.() -> Unit): DataFrame<T> =
45-
createDataFrameImpl(T::class, body)
37+
createDataFrameImpl(typeOf<T>(), body)
4638

4739
@Refine
4840
@Interpretable("toDataFrame")

0 commit comments

Comments
 (0)