Skip to content

Commit b2bcd02

Browse files
committed
replaced all documentation interfaces by (nested) type-aliases
1 parent bfc99a2 commit b2bcd02

Some content is hidden

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

87 files changed

+767
-1365
lines changed

build-logic/src/main/kotlin/dfbuild.kotlinJvmCommon.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ kotlin {
1212
compilerOptions {
1313
// can be removed once kotlin.uuid.ExperimentalUuidApi is marked "stable".
1414
optIn.add("kotlin.uuid.ExperimentalUuidApi")
15+
freeCompilerArgs.add("-Xnested-type-aliases")
1516
}
1617
}
1718

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
1616
import kotlin.reflect.KProperty
1717

1818
/** [Column Selection DSL][ColumnSelectionDsl] */
19-
internal interface ColumnSelectionDslLink
20-
19+
internal typealias ColumnSelectionDslLink = Nothing
2120
public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
2221

2322
/**
@@ -27,8 +26,7 @@ public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
2726
* This is a shorthand for [get][ColumnsContainer.get]`(myColumn)`.
2827
* @throws [IllegalArgumentException] if the column is not found.
2928
*/
30-
private interface CommonColumnReferenceInvokeDocs
31-
29+
private typealias CommonColumnReferenceInvokeDocs = Nothing
3230
/**
3331
* @include [CommonColumnReferenceInvokeDocs]
3432
* @return The [DataColumn] this [Column Reference][ColumnReference] or [-Accessor][ColumnAccessor] points to.
@@ -68,8 +66,7 @@ public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
6866
* This is a shorthand for [get][ColumnsContainer.get]`(MyType::myColumn)`.
6967
* @throws [IllegalArgumentException] if the column is not found.
7068
*/
71-
private interface CommonKPropertyInvokeDocs
72-
69+
private typealias CommonKPropertyInvokeDocs = Nothing
7370
/**
7471
* @include [CommonKPropertyInvokeDocs]
7572
* @return The [DataColumn] this [KProperty Accessor][KProperty] points to.
@@ -107,8 +104,7 @@ public interface ColumnSelectionDsl<out T> : ColumnsContainer<T> {
107104
*
108105
* @throws [IllegalArgumentException] if the column is not found.
109106
*/
110-
private interface CommonKPropertyGetDocs
111-
107+
private typealias CommonKPropertyGetDocs = Nothing
112108
/**
113109
* @include [CommonKPropertyGetDocs]
114110
* @return The [DataColumn] these [KProperty Accessors][KProperty] point to.

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
2020
import kotlin.reflect.KProperty
2121

2222
/** [Columns Selection DSL][ColumnsSelectionDsl] */
23-
internal interface ColumnsSelectionDslLink
24-
23+
internal typealias ColumnsSelectionDslLink = Nothing
2524
@Suppress("UNCHECKED_CAST")
2625
@PublishedApi
2726
internal fun <T> ColumnsSelectionDsl<T>.asSingleColumn(): SingleColumn<DataRow<T>> = this as SingleColumn<DataRow<T>>
@@ -167,8 +166,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>
167166
* {@include [DslGrammarTemplate.TextDef]}
168167
*/
169168
@[ExcludeFromSources ExportAsHtml]
170-
public interface DefinitionsPartOfGrammar
171-
169+
public typealias DefinitionsPartOfGrammar = Nothing
172170
/**
173171
* {@include [DslGrammarTemplate.ColumnRef]}` `{@include [ColumnRangeColumnsSelectionDsl.Grammar.PlainDslName]}` `{@include [DslGrammarTemplate.ColumnRef]}
174172
*
@@ -229,8 +227,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>
229227
* `| `{@include [WithoutNullsColumnsSelectionDsl.Grammar.PlainDslName]}**`()`**
230228
*/
231229
@[ExcludeFromSources ExportAsHtml]
232-
public interface PlainDslPartOfGrammar
233-
230+
public typealias PlainDslPartOfGrammar = Nothing
234231
/**
235232
* {@include [Indent]}\[**`\[`**\][ColumnsSelectionDsl.col]{@include [DslGrammarTemplate.IndexRef]}\[**`\]`**\][ColumnsSelectionDsl.col]
236233
*
@@ -297,7 +294,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>
297294
* {@include [ColumnSetPartOfGrammar]}
298295
*/
299296
@ExportAsHtml
300-
public interface ForHtml
297+
public typealias ForHtml = Nothing
301298
}
302299

