Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for examples in documentation comments #1045

Merged
merged 15 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To run Safe-DS programs, you also need the [Safe-DS Runner](https://github.com/S
2. **Open VS Code**.
3. **Open the command palette** (Menu bar > View > Command Palette).
4. **Type `Install the Safe-DS Runner`**.
5. **Press ++enter++**. Installation may take a few minutes, since it downloads and installs several large libraries
5. **Press Enter**. Installation may take a few minutes, since it downloads and installs several large libraries
like PyTorch.

## Documentation
Expand Down
56 changes: 32 additions & 24 deletions docs/api/safeds/data/tabular/containers/Column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ A column is a named collection of values.
|------|-------------|-------------|---------|
| `T` | [`Any?`][safeds.lang.Any] | - | [`Any?`][safeds.lang.Any] |

**Examples:**

```sds
pipeline example {
val column = Column("test", [1, 2, 3]);
}
```

??? quote "Stub code in `column.sdsstub`"

```sds linenums="12"
```sds linenums="17"
class Column<out T = Any?>(
name: String,
data: List<T> = []
Expand Down Expand Up @@ -310,7 +318,7 @@ Check if all values have a given property.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="58"
```sds linenums="63"
@Pure
fun all(
predicate: (param1: T) -> param2: Boolean
Expand All @@ -335,7 +343,7 @@ Check if any value has a given property.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="70"
```sds linenums="75"
@Pure
fun any(
predicate: (param1: T) -> param2: Boolean
Expand All @@ -360,7 +368,7 @@ Calculate Pearson correlation between this and another column. Both columns have

??? quote "Stub code in `column.sdsstub`"

```sds linenums="129"
```sds linenums="134"
@Pure
@PythonName("correlation_with")
fun correlationWith(
Expand All @@ -380,7 +388,7 @@ Return a list of all unique values in the column.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="34"
```sds linenums="39"
@Pure
@PythonName("get_unique_values")
fun getUniqueValues() -> result1: List<T>
Expand All @@ -404,7 +412,7 @@ Return column value at specified index, starting at 0.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="45"
```sds linenums="50"
@Pure
@PythonName("get_value")
fun getValue(
Expand All @@ -424,7 +432,7 @@ Return whether the column has missing values.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="92"
```sds linenums="97"
@Pure
@PythonName("has_missing_values")
fun hasMissingValues() -> result1: Boolean
Expand All @@ -448,7 +456,7 @@ $$

??? quote "Stub code in `column.sdsstub`"

```sds linenums="146"
```sds linenums="151"
@Pure
fun idness() -> result1: Float
```
Expand All @@ -465,7 +473,7 @@ Return the maximum value of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="154"
```sds linenums="159"
@Pure
fun maximum() -> result1: Float
```
Expand All @@ -482,7 +490,7 @@ Return the mean value of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="162"
```sds linenums="167"
@Pure
fun mean() -> result1: Float
```
Expand All @@ -499,7 +507,7 @@ Return the median value of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="170"
```sds linenums="175"
@Pure
fun median() -> result1: Float
```
Expand All @@ -516,7 +524,7 @@ Return the minimum value of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="178"
```sds linenums="183"
@Pure
fun minimum() -> result1: Float
```
Expand All @@ -533,7 +541,7 @@ Return the ratio of missing values to the total number of elements in the column

??? quote "Stub code in `column.sdsstub`"

```sds linenums="186"
```sds linenums="191"
@Pure
@PythonName("missing_value_ratio")
fun missingValueRatio() -> result1: Float
Expand All @@ -551,7 +559,7 @@ Return the mode of the column.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="195"
```sds linenums="200"
@Pure
fun mode() -> result1: List<T>
```
Expand All @@ -574,7 +582,7 @@ Check if no values has a given property.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="82"
```sds linenums="87"
@Pure
fun none(
predicate: (param1: T) -> param2: Boolean
Expand All @@ -593,7 +601,7 @@ Plot this column in a boxplot. This function can only plot real numerical data.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="244"
```sds linenums="249"
@Pure
@PythonName("plot_boxplot")
fun plotBoxplot() -> result1: Image
Expand All @@ -611,7 +619,7 @@ Plot a column in a histogram.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="253"
```sds linenums="258"
@Pure
@PythonName("plot_histogram")
fun plotHistogram() -> result1: Image
Expand All @@ -637,7 +645,7 @@ The original column is not modified.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="105"
```sds linenums="110"
@Pure
fun rename(
@PythonName("new_name") newName: String
Expand All @@ -664,7 +672,7 @@ The stability is not defined for a column with only null values.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="211"
```sds linenums="216"
@Pure
fun stability() -> result1: Float
```
Expand All @@ -681,7 +689,7 @@ Return the standard deviation of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="219"
```sds linenums="224"
@Pure
@PythonName("standard_deviation")
fun standardDeviation() -> result1: Float
Expand All @@ -699,7 +707,7 @@ Return the sum of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="228"
```sds linenums="233"
@Pure
fun sum() -> result1: Float
```
Expand All @@ -716,7 +724,7 @@ Return an HTML representation of the column.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="262"
```sds linenums="267"
@Pure
@PythonName("to_html")
fun toHtml() -> result1: String
Expand Down Expand Up @@ -748,7 +756,7 @@ The original column is not modified.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="119"
```sds linenums="124"
@Pure
fun transform<R>(
transformer: (param1: T) -> param2: R
Expand All @@ -767,7 +775,7 @@ Return the variance of the column. The column has to be numerical.

??? quote "Stub code in `column.sdsstub`"

```sds linenums="236"
```sds linenums="241"
@Pure
fun variance() -> result1: Float
```
Empty file removed docs/language/README.md
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ nav:
- Pipelines: pipeline-language/pipelines.md
- Statements: pipeline-language/statements.md
- Expressions: pipeline-language/expressions.md
- Comments: pipeline-language/comments.md
- Segments: pipeline-language/segments.md
- Types: pipeline-language/types.md
- Comments: pipeline-language/comments.md
- Imports: pipeline-language/imports.md
- API Reference: api/
- Integrating New Libraries:
Expand Down
6 changes: 3 additions & 3 deletions docs/pipeline-language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ This remaining documentation provides a detailed reference for the concepts of t
- [Pipelines][pipelines] define the entry point of a program.
- [Statements][statements] are the instructions that are executed as part of a program.
- [Expressions][expressions] are computations that produce some value.
- [Comments][comments] document the code.
- [Segments][segments] encapsulate parts of program and make them reusable.
- [Types][types] describe the kind of data that a declaration accepts.
- [Types][types] describe the kind of data that a declaration can hold.
- [Comments][comments] document the code.
- [Imports][imports] make declarations in other packages accessible.


[packages]: packages.md
[pipelines]: pipelines.md
[statements]: statements.md
[expressions]: expressions.md
[comments]: comments.md
[segments]: segments.md
[types]: types.md
[comments]: comments.md
[imports]: imports.md
Loading