From 2dd54c615d1a67406fce54b59efcf86fcdabf482 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Fri, 28 Jun 2024 20:45:51 +0200 Subject: [PATCH] fixup! updating generated-sources --- core/build.gradle.kts | 7 + .../kotlinx/dataframe/api/DataRowApi.kt | 29 +- .../kotlinx/dataframe/api/JsonPath.kt | 15 +- .../kotlinx/dataframe/api/aggregate.kt | 4 +- .../kotlinx/dataframe/api/allExcept.kt | 17 +- .../jetbrains/kotlinx/dataframe/api/append.kt | 18 +- .../jetbrains/kotlinx/dataframe/api/col.kt | 39 +- .../kotlinx/dataframe/api/colGroup.kt | 38 +- .../jetbrains/kotlinx/dataframe/api/cols.kt | 13 +- .../kotlinx/dataframe/api/colsOfKind.kt | 5 +- .../kotlinx/dataframe/api/constructors.kt | 53 +- .../kotlinx/dataframe/api/convert.kt | 8 +- .../kotlinx/dataframe/api/digitize.kt | 5 +- .../jetbrains/kotlinx/dataframe/api/filter.kt | 9 +- .../kotlinx/dataframe/api/frameCol.kt | 46 +- .../jetbrains/kotlinx/dataframe/api/into.kt | 3 +- .../jetbrains/kotlinx/dataframe/api/merge.kt | 3 +- .../jetbrains/kotlinx/dataframe/api/move.kt | 2 +- .../jetbrains/kotlinx/dataframe/api/rename.kt | 12 +- .../jetbrains/kotlinx/dataframe/api/select.kt | 3 +- .../jetbrains/kotlinx/dataframe/api/sort.kt | 32 +- .../jetbrains/kotlinx/dataframe/api/split.kt | 3 +- .../jetbrains/kotlinx/dataframe/api/std.kt | 10 +- .../kotlinx/dataframe/api/valueCol.kt | 49 +- .../dataframe/codeGen/DefaultReadDfMethods.kt | 31 +- .../kotlinx/dataframe/codeGen/Marker.kt | 6 +- .../kotlinx/dataframe/codeGen/generateCode.kt | 17 +- .../kotlinx/dataframe/columns/SingleColumn.kt | 4 +- .../kotlinx/dataframe/dataTypes/IFRAME.kt | 8 +- .../kotlinx/dataframe/impl/DataFrameImpl.kt | 3 +- .../kotlinx/dataframe/impl/DataRowImpl.kt | 8 +- .../kotlinx/dataframe/impl/GroupByImpl.kt | 39 +- .../kotlinx/dataframe/impl/TypeUtils.kt | 54 +- .../jetbrains/kotlinx/dataframe/impl/Utils.kt | 5 +- .../impl/aggregation/GroupByReceiverImpl.kt | 4 +- .../impl/aggregation/PivotGroupByImpl.kt | 13 +- .../dataframe/impl/aggregation/PivotImpl.kt | 1 - .../impl/aggregation/aggregations.kt | 10 +- .../dataframe/impl/aggregation/getColumns.kt | 4 +- .../kotlinx/dataframe/impl/api/convert.kt | 20 +- .../kotlinx/dataframe/impl/api/convertTo.kt | 271 +++++---- .../kotlinx/dataframe/impl/api/corr.kt | 10 +- .../kotlinx/dataframe/impl/api/describe.kt | 27 +- .../kotlinx/dataframe/impl/api/duplicate.kt | 47 +- .../kotlinx/dataframe/impl/api/explode.kt | 26 +- .../kotlinx/dataframe/impl/api/flatten.kt | 3 +- .../kotlinx/dataframe/impl/api/format.kt | 3 +- .../kotlinx/dataframe/impl/api/implode.kt | 35 +- .../kotlinx/dataframe/impl/api/insert.kt | 61 +- .../kotlinx/dataframe/impl/api/join.kt | 10 +- .../kotlinx/dataframe/impl/api/joinWith.kt | 7 +- .../kotlinx/dataframe/impl/api/move.kt | 15 +- .../kotlinx/dataframe/impl/api/parse.kt | 3 +- .../kotlinx/dataframe/impl/api/pivot.kt | 4 +- .../kotlinx/dataframe/impl/api/remove.kt | 14 +- .../kotlinx/dataframe/impl/api/rename.kt | 3 +- .../kotlinx/dataframe/impl/api/reorder.kt | 3 +- .../kotlinx/dataframe/impl/api/sort.kt | 17 +- .../kotlinx/dataframe/impl/api/toDataFrame.kt | 8 +- .../kotlinx/dataframe/impl/api/update.kt | 9 +- .../kotlinx/dataframe/impl/api/xs.kt | 11 +- .../impl/codeGen/CodeGeneratorImpl.kt | 69 +-- .../impl/codeGen/SchemaProcessorImpl.kt | 3 +- .../dataframe/impl/columns/AtAnyDepth.kt | 3 +- .../impl/columns/ColumnAccessorImpl.kt | 22 +- .../impl/columns/ColumnGroupWithPathImpl.kt | 6 +- .../impl/columns/ComputedColumnReference.kt | 5 +- .../kotlinx/dataframe/impl/columns/Utils.kt | 27 +- .../dataframe/impl/columns/constructors.kt | 30 +- .../dataframe/impl/columns/tree/Utils.kt | 3 +- .../kotlinx/dataframe/impl/io/readJson.kt | 7 +- .../kotlinx/dataframe/impl/io/writeJson.kt | 32 +- .../kotlinx/dataframe/impl/schema/Utils.kt | 14 +- .../jetbrains/kotlinx/dataframe/io/common.kt | 19 +- .../org/jetbrains/kotlinx/dataframe/io/csv.kt | 24 +- .../jetbrains/kotlinx/dataframe/io/html.kt | 24 +- .../jetbrains/kotlinx/dataframe/io/json.kt | 11 +- .../jetbrains/kotlinx/dataframe/io/string.kt | 3 +- .../kotlinx/dataframe/jupyter/CellRenderer.kt | 8 +- .../jupyter/KotlinNotebookPluginUtils.kt | 7 +- .../dataframe/api/ColumnsSelectionDsl.kt | 3 +- .../kotlinx/dataframe/api/colsAtAnyDepth.kt | 29 +- .../kotlinx/dataframe/api/convertTo.kt | 9 +- .../kotlinx/dataframe/api/distinct.kt | 46 +- .../kotlinx/dataframe/api/explode.kt | 12 +- .../kotlinx/dataframe/api/flatten.kt | 18 +- .../jetbrains/kotlinx/dataframe/api/gather.kt | 7 +- .../jetbrains/kotlinx/dataframe/api/get.kt | 7 +- .../kotlinx/dataframe/api/groupBy.kt | 18 +- .../jetbrains/kotlinx/dataframe/api/move.kt | 7 +- .../jetbrains/kotlinx/dataframe/api/pivot.kt | 7 +- .../jetbrains/kotlinx/dataframe/api/rename.kt | 13 +- .../jetbrains/kotlinx/dataframe/api/split.kt | 22 +- .../jetbrains/kotlinx/dataframe/api/toList.kt | 4 +- .../dataframe/codeGen/CodeGenerationTests.kt | 38 +- .../dataframe/codeGen/NameGenerationTests.kt | 19 +- .../explainer/PluginCallbackProxy.kt | 35 +- .../kotlinx/dataframe/io/CsvTests.kt | 3 +- .../kotlinx/dataframe/io/ParserTests.kt | 36 +- .../kotlinx/dataframe/io/PlaylistJsonTest.kt | 35 +- .../jetbrains/kotlinx/dataframe/io/json.kt | 209 +++---- .../dataframe/jupyter/RenderingTests.kt | 6 +- .../dataframe/jupyter/SampleNotebooksTests.kt | 14 +- .../dataframe/puzzles/CleaningDataTests.kt | 64 +-- .../kotlinx/dataframe/puzzles/DateTests.kt | 32 +- .../kotlinx/dataframe/puzzles/HardTests.kt | 38 +- .../kotlinx/dataframe/puzzles/MediumTests.kt | 14 +- .../dataframe/rendering/RenderingTests.kt | 15 +- .../kotlinx/dataframe/samples/api/JoinWith.kt | 77 ++- .../kotlinx/dataframe/samples/api/TestBase.kt | 20 +- .../testSets/animals/AnimalsTests.kt | 6 +- .../testSets/person/DataFrameTests.kt | 539 ++++++------------ .../testSets/person/DataFrameTreeTests.kt | 98 +--- .../dataframe/testSets/person/DataRowTests.kt | 40 +- .../testSets/person/FormattingTests.kt | 7 +- .../dataframe/testSets/person/PivotTests.kt | 102 ++-- .../dataframe/testSets/person2/merge.kt | 6 +- .../kotlinx/dataframe/impl/api/remove.kt | 7 +- .../testSets/person/DataFrameTreeTests.kt | 10 +- .../dataframe/testSets/person/PivotTests.kt | 9 +- .../dataframe/testSets/person2/merge.kt | 4 +- 121 files changed, 1328 insertions(+), 1911 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 4b88e3c65..3deb7bb46 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -216,6 +216,13 @@ val processKDocsMain by creatingProcessDocTask(processKDocsMainSources) { } } +tasks.named("ktlintGeneratedSourcesSourceSetCheck") { + onlyIf { false } +} +tasks.named("runKtlintCheckOverGeneratedSourcesSourceSet") { + onlyIf { false } +} + // Exclude the generated/processed sources from the IDE idea { module { diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/DataRowApi.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/DataRowApi.kt index 6989e315f..568abfe0b 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/DataRowApi.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/DataRowApi.kt @@ -104,12 +104,8 @@ internal interface DiffOrNullDocs @OptIn(ExperimentalTypeInference::class) @OverloadResolutionByLambdaReturnType public fun DataRow.diff(firstRowResult: Double, expression: RowExpression): Double = - prev()?.let { p -> - expression( - this, - this, - ) - expression(p, p) - } ?: firstRowResult + prev()?.let { p -> expression(this, this) - expression(p, p) } + ?: firstRowResult /** * Calculates the difference between the results of a row expression computed on the current and previous DataRow. @@ -120,12 +116,8 @@ public fun DataRow.diff(firstRowResult: Double, expression: RowExpression @OverloadResolutionByLambdaReturnType // required to resolve `diff(0) { intValue }` public fun DataRow.diff(firstRowResult: Int, expression: RowExpression): Int = - prev()?.let { p -> - expression( - this, - this, - ) - expression(p, p) - } ?: firstRowResult + prev()?.let { p -> expression(this, this) - expression(p, p) } + ?: firstRowResult /** * Calculates the difference between the results of a row expression computed on the current and previous DataRow. @@ -133,7 +125,8 @@ public fun DataRow.diff(firstRowResult: Int, expression: RowExpression DataRow.diff(firstRowResult: Long, expression: RowExpression): Long = - prev()?.let { p -> expression(this, this) - expression(p, p) } ?: firstRowResult + prev()?.let { p -> expression(this, this) - expression(p, p) } + ?: firstRowResult /** * Calculates the difference between the results of a row expression computed on the current and previous DataRow. @@ -141,7 +134,8 @@ public fun DataRow.diff(firstRowResult: Long, expression: RowExpression DataRow.diff(firstRowResult: Float, expression: RowExpression): Float = - prev()?.let { p -> expression(this, this) - expression(p, p) } ?: firstRowResult + prev()?.let { p -> expression(this, this) - expression(p, p) } + ?: firstRowResult /** * Calculates the difference between the results of a row expression computed on the current and previous DataRow. @@ -151,12 +145,7 @@ public fun DataRow.diff(firstRowResult: Float, expression: RowExpression< @OptIn(ExperimentalTypeInference::class) @OverloadResolutionByLambdaReturnType public fun DataRow.diffOrNull(expression: RowExpression): Double? = - prev()?.let { p -> - expression( - this, - this, - ) - expression(p, p) - } + prev()?.let { p -> expression(this, this) - expression(p, p) } /** * Calculates the difference between the results of a row expression computed on the current and previous DataRow. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/JsonPath.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/JsonPath.kt index b5c89ef92..0150eb2bc 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/JsonPath.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/JsonPath.kt @@ -29,14 +29,13 @@ public value class JsonPath( JsonPath( path.toCharArray().let { chars -> val lastStarIndex = chars.lastIndexOf('*') - chars - .flatMapIndexed { i, c -> - if (i == lastStarIndex) { - index.toString().toCharArray().toList() - } else { - listOf(c) - } - }.joinToString("") + chars.flatMapIndexed { i, c -> + if (i == lastStarIndex) { + index.toString().toCharArray().toList() + } else { + listOf(c) + } + }.joinToString("") }, ) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/aggregate.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/aggregate.kt index 3f84a6cb8..0c592a431 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/aggregate.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/aggregate.kt @@ -21,6 +21,4 @@ public fun Pivot.aggregate(separate: Boolean = false, body: Selector Grouped.aggregate(body: AggregateGroupedBody): DataFrame = - aggregateGroupBy((this as GroupBy<*, *>).toDataFrame(), { - groups.cast() - }, removeColumns = true, body).cast() + aggregateGroupBy((this as GroupBy<*, *>).toDataFrame(), { groups.cast() }, removeColumns = true, body).cast() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index f0050f0bb..582be9bdf 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -4663,17 +4663,16 @@ internal fun SingleColumn>.allColsExceptInternal(other: ColumnsResolv internal fun SingleColumn>.exceptExperimentalInternal( other: ColumnsResolver<*>, ): SingleColumn> = - ensureIsColumnGroup() - .transformSingle { singleCol -> - val columnsToExcept = singleCol - .asColumnGroup() - .getColumnsWithPaths { other } - .map { it.changePath(singleCol.path + it.path) } + ensureIsColumnGroup().transformSingle { singleCol -> + val columnsToExcept = singleCol + .asColumnGroup() + .getColumnsWithPaths { other } + .map { it.changePath(singleCol.path + it.path) } - val newCols = listOf(singleCol).allColumnsExceptKeepingStructure(columnsToExcept) + val newCols = listOf(singleCol).allColumnsExceptKeepingStructure(columnsToExcept) - newCols as List>> - }.singleInternal() as SingleColumn> + newCols as List>> + }.singleInternal() as SingleColumn> /** * Functions annotated with this annotation are experimental and will be removed or renamed in the future. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/append.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/append.kt index d342b8947..6825337f6 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/append.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/append.kt @@ -14,23 +14,19 @@ public fun DataFrame.append(vararg values: Any?): DataFrame { "Invalid number of arguments. Multiple of $ncol is expected, but actual was: ${values.size}" } val newRows = values.size / ncol - return columns() - .mapIndexed { colIndex, col -> - val newValues = (0 until newRows).map { values[colIndex + it * ncol] } - col.updateWith(col.values + newValues) - }.toDataFrame() - .cast() + return columns().mapIndexed { colIndex, col -> + val newValues = (0 until newRows).map { values[colIndex + it * ncol] } + col.updateWith(col.values + newValues) + }.toDataFrame().cast() } public fun DataFrame.appendNulls(numberOfRows: Int = 1): DataFrame { require(numberOfRows >= 0) if (numberOfRows == 0) return this if (ncol == 0) return DataFrame.empty(nrow + numberOfRows).cast() - return columns() - .map { col -> - col.updateWith(col.values + arrayOfNulls(numberOfRows)) - }.toDataFrame() - .cast() + return columns().map { col -> + col.updateWith(col.values + arrayOfNulls(numberOfRows)) + }.toDataFrame().cast() } // endregion diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt index 02dae7011..813aa781c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt @@ -338,13 +338,11 @@ public interface ColColumnsSelectionDsl { * @param [C] The type of the column. */ public fun SingleColumn>.col(col: ColumnAccessor): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(col) - ?: throw IllegalStateException("Column '${col.path()}' not found in column group '${it.path}'") - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(col) + ?: throw IllegalStateException("Column '${col.path()}' not found in column group '${it.path}'") + listOf(child) + }.singleImpl() /** * ## Col @@ -814,13 +812,11 @@ public interface ColColumnsSelectionDsl { * @param [C] The type of the column. */ public fun SingleColumn>.col(name: String): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(name)?.cast() - ?: throw IllegalStateException("Column '$name' not found in column group '${it.path}'") - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(name)?.cast() + ?: throw IllegalStateException("Column '$name' not found in column group '${it.path}'") + listOf(child) + }.singleImpl() /** * ## Col @@ -1511,13 +1507,11 @@ public interface ColColumnsSelectionDsl { * @param [C] The type of the column. */ public fun SingleColumn>.col(path: ColumnPath): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(path)?.cast() - ?: throw IllegalStateException("Column '$path' not found in column group '${it.path}'") - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(path)?.cast() + ?: throw IllegalStateException("Column '$path' not found in column group '${it.path}'") + listOf(child) + }.singleImpl() /** * ## Col @@ -2679,8 +2673,7 @@ public interface ColColumnsSelectionDsl { * @param [C] The type of the column. */ public fun SingleColumn>.col(index: Int): SingleColumn = - this - .ensureIsColumnGroup() + this.ensureIsColumnGroup() .allColumnsInternal() .getAt(index) .cast() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt index bda2b6a19..da08ed0b4 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt @@ -345,16 +345,14 @@ public interface ColGroupColumnsSelectionDsl { * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(colGroup: ColumnAccessor>): SingleColumn> = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(colGroup) - ?: throw IllegalStateException( - "ColumnGroup '${colGroup.path()}' not found in column group '${it.path}'", - ) - child.data.ensureIsColumnGroup() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(colGroup) + ?: throw IllegalStateException( + "ColumnGroup '${colGroup.path()}' not found in column group '${it.path}'", + ) + child.data.ensureIsColumnGroup() + listOf(child) + }.singleImpl() /** * ## Col Group @@ -842,14 +840,12 @@ public interface ColGroupColumnsSelectionDsl { * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(name: String): SingleColumn> = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(name)?.cast>() - ?: throw IllegalStateException("Column group '$name' not found in column group '${it.path}'") - child.data.ensureIsColumnGroup() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(name)?.cast>() + ?: throw IllegalStateException("Column group '$name' not found in column group '${it.path}'") + child.data.ensureIsColumnGroup() + listOf(child) + }.singleImpl() /** * ## Col Group @@ -1565,8 +1561,7 @@ public interface ColGroupColumnsSelectionDsl { * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(path: ColumnPath): SingleColumn> = - this - .ensureIsColumnGroup() + this.ensureIsColumnGroup() .transformSingle { val child = it.getCol(path)?.cast>() ?: throw IllegalStateException("Column group '$path' not found in column group '${it.path}'") @@ -3110,8 +3105,7 @@ public interface ColGroupColumnsSelectionDsl { * @param [C] The type of the column group. */ public fun SingleColumn>.colGroup(index: Int): SingleColumn> = - this - .ensureIsColumnGroup() + this.ensureIsColumnGroup() .allColumnsInternal() .getAt(index) .cast>() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt index 064b30b66..ddf58b840 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt @@ -4893,14 +4893,13 @@ public interface ColsColumnsSelectionDsl { } internal fun SingleColumn>.colsInternal(refs: Iterable>): ColumnSet<*> = - ensureIsColumnGroup() - .transformSingle { col -> - refs.map { - col.getCol(it) ?: throw IllegalArgumentException( - "Column at ${col.path.plus(it.path()).joinToString()} was not found.", - ) - } + ensureIsColumnGroup().transformSingle { col -> + refs.map { + col.getCol(it) ?: throw IllegalArgumentException( + "Column at ${col.path.plus(it.path()).joinToString()} was not found.", + ) } + } /** * If this [ColumnsResolver] is a [SingleColumn], it diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt index 0f409276a..6a103d9c2 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsOfKind.kt @@ -397,9 +397,6 @@ public interface ColsOfKindColumnsSelectionDsl { internal fun ColumnsResolver<*>.columnsOfKindInternal( kinds: Set, filter: ColumnFilter<*>, -): TransformableColumnSet<*> = - colsInternal { - it.kind() in kinds && filter(it) - } +): TransformableColumnSet<*> = colsInternal { it.kind() in kinds && filter(it) } // endregion diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/constructors.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/constructors.kt index 68a3bfade..497959e7c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/constructors.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/constructors.kt @@ -227,19 +227,18 @@ public fun columnOf(vararg values: AnyBaseCol): DataColumn = columnOf(va public fun columnOf(vararg frames: DataFrame): FrameColumn = columnOf(frames.asIterable()).forceResolve() public fun columnOf(columns: Iterable): DataColumn = - DataColumn - .createColumnGroup( - name = "", - df = dataFrameOf(columns), - ).asDataColumn() + DataColumn.createColumnGroup( + name = "", + df = dataFrameOf(columns), + ) + .asDataColumn() .forceResolve() public fun columnOf(frames: Iterable>): FrameColumn = - DataColumn - .createFrameColumn( - name = "", - groups = frames.toList(), - ).forceResolve() + DataColumn.createFrameColumn( + name = "", + groups = frames.toList(), + ).forceResolve() public inline fun column(values: Iterable): DataColumn = createColumn(values, typeOf(), false).forceResolve() @@ -283,15 +282,11 @@ public fun dataFrameOf(header: Iterable, values: Iterable): AnyFra dataFrameOf(header).withValues(values) public inline fun dataFrameOf(header: Iterable, fill: (T) -> Iterable): AnyFrame = - header - .map { value -> - fill(value).asList().let { - DataColumn.create( - value.toString(), - it, - ) - } - }.toDataFrame() + header.map { value -> + fill(value).asList().let { + DataColumn.create(value.toString(), it) + } + }.toDataFrame() public fun dataFrameOf(header: CharProgression): DataFrameBuilder = dataFrameOf(header.map { it.toString() }) @@ -302,10 +297,9 @@ public class DataFrameBuilder(private val header: List) { public operator fun invoke(columns: Iterable): AnyFrame { val cols = columns.asList() require(cols.size == header.size) { "Number of columns differs from number of column names" } - return cols - .mapIndexed { i, col -> - col.rename(header[i]) - }.toDataFrame() + return cols.mapIndexed { i, col -> + col.rename(header[i]) + }.toDataFrame() } public operator fun invoke(vararg values: Any?): AnyFrame = withValues(values.asIterable()) @@ -322,13 +316,12 @@ public class DataFrameBuilder(private val header: List) { val nrow = list.size / ncol - return (0 until ncol) - .map { col -> - val colValues = (0 until nrow).map { row -> - list[row * ncol + col] - } - DataColumn.createWithTypeInference(header[col], colValues) - }.toDataFrame() + return (0 until ncol).map { col -> + val colValues = (0 until nrow).map { row -> + list[row * ncol + col] + } + DataColumn.createWithTypeInference(header[col], colValues) + }.toDataFrame() } public operator fun invoke(args: Sequence): AnyFrame = invoke(*args.toList().toTypedArray()) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt index d0c9a5b8e..f60cbb2be 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt @@ -120,11 +120,9 @@ public inline fun Convert.perRowCol( public inline fun AnyCol.convertTo(): DataColumn = convertTo(typeOf()) as DataColumn public fun AnyCol.convertTo(newType: KType): AnyCol { - val isTypesAreCorrect = this - .type() - .withNullability(true) - .isSubtypeOf(typeOf()) && - newType.withNullability(true) == typeOf() + val isTypesAreCorrect = + this.type().withNullability(true).isSubtypeOf(typeOf()) && + newType.withNullability(true) == typeOf() if (isTypesAreCorrect) { return (this as DataColumn).convertToDouble().setNullable(newType.isMarkedNullable) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/digitize.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/digitize.kt index c4daf65d0..da118b323 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/digitize.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/digitize.kt @@ -17,10 +17,7 @@ public fun > DataColumn.digitize( right: Boolean = false, ): DataColumn = digitize( - bins = bins.toList().map { - org.jetbrains.kotlinx.dataframe.impl - .convert(it, kclass) - }, + bins = bins.toList().map { org.jetbrains.kotlinx.dataframe.impl.convert(it, kclass) }, right = right, ) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt index e10a657c0..06c410ee0 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/filter.kt @@ -30,11 +30,10 @@ public fun DataColumn.filter(predicate: Predicate): DataColumn = // region DataFrame public fun DataFrame.filter(predicate: RowFilter): DataFrame = - indices - .filter { - val row = get(it) - predicate(row, row) - }.let { get(it) } + indices.filter { + val row = get(it) + predicate(row, row) + }.let { get(it) } public fun DataFrame.filterBy(column: ColumnSelector): DataFrame = getRows(getColumn(column).toList().getTrueIndices()) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt index d99f7c1c1..1536ac368 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt @@ -347,16 +347,14 @@ public interface FrameColColumnsSelectionDsl { public fun SingleColumn>.frameCol( frameCol: ColumnAccessor>, ): SingleColumn> = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(frameCol) - ?: throw IllegalStateException( - "FrameColumn '${frameCol.path()}' not found in column group '${it.path}'", - ) - child.data.ensureIsFrameColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(frameCol) + ?: throw IllegalStateException( + "FrameColumn '${frameCol.path()}' not found in column group '${it.path}'", + ) + child.data.ensureIsFrameColumn() + listOf(child) + }.singleImpl() /** * ## Frame Col @@ -845,14 +843,12 @@ public interface FrameColColumnsSelectionDsl { * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(name: String): SingleColumn> = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(name)?.cast>() - ?: throw IllegalStateException("Frame column '$name' not found in column group '${it.path}'") - child.data.ensureIsFrameColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(name)?.cast>() + ?: throw IllegalStateException("Frame column '$name' not found in column group '${it.path}'") + child.data.ensureIsFrameColumn() + listOf(child) + }.singleImpl() /** * ## Frame Col @@ -1568,14 +1564,12 @@ public interface FrameColColumnsSelectionDsl { * @param [C] The type of the frame column. */ public fun SingleColumn>.frameCol(path: ColumnPath): SingleColumn> = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(path)?.cast>() - ?: throw IllegalStateException("Frame column '$path' not found in column group '${it.path}'") - child.data.ensureIsFrameColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(path)?.cast>() + ?: throw IllegalStateException("Frame column '$path' not found in column group '${it.path}'") + child.data.ensureIsFrameColumn() + listOf(child) + }.singleImpl() /** * ## Frame Col diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/into.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/into.kt index f0ed8fa52..7026b72e4 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/into.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/into.kt @@ -75,8 +75,7 @@ public fun ReducedGroupBy.into(column: ColumnAccessor): Dat public fun ReducedGroupBy.into(column: KProperty): DataFrame = into(column) { this } public fun ReducedGroupBy.concat(): DataFrame = - groupBy.groups - .values() + groupBy.groups.values() .map { reducer(it, it) } .concat() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/merge.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/merge.kt index 8475e990f..1dd19d24c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/merge.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/merge.kt @@ -73,8 +73,7 @@ public fun Merge.into(path: ColumnPath): DataFrame { res = res .removeImpl(allowMissingColumns = true) { path } .df - .move(mergePath) - .into { path } + .move(mergePath).into { path } } return res } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/move.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/move.kt index 530d48f21..7bd545d2a 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/move.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/move.kt @@ -111,7 +111,7 @@ public fun MoveClause.under( ): DataFrame = moveImpl( under = true, - column, + newPathExpression = column, ) // endregion diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt index 5d8c0f16c..0904549ce 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt @@ -46,11 +46,10 @@ public data class RenameClause(val df: DataFrame, val columns: ColumnsS * Even [DataFrames][DataFrame] inside [FrameColumns][FrameColumn] are traversed recursively. */ public fun DataFrame.renameToCamelCase(): DataFrame = - this - // recursively rename all columns written with delimiters or starting with a capital to camel case - .rename { - colsAtAnyDepth { it.name() matches DELIMITED_STRING_REGEX || it.name[0].isUpperCase() } - }.toCamelCase() + // recursively rename all columns written with delimiters or starting with a capital to camel case + rename { + colsAtAnyDepth { it.name() matches DELIMITED_STRING_REGEX || it.name[0].isUpperCase() } + }.toCamelCase() // take all frame columns at any depth and call renameToCamelCase() on all dataframes inside .update { colsAtAnyDepth().colsOf() @@ -77,8 +76,7 @@ public fun RenameClause.into(transform: (ColumnWithPath) -> Stri */ public fun RenameClause.toCamelCase(): DataFrame = into { - it - .name() + it.name() .toCamelCaseByDelimiters(DELIMITERS_REGEX) .replaceFirstChar { it.lowercaseChar() } } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index b162d24c3..a630a739c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -560,8 +560,7 @@ internal fun SingleColumn>.selectInternal(selector: ColumnsSel "Column ${col.path} is not a ColumnGroup and can thus not be selected from." } - col - .asColumnGroup() + col.asColumnGroup() .getColumnsWithPaths(selector as ColumnsSelector<*, R>) .map { it.changePath(col.path + it.path) } } ?: emptyList() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt index 9a365741d..8169368c1 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/sort.kt @@ -211,29 +211,26 @@ private fun GroupBy.createColumnFromGroupExpression( receiver: ColumnsSelectionDsl, expression: DataFrameExpression, ): DataColumn = - receiver - .newColumnWithActualType("") { row -> - val group = row[groups] - expression(group, group) - } + receiver.newColumnWithActualType("") { row -> + val group = row[groups] + expression(group, group) + } public fun GroupBy.sortByGroup( nullsLast: Boolean = false, expression: DataFrameExpression, ): GroupBy = - toDataFrame() - .sortBy { - createColumnFromGroupExpression(this, expression).nullsLast(nullsLast) - }.asGroupBy(groups) + toDataFrame().sortBy { + createColumnFromGroupExpression(this, expression).nullsLast(nullsLast) + }.asGroupBy(groups) public fun GroupBy.sortByGroupDesc( nullsLast: Boolean = false, expression: DataFrameExpression, ): GroupBy = - toDataFrame() - .sortBy { - createColumnFromGroupExpression(this, expression).desc().nullsLast(nullsLast) - }.asGroupBy(groups) + toDataFrame().sortBy { + createColumnFromGroupExpression(this, expression).desc().nullsLast(nullsLast) + }.asGroupBy(groups) public fun GroupBy.sortByCountAsc(): GroupBy = sortByGroup { nrow } @@ -241,13 +238,8 @@ public fun GroupBy.sortByCount(): GroupBy = sortByGroupDesc { public fun GroupBy.sortByKeyDesc(nullsLast: Boolean = false): GroupBy = toDataFrame() - .sortBy { - keys - .columns() - .toColumnSet() - .desc() - .nullsLast(nullsLast) - }.asGroupBy(groups) + .sortBy { keys.columns().toColumnSet().desc().nullsLast(nullsLast) } + .asGroupBy(groups) public fun GroupBy.sortByKey(nullsLast: Boolean = false): GroupBy = toDataFrame() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/split.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/split.kt index 6005a9b62..aea9b261c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/split.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/split.kt @@ -114,8 +114,7 @@ public fun Split.match(regex: String): SplitWithTransform public fun Split.match(regex: Regex): SplitWithTransform = by { it?.let { - regex - .matchEntire(it) + regex.matchEntire(it) ?.groups ?.drop(1) ?.map { it?.value } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/std.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/std.kt index 8eb3f9f6a..af6a07ca7 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/std.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/std.kt @@ -40,10 +40,12 @@ public fun AnyRow.rowStd(skipNA: Boolean = skipNA_default, ddof: Int = ddof_defa values().filterIsInstance().map { it.toDouble() }.std(skipNA, ddof) public inline fun AnyRow.rowStdOf(ddof: Int = ddof_default): Double = - values().filterIsInstance().std( - type = typeOf(), - ddof = ddof, - ) + values() + .filterIsInstance() + .std( + type = typeOf(), + ddof = ddof, + ) // endregion diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt index 6eaa1c708..82a2abf91 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt @@ -345,16 +345,14 @@ public interface ValueColColumnsSelectionDsl { * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(valueCol: ColumnAccessor): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(valueCol) - ?: throw IllegalStateException( - "ValueColumn '${valueCol.path()}' not found in column group '${it.path}'", - ) - child.data.ensureIsValueColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(valueCol) + ?: throw IllegalStateException( + "ValueColumn '${valueCol.path()}' not found in column group '${it.path}'", + ) + child.data.ensureIsValueColumn() + listOf(child) + }.singleImpl() /** * ## Value Col @@ -842,14 +840,12 @@ public interface ValueColColumnsSelectionDsl { * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(name: String): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(name)?.cast() - ?: throw IllegalStateException("Value column '$name' not found in column group '${it.path}'") - child.data.ensureIsValueColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(name)?.cast() + ?: throw IllegalStateException("Value column '$name' not found in column group '${it.path}'") + child.data.ensureIsValueColumn() + listOf(child) + }.singleImpl() /** * ## Value Col @@ -1565,14 +1561,12 @@ public interface ValueColColumnsSelectionDsl { * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(path: ColumnPath): SingleColumn = - this - .ensureIsColumnGroup() - .transformSingle { - val child = it.getCol(path)?.cast() - ?: throw IllegalStateException("Value column '$path' not found in column group '${it.path}'") - child.data.ensureIsValueColumn() - listOf(child) - }.singleImpl() + this.ensureIsColumnGroup().transformSingle { + val child = it.getCol(path)?.cast() + ?: throw IllegalStateException("Value column '$path' not found in column group '${it.path}'") + child.data.ensureIsValueColumn() + listOf(child) + }.singleImpl() /** * ## Value Col @@ -2720,8 +2714,7 @@ public interface ValueColColumnsSelectionDsl { * @param [C] The type of the value column. */ public fun SingleColumn>.valueCol(index: Int): SingleColumn = - this - .ensureIsColumnGroup() + this.ensureIsColumnGroup() .allColumnsInternal() .getAt(index) .ensureIsValueColumn() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/DefaultReadDfMethods.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/DefaultReadDfMethods.kt index c9b2729b5..6ecb10a3c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/DefaultReadDfMethods.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/DefaultReadDfMethods.kt @@ -33,15 +33,13 @@ public abstract class AbstractDefaultReadMethod( ) : DefaultReadDfMethod { override fun toDeclaration(marker: Marker, visibility: String): String { val parameters = arguments.defaultValues.map { - ParameterSpec - .builder(it.name, it.property.type) + ParameterSpec.builder(it.name, it.property.type) .defaultValue("%N", it.property) .build() } val defaultPath = path?.let { - PropertySpec - .builder("defaultPath", typeNameOf(), KModifier.CONST) + PropertySpec.builder("defaultPath", typeNameOf(), KModifier.CONST) .initializer("%S", path) .build() } @@ -50,32 +48,27 @@ public abstract class AbstractDefaultReadMethod( val arguments = parameters.joinToString(", ") { "${it.name} = ${it.name}" } - val typeSpec = TypeSpec - .companionObjectBuilder() - .apply { - if (defaultPath != null) { - addProperty(defaultPath) - } - }.addProperties(this.arguments.defaultValues.map { it.property }) + val typeSpec = TypeSpec.companionObjectBuilder() + .apply { if (defaultPath != null) addProperty(defaultPath) } + .addProperties(this.arguments.defaultValues.map { it.property }) .addFunction( - FunSpec - .builder(methodName) + FunSpec.builder(methodName) .returns(type) .addParameter( - ParameterSpec - .builder("path", typeNameOf()) + ParameterSpec.builder("path", typeNameOf()) .apply { if (defaultPath != null) { defaultValue("%N", defaultPath) } }.build(), - ).addParameters(parameters) + ) + .addParameters(parameters) .addParameter( - ParameterSpec - .builder("verify", typeNameOf()) + ParameterSpec.builder("verify", typeNameOf()) .defaultValue("null") .build(), - ).addCode( + ) + .addCode( """ val df = DataFrame.$methodName(path, $arguments) return if ($VERIFY != null) df.$CAST($VERIFY = $VERIFY) else df.$CAST() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/Marker.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/Marker.kt index 157822342..d52bd6305 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/Marker.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/Marker.kt @@ -88,11 +88,7 @@ public open class Marker( public val columnNames: List get() = allFields.map { it.columnName } public val schema: DataFrameSchema by lazy { - DataFrameSchemaImpl( - allFields.associate { - it.columnName to it.columnSchema - }, - ) + DataFrameSchemaImpl(allFields.associate { it.columnName to it.columnSchema }) } public fun implements(schema: Marker): Boolean = diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/generateCode.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/generateCode.kt index 0efb80ee8..50aa2fa4e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/generateCode.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/generateCode.kt @@ -23,15 +23,14 @@ public fun DataFrame.generateCode( visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC, ): String { val codeGen = CodeGenerator.create() - return codeGen - .generate( - schema = schema(), - name = markerName, - fields = fields, - extensionProperties = extensionProperties, - isOpen = true, - visibility = visibility, - ).code.declarations + return codeGen.generate( + schema = schema(), + name = markerName, + fields = fields, + extensionProperties = extensionProperties, + isOpen = true, + visibility = visibility, + ).code.declarations } public inline fun DataFrame.generateInterfaces(): String = diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/SingleColumn.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/SingleColumn.kt index 333333d81..e8d0e048b 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/SingleColumn.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/SingleColumn.kt @@ -17,7 +17,9 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn public interface SingleColumn : ColumnsResolver { override fun resolve(context: ColumnResolutionContext): List> = - resolveSingle(context)?.let { listOf(it) } ?: emptyList() + resolveSingle(context) + ?.let { listOf(it) } + ?: emptyList() public fun resolveSingle(context: ColumnResolutionContext): ColumnWithPath? } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/dataTypes/IFRAME.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/dataTypes/IFRAME.kt index edf89577c..547544576 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/dataTypes/IFRAME.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/dataTypes/IFRAME.kt @@ -16,7 +16,9 @@ public data class IFRAME( ) : this(src.toString(), border, width, height) override fun toString(): String = - """