303300
/**
@@ -374,7 +371,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>
374371
* {@include [ColumnGroupPartOfGrammar]}
375372
*/
376373
@ExportAsHtml
377-
public interface ForHtml
374+
public typealias ForHtml = Nothing
378375
}
379376
}
380377

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,13 @@ public operator fun AnyRow.contains(column: KProperty<*>): Boolean = containsKey
114114
*
115115
* @return [firstRowValue] for the first row; difference between expression computed for current and previous row for the following rows
116116
*/
117-
internal interface DiffDocs
118-
117+
internal typealias DiffDocs = Nothing
119118
/**
120119
* Calculates the difference between the results of a row expression computed on the current and previous DataRow.
121120
*
122121
* @return null for the first row; difference between expression computed for current and previous row for the following rows
123122
*/
124-
internal interface DiffOrNullDocs
125-
123+
internal typealias DiffOrNullDocs = Nothing
126124
/**
127125
* @include [DiffDocs]
128126
*/

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

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,16 @@ import kotlin.reflect.KProperty
4242
internal interface FillNulls {
4343

4444
/** @include [Update.Grammar] {@set [UPDATE_OPERATION] [**fillNulls**][fillNulls]} */
45-
interface Grammar
46-
45+
typealias Grammar = Nothing
4746
/**
4847
* {@comment Version of [SelectingColumns] with correctly filled in examples}
4948
* @include [SelectingColumns] {@include [SetFillNullsOperationArg]}
5049
*/
51-
interface FillNullsSelectingOptions
50+
typealias FillNullsSelectingOptions = Nothing
5251
}
5352

5453
/** {@set [SelectingColumns.OPERATION] [fillNulls][fillNulls]} */
55-
private interface SetFillNullsOperationArg
56-
54+
private typealias SetFillNullsOperationArg = Nothing
5755
/**
5856
* @include [FillNulls] {@comment Description of the fillNulls operation.}
5957
* @include [LineBreak]
@@ -63,8 +61,7 @@ private interface SetFillNullsOperationArg
6361
*
6462
*/
6563
@ExcludeFromSources
66-
private interface CommonFillNullsFunctionDoc
67-
64+
private typealias CommonFillNullsFunctionDoc = Nothing
6865
/**
6966
* @include [CommonFillNullsFunctionDoc]
7067
* @include [SelectingColumns.Dsl.WithExample] {@include [SetFillNullsOperationArg]}
@@ -172,19 +169,17 @@ internal inline val Float?.isNA: Boolean get() = this == null || this.isNaN()
172169
internal interface FillNaNs {
173170

174171
/** @include [Update.Grammar] {@set [Update.UPDATE_OPERATION] [fillNaNs][fillNaNs]} */
175-
interface Grammar
176-
172+
typealias Grammar = Nothing
177173
/**
178174
* {@comment Version of [SelectingColumns] with correctly filled in examples}
179175
* @include [SelectingColumns] {@include [SetFillNaNsOperationArg]}
180176
*/
181-
interface FillNaNsSelectingOptions
177+
typealias FillNaNsSelectingOptions = Nothing
182178
}
183179

