Skip to content

Commit 2dd54c6

Browse files
committed
fixup! updating generated-sources
1 parent a0c1a18 commit 2dd54c6

File tree

121 files changed

+1328
-1911
lines changed

Some content is hidden

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

121 files changed

+1328
-1911
lines changed

core/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ val processKDocsMain by creatingProcessDocTask(processKDocsMainSources) {
216216
}
217217
}
218218

219+
tasks.named("ktlintGeneratedSourcesSourceSetCheck") {
220+
onlyIf { false }
221+
}
222+
tasks.named("runKtlintCheckOverGeneratedSourcesSourceSet") {
223+
onlyIf { false }
224+
}
225+
219226
// Exclude the generated/processed sources from the IDE
220227
idea {
221228
module {

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ internal interface DiffOrNullDocs
104104
@OptIn(ExperimentalTypeInference::class)
105105
@OverloadResolutionByLambdaReturnType
106106
public fun <T> DataRow<T>.diff(firstRowResult: Double, expression: RowExpression<T, Double>): Double =
107-
prev()?.let { p ->
108-
expression(
109-
this,
110-
this,
111-
) - expression(p, p)
112-
} ?: firstRowResult
107+
prev()?.let { p -> expression(this, this) - expression(p, p) }
108+
?: firstRowResult
113109

114110
/**
115111
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.
@@ -120,28 +116,26 @@ public fun <T> DataRow<T>.diff(firstRowResult: Double, expression: RowExpression
120116
@OverloadResolutionByLambdaReturnType
121117
// required to resolve `diff(0) { intValue }`
122118
public fun <T> DataRow<T>.diff(firstRowResult: Int, expression: RowExpression<T, Int>): Int =
123-
prev()?.let { p ->
124-
expression(
125-
this,
126-
this,
127-
) - expression(p, p)
128-
} ?: firstRowResult
119+
prev()?.let { p -> expression(this, this) - expression(p, p) }
120+
?: firstRowResult
129121

130122
/**
131123
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.
132124
*
133125
* @return [firstRowValue] for the first row; difference between expression computed for current and previous row for the following rows
134126
*/
135127
public fun <T> DataRow<T>.diff(firstRowResult: Long, expression: RowExpression<T, Long>): Long =
136-
prev()?.let { p -> expression(this, this) - expression(p, p) } ?: firstRowResult
128+
prev()?.let { p -> expression(this, this) - expression(p, p) }
129+
?: firstRowResult
137130

138131
/**
139132
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.
140133
*
141134
* @return [firstRowValue] for the first row; difference between expression computed for current and previous row for the following rows
142135
*/
143136
public fun <T> DataRow<T>.diff(firstRowResult: Float, expression: RowExpression<T, Float>): Float =
144-
prev()?.let { p -> expression(this, this) - expression(p, p) } ?: firstRowResult
137+
prev()?.let { p -> expression(this, this) - expression(p, p) }
138+
?: firstRowResult
145139

146140
/**
147141
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.
@@ -151,12 +145,7 @@ public fun <T> DataRow<T>.diff(firstRowResult: Float, expression: RowExpression<
151145
@OptIn(ExperimentalTypeInference::class)
152146
@OverloadResolutionByLambdaReturnType
153147
public fun <T> DataRow<T>.diffOrNull(expression: RowExpression<T, Double>): Double? =
154-
prev()?.let { p ->
155-
expression(
156-
this,
157-
this,
158-
) - expression(p, p)
159-
}
148+
prev()?.let { p -> expression(this, this) - expression(p, p) }
160149

161150
/**
162151
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ public value class JsonPath(
2929
JsonPath(
3030
path.toCharArray().let { chars ->
3131
val lastStarIndex = chars.lastIndexOf('*')
32-
chars
33-
.flatMapIndexed { i, c ->
34-
if (i == lastStarIndex) {
35-
index.toString().toCharArray().toList()
36-
} else {
37-
listOf(c)
38-
}
39-
}.joinToString("")
32+
chars.flatMapIndexed { i, c ->
33+
if (i == lastStarIndex) {
34+
index.toString().toCharArray().toList()
35+
} else {
36+
listOf(c)
37+
}
38+
}.joinToString("")
4039
},
4140
)
4241

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ public fun <T, R> Pivot<T>.aggregate(separate: Boolean = false, body: Selector<A
2121
@Refine
2222
@Interpretable("Aggregate")
2323
public fun <T, R> Grouped<T>.aggregate(body: AggregateGroupedBody<T, R>): DataFrame<T> =
24-
aggregateGroupBy((this as GroupBy<*, *>).toDataFrame(), {
25-
groups.cast()
26-
}, removeColumns = true, body).cast<T>()
24+
aggregateGroupBy((this as GroupBy<*, *>).toDataFrame(), { groups.cast() }, removeColumns = true, body).cast<T>()

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4663,17 +4663,16 @@ internal fun SingleColumn<DataRow<*>>.allColsExceptInternal(other: ColumnsResolv
46634663
internal fun <C> SingleColumn<DataRow<C>>.exceptExperimentalInternal(
46644664
other: ColumnsResolver<*>,
46654665
): SingleColumn<DataRow<C>> =
4666-
ensureIsColumnGroup()
4667-
.transformSingle { singleCol ->
4668-
val columnsToExcept = singleCol
4669-
.asColumnGroup()
4670-
.getColumnsWithPaths { other }
4671-
.map { it.changePath(singleCol.path + it.path) }
4666+
ensureIsColumnGroup().transformSingle { singleCol ->
4667+
val columnsToExcept = singleCol
4668+
.asColumnGroup()
4669+
.getColumnsWithPaths { other }
4670+
.map { it.changePath(singleCol.path + it.path) }
46724671

4673-
val newCols = listOf(singleCol).allColumnsExceptKeepingStructure(columnsToExcept)
4672+
val newCols = listOf(singleCol).allColumnsExceptKeepingStructure(columnsToExcept)
46744673

4675-
newCols as List<ColumnWithPath<DataRow<*>>>
4676-
}.singleInternal() as SingleColumn<DataRow<C>>
4674+
newCols as List<ColumnWithPath<DataRow<*>>>
4675+
}.singleInternal() as SingleColumn<DataRow<C>>
46774676

46784677
/**
46794678
* Functions annotated with this annotation are experimental and will be removed or renamed in the future.

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,19 @@ public fun <T> DataFrame<T>.append(vararg values: Any?): DataFrame<T> {
1414
"Invalid number of arguments. Multiple of $ncol is expected, but actual was: ${values.size}"
1515
}
1616
val newRows = values.size / ncol
17-
return columns()
18-
.mapIndexed { colIndex, col ->
19-
val newValues = (0 until newRows).map { values[colIndex + it * ncol] }
20-
col.updateWith(col.values + newValues)
21-
}.toDataFrame()
22-
.cast()
17+
return columns().mapIndexed { colIndex, col ->
18+
val newValues = (0 until newRows).map { values[colIndex + it * ncol] }
19+
col.updateWith(col.values + newValues)
20+
}.toDataFrame().cast()
2321
}
2422

2523
public fun <T> DataFrame<T>.appendNulls(numberOfRows: Int = 1): DataFrame<T> {
2624
require(numberOfRows >= 0)
2725
if (numberOfRows == 0) return this
2826
if (ncol == 0) return DataFrame.empty(nrow + numberOfRows).cast()
29-
return columns()
30-
.map { col ->
31-
col.updateWith(col.values + arrayOfNulls(numberOfRows))
32-
}.toDataFrame()
33-
.cast()
27+
return columns().map { col ->
28+
col.updateWith(col.values + arrayOfNulls(numberOfRows))
29+
}.toDataFrame().cast()
3430
}
3531

3632
// endregion

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

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,11 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
338338
* @param [C] The type of the column.
339339
*/
340340
public fun <C> SingleColumn<DataRow<*>>.col(col: ColumnAccessor<C>): SingleColumn<C> =
341-
this
342-
.ensureIsColumnGroup()
343-
.transformSingle {
344-
val child = it.getCol(col)
345-
?: throw IllegalStateException("Column '${col.path()}' not found in column group '${it.path}'")
346-
listOf(child)
347-
}.singleImpl()
341+
this.ensureIsColumnGroup().transformSingle {
342+
val child = it.getCol(col)
343+
?: throw IllegalStateException("Column '${col.path()}' not found in column group '${it.path}'")
344+
listOf(child)
345+
}.singleImpl()
348346

349347
/**
350348
* ## Col
@@ -814,13 +812,11 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
814812
* @param [C] The type of the column.
815813
*/
816814
public fun <C> SingleColumn<DataRow<*>>.col(name: String): SingleColumn<C> =
817-
this
818-
.ensureIsColumnGroup()
819-
.transformSingle {
820-
val child = it.getCol(name)?.cast<C>()
821-
?: throw IllegalStateException("Column '$name' not found in column group '${it.path}'")
822-
listOf(child)
823-
}.singleImpl()
815+
this.ensureIsColumnGroup().transformSingle {
816+
val child = it.getCol(name)?.cast<C>()
817+
?: throw IllegalStateException("Column '$name' not found in column group '${it.path}'")
818+
listOf(child)
819+
}.singleImpl()
824820

825821
/**
826822
* ## Col
@@ -1511,13 +1507,11 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
15111507
* @param [C] The type of the column.
15121508
*/
15131509
public fun <C> SingleColumn<DataRow<*>>.col(path: ColumnPath): SingleColumn<C> =
1514-
this
1515-
.ensureIsColumnGroup()
1516-
.transformSingle {
1517-
val child = it.getCol(path)?.cast<C>()
1518-
?: throw IllegalStateException("Column '$path' not found in column group '${it.path}'")
1519-
listOf(child)
1520-
}.singleImpl()
1510+
this.ensureIsColumnGroup().transformSingle {
1511+
val child = it.getCol(path)?.cast<C>()
1512+
?: throw IllegalStateException("Column '$path' not found in column group '${it.path}'")
1513+
listOf(child)
1514+
}.singleImpl()
15211515

15221516
/**
15231517
* ## Col
@@ -2679,8 +2673,7 @@ public interface ColColumnsSelectionDsl<out _UNUSED> {
26792673
* @param [C] The type of the column.
26802674
*/
26812675
public fun <C> SingleColumn<DataRow<*>>.col(index: Int): SingleColumn<C> =
2682-
this
2683-
.ensureIsColumnGroup()
2676+
this.ensureIsColumnGroup()
26842677
.allColumnsInternal()
26852678
.getAt(index)
26862679
.cast()

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

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,14 @@ public interface ColGroupColumnsSelectionDsl<out _UNUSED> {
345345
* @param [C] The type of the column group.
346346
*/
347347
public fun <C> SingleColumn<DataRow<*>>.colGroup(colGroup: ColumnAccessor<DataRow<C>>): SingleColumn<DataRow<C>> =
348-
this
349-
.ensureIsColumnGroup()
350-
.transformSingle {
351-
val child = it.getCol(colGroup)
352-
?: throw IllegalStateException(
353-
"ColumnGroup '${colGroup.path()}' not found in column group '${it.path}'",
354-
)
355-
child.data.ensureIsColumnGroup()
356-
listOf(child)
357-
}.singleImpl()
348+
this.ensureIsColumnGroup().transformSingle {
349+
val child = it.getCol(colGroup)
350+
?: throw IllegalStateException(
351+
"ColumnGroup '${colGroup.path()}' not found in column group '${it.path}'",
352+
)
353+
child.data.ensureIsColumnGroup()
354+
listOf(child)
355+
}.singleImpl()
358356

359357
/**
360358
* ## Col Group
@@ -842,14 +840,12 @@ public interface ColGroupColumnsSelectionDsl<out _UNUSED> {
842840
* @param [C] The type of the column group.
843841
*/
844842
public fun <C> SingleColumn<DataRow<*>>.colGroup(name: String): SingleColumn<DataRow<C>> =
845-
this
846-
.ensureIsColumnGroup()
847-
.transformSingle {
848-
val child = it.getCol(name)?.cast<DataRow<C>>()
849-
?: throw IllegalStateException("Column group '$name' not found in column group '${it.path}'")
850-
child.data.ensureIsColumnGroup()
851-
listOf(child)
852-
}.singleImpl()
843+
this.ensureIsColumnGroup().transformSingle {
844+
val child = it.getCol(name)?.cast<DataRow<C>>()
845+
?: throw IllegalStateException("Column group '$name' not found in column group '${it.path}'")
846+
child.data.ensureIsColumnGroup()
847+
listOf(child)
848+
}.singleImpl()
853849

854850
/**
855851
* ## Col Group
@@ -1565,8 +1561,7 @@ public interface ColGroupColumnsSelectionDsl<out _UNUSED> {
15651561
* @param [C] The type of the column group.
15661562
*/
15671563
public fun <C> SingleColumn<DataRow<*>>.colGroup(path: ColumnPath): SingleColumn<DataRow<C>> =
1568-
this
1569-
.ensureIsColumnGroup()
1564+
this.ensureIsColumnGroup()
15701565
.transformSingle {
15711566
val child = it.getCol(path)?.cast<DataRow<C>>()
15721567
?: throw IllegalStateException("Column group '$path' not found in column group '${it.path}'")
@@ -3110,8 +3105,7 @@ public interface ColGroupColumnsSelectionDsl<out _UNUSED> {
31103105
* @param [C] The type of the column group.
31113106
*/
31123107
public fun <C> SingleColumn<DataRow<*>>.colGroup(index: Int): SingleColumn<DataRow<C>> =
3113-
this
3114-
.ensureIsColumnGroup()
3108+
this.ensureIsColumnGroup()
31153109
.allColumnsInternal()
31163110
.getAt(index)
31173111
.cast<DataRow<C>>()

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4893,14 +4893,13 @@ public interface ColsColumnsSelectionDsl<out _UNUSED> {
48934893
}
48944894

48954895
internal fun SingleColumn<DataRow<*>>.colsInternal(refs: Iterable<ColumnReference<*>>): ColumnSet<*> =
4896-
ensureIsColumnGroup()
4897-
.transformSingle { col ->
4898-
refs.map {
4899-
col.getCol(it) ?: throw IllegalArgumentException(
4900-
"Column at ${col.path.plus(it.path()).joinToString()} was not found.",
4901-
)
4902-
}
4896+
ensureIsColumnGroup().transformSingle { col ->
4897+
refs.map {
4898+
col.getCol(it) ?: throw IllegalArgumentException(
4899+
"Column at ${col.path.plus(it.path()).joinToString()} was not found.",
4900+
)
49034901
}
4902+
}
49044903

49054904
/**
49064905
* If this [ColumnsResolver] is a [SingleColumn], it

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ public interface ColsOfKindColumnsSelectionDsl {
397397
internal fun ColumnsResolver<*>.columnsOfKindInternal(
398398
kinds: Set<ColumnKind>,
399399
filter: ColumnFilter<*>,
400-
): TransformableColumnSet<*> =
401-
colsInternal {
402-
it.kind() in kinds && filter(it)
403-
}
400+
): TransformableColumnSet<*> = colsInternal { it.kind() in kinds && filter(it) }
404401

405402
// endregion

0 commit comments

Comments
 (0)