Skip to content

Commit

Permalink
attempt to rename all KoDEx argument interfaces to screaming snake ca…
Browse files Browse the repository at this point in the history
…se for better readability
  • Loading branch information
Jolanrensen committed Jan 19, 2025
1 parent 7f46ae2 commit 93522e8
Show file tree
Hide file tree
Showing 59 changed files with 1,119 additions and 1,243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package org.jetbrains.kotlinx.dataframe.api
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.DataRow
import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar
import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar
import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar
import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver
Expand Down Expand Up @@ -39,7 +35,7 @@ public annotation class ColumnsSelectionDslMarker
/**
* ## Columns Selection DSL
* {@include [SelectingColumns.Dsl.WithExample]}
* {@set [SelectingColumns.OperationArg] [select][DataFrame.select]}
* {@set [SelectingColumns.OPERATION] [select][DataFrame.select]}
*
* @comment This interface be safely cast to [SingleColumn] across the library because it's always
* implemented in combination with [DataFrameReceiver] which is a [SingleColumn] itself.
Expand Down Expand Up @@ -114,10 +110,10 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>
*
* @include [DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate]
*
* @set [DslGrammarTemplate.DefinitionsArg] {@include [DefinitionsPartOfGrammar]}
* @set [DslGrammarTemplate.PlainDslFunctionsArg] {@include [PlainDslPartOfGrammar]}
* @set [DslGrammarTemplate.ColumnSetFunctionsArg] {@include [ColumnSetPartOfGrammar]}
* @set [DslGrammarTemplate.ColumnGroupFunctionsArg] {@include [ColumnGroupPartOfGrammar]}
* @set [DslGrammarTemplate.DEFINITIONS] {@include [DefinitionsPartOfGrammar]}
* @set [DslGrammarTemplate.PLAIN_DSL_FUNCTIONS] {@include [PlainDslPartOfGrammar]}
* @set [DslGrammarTemplate.COLUMN_SET_FUNCTIONS] {@include [ColumnSetPartOfGrammar]}
* @set [DslGrammarTemplate.COLUMN_GROUP_FUNCTIONS] {@include [ColumnGroupPartOfGrammar]}
*/
public interface DslGrammar {

Expand Down Expand Up @@ -385,7 +381,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>

/**
* @include [SelectColumnsSelectionDsl.CommonSelectDocs]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.EXAMPLE]
*
* `df.`[select][DataFrame.select]` { myColGroup.`[`select`][SingleColumn.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }`
*
Expand All @@ -396,7 +392,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>

/**
* @include [SelectColumnsSelectionDsl.CommonSelectDocs]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.EXAMPLE]
*
* `df.`[select][DataFrame.select]` { Type::myColGroup.`[`select`][KProperty.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }`
*
Expand All @@ -407,7 +403,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>

/**
* @include [SelectColumnsSelectionDsl.CommonSelectDocs]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.EXAMPLE]
*
* `df.`[select][DataFrame.select]` { "myColGroup".`[`select`][String.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }`
*
Expand All @@ -417,7 +413,7 @@ public interface ColumnsSelectionDsl<out T> : // SingleColumn<DataRow<T>>

/**
* @include [SelectColumnsSelectionDsl.CommonSelectDocs]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg]
* @set [SelectColumnsSelectionDsl.CommonSelectDocs.EXAMPLE]
*
* `df.`[select][DataFrame.select]` { "pathTo"["myColGroup"].`[`select`][ColumnPath.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }`
*
Expand Down
29 changes: 13 additions & 16 deletions core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
import org.jetbrains.kotlinx.dataframe.annotations.Refine
import org.jetbrains.kotlinx.dataframe.api.DropNA.DropNASelectingOptions
import org.jetbrains.kotlinx.dataframe.api.DropNaNs.DropNaNsSelectingOptions
import org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions
import org.jetbrains.kotlinx.dataframe.api.Update.UpdateOperationArg
import org.jetbrains.kotlinx.dataframe.api.Update.UPDATE_OPERATION
import org.jetbrains.kotlinx.dataframe.columns.ColumnKind
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
Expand Down Expand Up @@ -41,7 +38,7 @@ import kotlin.reflect.KProperty
*/
internal interface FillNulls {

/** @include [Update.Grammar] {@set [UpdateOperationArg] [**fillNulls**][fillNulls]} */
/** @include [Update.Grammar] {@set [UPDATE_OPERATION] [**fillNulls**][fillNulls]} */
interface Grammar

/**
Expand All @@ -51,14 +48,14 @@ internal interface FillNulls {
interface FillNullsSelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [fillNulls][fillNulls]} */
/** {@set [SelectingColumns.OPERATION] [fillNulls][fillNulls]} */
private interface SetFillNullsOperationArg

/**
* @include [FillNulls] {@comment Description of the fillNulls operation.}
* @include [LineBreak]
* @include [Update.Columns] {@comment Description of what this function expects the user to do: select columns}
* {@set [Update.Columns.SelectingColumnsArg] [Selecting Columns][FillNulls.FillNullsSelectingOptions]}
* {@set [Update.Columns.SELECTING_COLUMNS] [Selecting Columns][FillNulls.FillNullsSelectingOptions]}
* ### This Fill Nulls Overload
*
*/
Expand Down Expand Up @@ -135,7 +132,7 @@ internal inline val Float?.isNA: Boolean get() = this == null || this.isNaN()
*/
internal interface FillNaNs {

/** @include [Update.Grammar] {@set [Update.UpdateOperationArg] [fillNaNs][fillNaNs]} */
/** @include [Update.Grammar] {@set [Update.UPDATE_OPERATION] [fillNaNs][fillNaNs]} */
interface Grammar

/**
Expand All @@ -145,15 +142,15 @@ internal interface FillNaNs {
interface FillNaNsSelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [fillNaNs][fillNaNs]} */
/** {@set [SelectingColumns.OPERATION] [fillNaNs][fillNaNs]} */
@ExcludeFromSources
internal interface SetFillNaNsOperationArg

/**
* @include [FillNaNs] {@comment Description of the fillNaNs operation.}
* @include [LineBreak]
* @include [Update.Columns] {@comment Description of what this function expects the user to do: select columns}
* {@set [Update.Columns.SelectingColumnsArg] [Selecting Columns][FillNaNs.FillNaNsSelectingOptions]}
* {@set [Update.Columns.SELECTING_COLUMNS] [Selecting Columns][FillNaNs.FillNaNsSelectingOptions]}
* ### This Fill NaNs Overload
*/
@ExcludeFromSources
Expand Down Expand Up @@ -207,7 +204,7 @@ public fun <T, C> DataFrame<T>.fillNaNs(vararg columns: ColumnReference<C>): Upd
*/
internal interface FillNA {

/** @include [Update.Grammar] {@set [Update.UpdateOperationArg] [fillNA][fillNA]} */
/** @include [Update.Grammar] {@set [Update.UPDATE_OPERATION] [fillNA][fillNA]} */
interface Grammar

/**
Expand All @@ -217,15 +214,15 @@ internal interface FillNA {
interface FillNASelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [fillNA][fillNA]} */
/** {@set [SelectingColumns.OPERATION] [fillNA][fillNA]} */
@ExcludeFromSources
internal interface SetFillNAOperationArg

/**
* @include [FillNA] {@comment Description of the fillNA operation.}
* @include [LineBreak]
* @include [Update.Columns] {@comment Description of what this function expects the user to do: select columns}
* {@set [Update.Columns.SelectingColumnsArg] [Selecting Columns][FillNA.FillNASelectingOptions]}
* {@set [Update.Columns.SELECTING_COLUMNS] [Selecting Columns][FillNA.FillNASelectingOptions]}
* ### This Fill NA Overload
*/
@ExcludeFromSources
Expand Down Expand Up @@ -312,7 +309,7 @@ internal interface DropNulls {
interface DropNullsSelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [dropNulls][dropNulls]} */
/** {@set [SelectingColumns.OPERATION] [dropNulls][dropNulls]} */
@ExcludeFromSources
private interface SetDropNullsOperationArg

Expand Down Expand Up @@ -420,7 +417,7 @@ internal interface DropNA {
interface DropNASelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [dropNA][dropNA]} */
/** {@set [SelectingColumns.OPERATION] [dropNA][dropNA]} */
@ExcludeFromSources
private interface SetDropNAOperationArg

Expand Down Expand Up @@ -529,7 +526,7 @@ internal interface DropNaNs {
interface DropNaNsSelectingOptions
}

/** {@set [SelectingColumns.OperationArg] [dropNaNs][dropNaNs]} */
/** {@set [SelectingColumns.OPERATION] [dropNaNs][dropNaNs]} */
@ExcludeFromSources
private interface SetDropNaNsOperationArg

Expand Down
Loading

0 comments on commit 93522e8

Please sign in to comment.