184180
/** {@set [SelectingColumns.OPERATION] [fillNaNs][fillNaNs]} */
185181
@ExcludeFromSources
186-
internal interface SetFillNaNsOperationArg
187-
182+
internal typealias SetFillNaNsOperationArg = Nothing
188183
/**
189184
* @include [FillNaNs] {@comment Description of the fillNaNs operation.}
190185
* @include [LineBreak]
@@ -193,8 +188,7 @@ internal interface SetFillNaNsOperationArg
193188
* ### This Fill NaNs Overload
194189
*/
195190
@ExcludeFromSources
196-
private interface CommonFillNaNsFunctionDoc
197-
191+
private typealias CommonFillNaNsFunctionDoc = Nothing
198192
/**
199193
* @include [CommonFillNaNsFunctionDoc]
200194
* @include [SelectingColumns.Dsl.WithExample] {@include [SetFillNaNsOperationArg]}
@@ -247,19 +241,17 @@ public fun <T, C> DataFrame<T>.fillNaNs(vararg columns: ColumnReference<C>): Upd
247241
internal interface FillNA {
248242

249243
/** @include [Update.Grammar] {@set [Update.UPDATE_OPERATION] [fillNA][fillNA]} */
250-
interface Grammar
251-
244+
typealias Grammar = Nothing
252245
/**
253246
* {@comment Version of [SelectingColumns] with correctly filled in examples}
254247
* @include [SelectingColumns] {@include [SetFillNAOperationArg]}
255248
*/
256-
interface FillNASelectingOptions
249+
typealias FillNASelectingOptions = Nothing
257250
}
258251

259252
/** {@set [SelectingColumns.OPERATION] [fillNA][fillNA]} */
260253
@ExcludeFromSources
261-
internal interface SetFillNAOperationArg
262-
254+
internal typealias SetFillNAOperationArg = Nothing
263255
/**
264256
* @include [FillNA] {@comment Description of the fillNA operation.}
265257
* @include [LineBreak]
@@ -268,8 +260,7 @@ internal interface SetFillNAOperationArg
268260
* ### This Fill NA Overload
269261
*/
270262
@ExcludeFromSources
271-
private interface CommonFillNAFunctionDoc
272-
263+
private typealias CommonFillNAFunctionDoc = Nothing
273264
/**
274265
* @include [CommonFillNAFunctionDoc]
275266
* @include [SelectingColumns.Dsl.WithExample] {@include [SetFillNAOperationArg]}
@@ -309,20 +300,16 @@ public fun <T, C> DataFrame<T>.fillNA(vararg columns: ColumnReference<C>): Updat
309300

310301
/** @param columns The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to drop rows in. */
311302
@ExcludeFromSources
312-
private interface DropDslParam
313-
303+
private typealias DropDslParam = Nothing
314304
/** @param columns The [KProperties][KProperty] used to select the columns of this [DataFrame] to drop rows in. */
315305
@ExcludeFromSources
316-
private interface DropKPropertiesParam
317-
306+
private typealias DropKPropertiesParam = Nothing
318307
/** @param columns The [Strings][String] corresponding to the names of columns in this [DataFrame] to drop rows in. */
319308
@ExcludeFromSources
320-
private interface DropColumnNamesParam
321-
309+
private typealias DropColumnNamesParam = Nothing
322310
/** @param columns The [Column References][ColumnReference] used to select the columns of this [DataFrame] to drop rows in. */
323311
@ExcludeFromSources
324-
private interface DropColumnAccessorsParam
325-
312+
private typealias DropColumnAccessorsParam = Nothing
326313
// region dropNulls
327314

328315
/**
@@ -345,26 +332,23 @@ internal interface DropNulls {
345332
* If `true`, rows are dropped if all selected cells are `null`.
346333
* If `false`, rows are dropped if any of the selected cells is `null`.
347334
*/
348-
interface WhereAllNullParam
349-
335+
typealias WhereAllNullParam = Nothing
350336
/**
351337
* {@comment Version of [SelectingColumns] with correctly filled in examples}
352338
* @include [SelectingColumns] {@include [SetDropNullsOperationArg]}
353339
*/
354-
interface DropNullsSelectingOptions
340+
typealias DropNullsSelectingOptions = Nothing
355341
}
356342

