Skip to content

Commit fb22326

Browse files
committed
ExpressionsGivenRowAndColumn
1 parent 0849309 commit fb22326

File tree

8 files changed

+104
-59
lines changed

8 files changed

+104
-59
lines changed

core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins {
1818
id("org.jetbrains.kotlinx.kover")
1919
id("org.jmailen.kotlinter")
2020
id("org.jetbrains.kotlinx.dataframe")
21-
id("com.github.jolanrensen.docProcessorGradlePlugin") version "v0.0.29"
21+
id("com.github.jolanrensen.docProcessorGradlePlugin") version "v0.0.30"
2222
// id("nl.jolanrensen.docProcessor") version "1.0-SNAPSHOT"
2323
}
2424

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ internal interface FillNulls {
4242
* - `.`[with][org.jetbrains.kotlinx.dataframe.api.Update.with]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
4343
* | .`[notNull][org.jetbrains.kotlinx.dataframe.api.Update.notNull]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
4444
* | .`[perCol][org.jetbrains.kotlinx.dataframe.api.Update.perCol]` { `[colExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpression.WithExample]` }
45-
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.RowColumnExpression.WithExample]` }
45+
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]` }
4646
* | .`[withValue][org.jetbrains.kotlinx.dataframe.api.Update.withValue]`(value)
4747
* | .`[withNull][org.jetbrains.kotlinx.dataframe.api.Update.withNull]`()
4848
* | .`[withZero][org.jetbrains.kotlinx.dataframe.api.Update.withZero]`()
@@ -255,7 +255,7 @@ internal interface FillNaNs {
255255
* - `.`[with][org.jetbrains.kotlinx.dataframe.api.Update.with]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
256256
* | .`[notNull][org.jetbrains.kotlinx.dataframe.api.Update.notNull]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
257257
* | .`[perCol][org.jetbrains.kotlinx.dataframe.api.Update.perCol]` { `[colExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpression.WithExample]` }
258-
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.RowColumnExpression.WithExample]` }
258+
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]` }
259259
* | .`[withValue][org.jetbrains.kotlinx.dataframe.api.Update.withValue]`(value)
260260
* | .`[withNull][org.jetbrains.kotlinx.dataframe.api.Update.withNull]`()
261261
* | .`[withZero][org.jetbrains.kotlinx.dataframe.api.Update.withZero]`()
@@ -424,7 +424,7 @@ internal interface FillNA {
424424
* - `.`[with][org.jetbrains.kotlinx.dataframe.api.Update.with]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
425425
* | .`[notNull][org.jetbrains.kotlinx.dataframe.api.Update.notNull]` { `[rowExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample]` }
426426
* | .`[perCol][org.jetbrains.kotlinx.dataframe.api.Update.perCol]` { `[colExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpression.WithExample]` }
427-
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.RowColumnExpression.WithExample]` }
427+
* | .`[perRowCol][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol]` { `[rowColExpression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]` }
428428
* | .`[withValue][org.jetbrains.kotlinx.dataframe.api.Update.withValue]`(value)
429429
* | .`[withNull][org.jetbrains.kotlinx.dataframe.api.Update.withNull]`()
430430
* | .`[withZero][org.jetbrains.kotlinx.dataframe.api.Update.withZero]`()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public data class Update<T, C>(
4848
* - `.`[with][Update.with]` { `[rowExpression][ExpressionsGivenRow.RowValueExpression.WithExample]` }
4949
* | .`[notNull][Update.notNull]` { `[rowExpression][ExpressionsGivenRow.RowValueExpression.WithExample]` }
5050
* | .`[perCol][Update.perCol]` { `[colExpression][ExpressionsGivenColumn.ColumnExpression.WithExample]` }
51-
* | .`[perRowCol][Update.perRowCol]` { `[rowColExpression][ExpressionsGivenColumn.RowColumnExpression.WithExample]` }
51+
* | .`[perRowCol][Update.perRowCol]` { `[rowColExpression][ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]` }
5252
* | .`[withValue][Update.withValue]`(value)
5353
* | .`[withNull][Update.withNull]`()
5454
* | .`[withZero][Update.withZero]`()
@@ -332,7 +332,7 @@ public fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C> = where { in
332332
* ## See Also
333333
* - [Update with][org.jetbrains.kotlinx.dataframe.api.Update.with] to provide a new value for every selected cell giving its row.
334334
* - [Update per col][org.jetbrains.kotlinx.dataframe.api.Update.perCol] to provide a new value for every selected cell giving its column.
335-
* @param expression The [Row Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.RowColumnExpression] to provide a new value for every selected cell giving its row and column.
335+
* @param expression The [Row Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression] to provide a new value for every selected cell giving its row and column.
336336
*/
337337
public infix fun <T, C> Update<T, C>.perRowCol(expression: RowColumnExpression<T, C, C>): DataFrame<T> =
338338
updateImpl { row, column, _ -> expression(row, column) }

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenColumn.kt

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package org.jetbrains.kotlinx.dataframe.documentation
22

33
import org.jetbrains.kotlinx.dataframe.*
44
import org.jetbrains.kotlinx.dataframe.api.*
5+
import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpressionLink
56
import org.jetbrains.kotlinx.dataframe.ColumnExpression as DfColumnExpression
6-
import org.jetbrains.kotlinx.dataframe.RowColumnExpression as DfRowColumnExpression
77

88
/**
99
* ## Expressions Given Column
10-
*
11-
* TODO
10+
* Expressing values using a "Column Expression" can occur exclusively in a
11+
* [Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpression].
1212
*/
1313
internal interface ExpressionsGivenColumn {
1414

@@ -38,25 +38,4 @@ internal interface ExpressionsGivenColumn {
3838

3939
/** [Column Expression][ColumnExpression] */
4040
interface ColumnExpressionLink
41-
42-
/** Provide a new value for every selected cell given both its row and column using a [row-column expression][DfRowColumnExpression]. */
43-
interface RowColumnExpression {
44-
45-
/**
46-
* Provide a new value for every selected cell given both its row and column using a [row-column expression][org.jetbrains.kotlinx.dataframe.RowColumnExpression].
47-
* For example:
48-
*
49-
* `df.`operation` { row, col ->`
50-
*
51-
* `row.age / col.`[mean][org.jetbrains.kotlinx.dataframe.DataColumn.mean]`(skipNA = true)`
52-
*
53-
* `}`
54-
*
55-
*
56-
*/
57-
interface WithExample
58-
}
59-
60-
/** [Row Column Expression][RowColumnExpression] */
61-
interface RowColumnExpressionLink
6241
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.jetbrains.kotlinx.dataframe.documentation
2+
3+
import org.jetbrains.kotlinx.dataframe.*
4+
import org.jetbrains.kotlinx.dataframe.api.*
5+
import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpressionLink
6+
import org.jetbrains.kotlinx.dataframe.RowColumnExpression as DfRowColumnExpression
7+
8+
/**
9+
* ## Expressions Given Row and Column
10+
* Expressing values using a "Row-Column Expression" can occur exclusively in a
11+
* [Row Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression].
12+
*/
13+
internal interface ExpressionsGivenRowAndColumn {
14+
15+
/**
16+
* The key for an @arg that will define the operation name for the examples below.
17+
* Make sure to [alias][your examples].
18+
*/
19+
interface OperationArg
20+
21+
interface SetDefaultOperationArg
22+
23+
/** Provide a new value for every selected cell given both its row and column using a [row-column expression][DfRowColumnExpression]. */
24+
interface RowColumnExpression {
25+
26+
/**
27+
* Provide a new value for every selected cell given both its row and column using a [row-column expression][org.jetbrains.kotlinx.dataframe.RowColumnExpression].
28+
* For example:
29+
*
30+
* `df.`operation` { row, col ->`
31+
*
32+
* `row.age / col.`[mean][org.jetbrains.kotlinx.dataframe.DataColumn.mean]`(skipNA = true)`
33+
*
34+
* `}`
35+
*
36+
*
37+
*/
38+
interface WithExample
39+
}
40+
41+
/** [Row Column Expression][RowColumnExpression] */
42+
interface RowColumnExpressionLink
43+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public data class Update<T, C>(
4848
* - `.`[with][Update.with]` { `[rowExpression][ExpressionsGivenRow.RowValueExpression.WithExample]` }
4949
* | .`[notNull][Update.notNull]` { `[rowExpression][ExpressionsGivenRow.RowValueExpression.WithExample]` }
5050
* | .`[perCol][Update.perCol]` { `[colExpression][ExpressionsGivenColumn.ColumnExpression.WithExample]` }
51-
* | .`[perRowCol][Update.perRowCol]` { `[rowColExpression][ExpressionsGivenColumn.RowColumnExpression.WithExample]` }
51+
* | .`[perRowCol][Update.perRowCol]` { `[rowColExpression][ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]` }
5252
* | .`[withValue][Update.withValue]`(value)
5353
* | .`[withNull][Update.withNull]`()
5454
* | .`[withZero][Update.withZero]`()
@@ -191,13 +191,13 @@ public fun <T, C> Update<T, C>.at(vararg rowIndices: Int): Update<T, C> = at(row
191191
public fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C> = where { index in rowRange }
192192

193193
/** ## Per Row Col
194-
* @include [ExpressionsGivenColumn.RowColumnExpression.WithExample]
195-
* {@arg [ExpressionsGivenColumn.OperationArg] [update][update]` { age \}.`[perRowCol][perRowCol]}
194+
* @include [ExpressionsGivenRowAndColumn.RowColumnExpression.WithExample]
195+
* {@arg [ExpressionsGivenRowAndColumn.OperationArg] [update][update]` { age \}.`[perRowCol][perRowCol]}
196196
*
197197
* ## See Also
198198
* - {@include [SeeAlsoWith]}
199199
* - {@include [SeeAlsoPerCol]}
200-
* @param expression The {@include [ExpressionsGivenColumn.RowColumnExpressionLink]} to provide a new value for every selected cell giving its row and column.
200+
* @param expression The {@include [ExpressionsGivenRowAndColumn.RowColumnExpressionLink]} to provide a new value for every selected cell giving its row and column.
201201
*/
202202
public infix fun <T, C> Update<T, C>.perRowCol(expression: RowColumnExpression<T, C, C>): DataFrame<T> =
203203
updateImpl { row, column, _ -> expression(row, column) }

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenColumn.kt

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package org.jetbrains.kotlinx.dataframe.documentation
22

33
import org.jetbrains.kotlinx.dataframe.*
44
import org.jetbrains.kotlinx.dataframe.api.*
5+
import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpressionLink
56
import org.jetbrains.kotlinx.dataframe.ColumnExpression as DfColumnExpression
6-
import org.jetbrains.kotlinx.dataframe.RowColumnExpression as DfRowColumnExpression
77

88
/**
99
* ## Expressions Given Column
10-
*
11-
* TODO
10+
* Expressing values using a "Column Expression" can occur exclusively in a
11+
* {@include [ColumnExpressionLink]}.
1212
*/
1313
internal interface ExpressionsGivenColumn {
1414

@@ -39,26 +39,4 @@ internal interface ExpressionsGivenColumn {
3939

4040
/** [Column Expression][ColumnExpression] */
4141
interface ColumnExpressionLink
42-
43-
/** Provide a new value for every selected cell given both its row and column using a [row-column expression][DfRowColumnExpression]. */
44-
interface RowColumnExpression {
45-
46-
/**
47-
* @include [RowColumnExpression]
48-
*
49-
* For example:
50-
*
51-
* `df.`{@includeArg [OperationArg]}` { row, col ->`
52-
*
53-
* `row.age / col.`[mean][DataColumn.mean]`(skipNA = true)`
54-
*
55-
* `}`
56-
*
57-
* @include [SetDefaultOperationArg]
58-
*/
59-
interface WithExample
60-
}
61-
62-
/** [Row Column Expression][RowColumnExpression] */
63-
interface RowColumnExpressionLink
6442
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package org.jetbrains.kotlinx.dataframe.documentation
2+
3+
import org.jetbrains.kotlinx.dataframe.*
4+
import org.jetbrains.kotlinx.dataframe.api.*
5+
import org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpressionLink
6+
import org.jetbrains.kotlinx.dataframe.RowColumnExpression as DfRowColumnExpression
7+
8+
/**
9+
* ## Expressions Given Row and Column
10+
* Expressing values using a "Row-Column Expression" can occur exclusively in a
11+
* {@include [RowColumnExpressionLink]}.
12+
*/
13+
internal interface ExpressionsGivenRowAndColumn {
14+
15+
/**
16+
* The key for an @arg that will define the operation name for the examples below.
17+
* Make sure to [alias][your examples].
18+
*/
19+
interface OperationArg
20+
21+
/** {@arg [OperationArg] operation} */
22+
interface SetDefaultOperationArg
23+
24+
/** Provide a new value for every selected cell given both its row and column using a [row-column expression][DfRowColumnExpression]. */
25+
interface RowColumnExpression {
26+
27+
/**
28+
* @include [RowColumnExpression]
29+
*
30+
* For example:
31+
*
32+
* `df.`{@includeArg [OperationArg]}` { row, col ->`
33+
*
34+
* `row.age / col.`[mean][DataColumn.mean]`(skipNA = true)`
35+
*
36+
* `}`
37+
*
38+
* @include [SetDefaultOperationArg]
39+
*/
40+
interface WithExample
41+
}
42+
43+
/** [Row Column Expression][RowColumnExpression] */
44+
interface RowColumnExpressionLink
45+
}

0 commit comments

Comments
 (0)