357343
/** {@set [SelectingColumns.OPERATION] [dropNulls][dropNulls]} */
358344
@ExcludeFromSources
359-
private interface SetDropNullsOperationArg
360-
345+
private typealias SetDropNullsOperationArg = Nothing
361346
/**
362347
* @include [DropNulls] {@comment Description of the dropNulls operation.}
363348
* ### This Drop Nulls Overload
364349
*/
365350
@ExcludeFromSources
366-
private interface CommonDropNullsFunctionDoc
367-
351+
private typealias CommonDropNullsFunctionDoc = Nothing
368352
/**
369353
* @include [CommonDropNullsFunctionDoc]
370354
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNullsOperationArg]}
@@ -466,26 +450,23 @@ internal interface DropNA {
466450
* If `true`, rows are dropped if all selected cells are [`NA`][NA].
467451
* If `false`, rows are dropped if any of the selected cells is [`NA`][NA].
468452
*/
469-
interface WhereAllNAParam
470-
453+
typealias WhereAllNAParam = Nothing
471454
/**
472455
* {@comment Version of [SelectingColumns] with correctly filled in examples}
473456
* @include [SelectingColumns] {@include [SetDropNAOperationArg]}
474457
*/
475-
interface DropNASelectingOptions
458+
typealias DropNASelectingOptions = Nothing
476459
}
477460

478461
/** {@set [SelectingColumns.OPERATION] [dropNA][dropNA]} */
479462
@ExcludeFromSources
480-
private interface SetDropNAOperationArg
481-
463+
private typealias SetDropNAOperationArg = Nothing
482464
/**
483465
* @include [DropNA] {@comment Description of the dropNA operation.}
484466
* ### This Drop NA Overload
485467
*/
486468
@ExcludeFromSources
487-
private interface CommonDropNAFunctionDoc
488-
469+
private typealias CommonDropNAFunctionDoc = Nothing
489470
/**
490471
* @include [CommonDropNAFunctionDoc]
491472
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNAOperationArg]}
@@ -581,26 +562,23 @@ internal interface DropNaNs {
581562
* If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN].
582563
* If `false`, rows are dropped if any of the selected cells is [`NaN`][Double.isNaN].
583564
*/
584-
interface WhereAllNaNParam
585-
565+
typealias WhereAllNaNParam = Nothing
586566
/**
587567
* {@comment Version of [SelectingColumns] with correctly filled in examples}
588568
* @include [SelectingColumns] {@include [SetDropNaNsOperationArg]}
589569
*/
590-
interface DropNaNsSelectingOptions
570+
typealias DropNaNsSelectingOptions = Nothing
591571
}
592572

593573
/** {@set [SelectingColumns.OPERATION] [dropNaNs][dropNaNs]} */
594574
@ExcludeFromSources
595-
private interface SetDropNaNsOperationArg
596-
575+
private typealias SetDropNaNsOperationArg = Nothing
597576
/**
598577
* @include [DropNaNs] {@comment Description of the dropNaNs operation.}
599578
* ### This Drop NaNs Overload
600579
*/
601580
@ExcludeFromSources
602-
private interface CommonDropNaNsFunctionDoc
603-
581+
private typealias CommonDropNaNsFunctionDoc = Nothing
604582
/**
605583
* @include [CommonDropNaNsFunctionDoc]
606584
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNaNsOperationArg]}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ public typealias AddExpression<T, R> = Selector<AddDataRow<T>, R>
178178
* For example, use `prev().newValue()` to access the new column value from the previous row.
179179
*/
180180
@ExcludeFromSources
181-
internal interface AddExpressionDocs
182-
181+
internal typealias AddExpressionDocs = Nothing
183182
/**
184183
* Creates a new column using an [AddExpression] and
185184
* adds a new column to the end of this [DataFrame] (at the top level).

0 commit comments

Comments
 (0)