Skip to content

Commit

Permalink
Merge branch 'main' into 404
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Jul 11, 2023
2 parents 65da650 + a7bf555 commit 17ebf6e
Show file tree
Hide file tree
Showing 23 changed files with 1,489 additions and 1,307 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[report]
exclude_lines =
pragma: no cover
if\s+(typing\.)?TYPE_CHECKING:
8 changes: 0 additions & 8 deletions .github/linters/.flake8

This file was deleted.

2 changes: 2 additions & 0 deletions .github/linters/.ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ ignore = [
"FBT002",
# builtin-attribute-shadowing (not an issue)
"A003",
# implicit-return (can add a return even though all cases are covered)
"RET503",
# superfluous-else-return (sometimes it's more readable)
"RET505",
# superfluous-else-raise (sometimes it's more readable)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.1
- uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/Safe-DS/projects/2
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ jobs:
python-version: ${{ matrix.python-version }}
module-name: safeds_examples
coverage: ${{ matrix.python-version == '3.10' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/megalinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ on:
jobs:
megalinter:
uses: lars-reimann/.github/.github/workflows/megalinter-reusable.yml@main
permissions:
contents: write
issues: write
pull-requests: write
secrets:
PAT: ${{ secrets.PAT }}
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jobs:
python-version: ${{ matrix.python-version }}
module-name: safeds_examples
coverage: ${{ matrix.python-version == '3.10' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ report/
megalinter-reports/

# Other
.DS_Store/
.DS_Store
*.log
3 changes: 1 addition & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ JSON_PRETTIER_FILE_EXTENSIONS:

# Commands
PRE_COMMANDS:
- command: npm install @lars-reimann/prettier-config
cwd: workspace
- command: npm i @lars-reimann/prettier-config
40 changes: 40 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## [0.14.0](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.13.0...v0.14.0) (2023-06-30)


### Features

* compatibility with `safe-ds` v0.14.0 ([#73](https://github.com/Safe-DS/Stdlib-Examples/issues/73)) ([3c1a984](https://github.com/Safe-DS/Stdlib-Examples/commit/3c1a984d186f15517b7b3ffb208eb12b5eaeb3df))

## [0.13.0](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.12.0...v0.13.0) (2023-06-01)


### Features

* compatibility with `safe-ds` v0.13.0 ([#72](https://github.com/Safe-DS/Stdlib-Examples/issues/72)) ([41b4378](https://github.com/Safe-DS/Stdlib-Examples/commit/41b4378a80064fe3fc1ef834ca59e136ee65db41))

## [0.12.0](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.11.0...v0.12.0) (2023-05-11)


### Features

* compatibility with `safe-ds` v0.12.0 ([#63](https://github.com/Safe-DS/Stdlib-Examples/issues/63)) ([356e3a4](https://github.com/Safe-DS/Stdlib-Examples/commit/356e3a492f4df42748a8dbb31c36423b601f7463))

## [0.11.0](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.10.0...v0.11.0) (2023-04-22)


### Features

* compatibility with `safe-ds` v0.11.0 ([#53](https://github.com/Safe-DS/Stdlib-Examples/issues/53)) ([462ec46](https://github.com/Safe-DS/Stdlib-Examples/commit/462ec46240c25f47946f153866b518b6857f73f3))

## [0.10.0](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.9.1...v0.10.0) (2023-04-13)


### Features

* compatibility with `safe-ds` v0.10.0 ([#49](https://github.com/Safe-DS/Stdlib-Examples/issues/49)) ([4f7d3b8](https://github.com/Safe-DS/Stdlib-Examples/commit/4f7d3b84cc2cbd1e445824516f5422598b5556a4))


### Bug Fixes

* lower bound for `safe-ds` ([8dc748f](https://github.com/Safe-DS/Stdlib-Examples/commit/8dc748f43e3676b99e626953d67f909339dae7de))

## [0.9.1](https://github.com/Safe-DS/Stdlib-Examples/compare/v0.9.0...v0.9.1) (2023-04-04)


Expand Down
21 changes: 16 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
[![PyPI](https://img.shields.io/pypi/v/safe-ds-examples)](https://pypi.org/project/safe-ds-examples)
[![Main](https://github.com/Safe-DS/Stdlib-Examples/actions/workflows/main.yml/badge.svg)](https://github.com/Safe-DS/Stdlib-Examples/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/Safe-DS/Stdlib-Examples/branch/main/graph/badge.svg?token=X5CU9V952H)](https://codecov.io/gh/Safe-DS/Stdlib-Examples)
[![Documentation Status](https://readthedocs.org/projects/stdlib-examples/badge/?version=stable)](https://stdlib-examples.safe-ds.com)
[![Documentation Status](https://readthedocs.org/projects/stdlib-examples/badge/?version=stable)](https://stdlib-examples.safeds.com)

Ready-to-use examples for the [Safe-DS Python Library](https://github.com/Safe-DS/Stdlib).

## Documentation

You can find the full documentation [here](https://stdlib-examples.safe-ds.com).

## Installation

Get the latest version from [PyPI](https://pypi.org/project/safe-ds-examples):

```shell
pip install safe-ds-examples
```

## Documentation

You can find the full documentation [here](https://stdlib-examples.safeds.com).

## Contributing

We welcome contributions from everyone. As a starting point, check the following resources:

* [Setting up a development environment](https://stdlib-examples.safeds.com/en/latest/development/environment/)
* [Contributing page](https://github.com/Safe-DS/Stdlib-Examples/contribute)

If you need further help, please [use our discussion forum][forum].

[forum]: https://github.com/orgs/Safe-DS/discussions
83 changes: 71 additions & 12 deletions docs/development/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,88 @@

This document describes how to configure and use your development environment.

!!! note

All terminal commands listed below are assumed to be run from the root of the repository.
## Prerequisites

## Initial setup
You must complete these steps once before you can start setting up the project itself:

1. Install [Python 3.10](https://www.python.org/downloads/).
2. Install [poetry](https://python-poetry.org/docs/master/#installation).
3. Install dependencies of this project by running this command:
2. Verify that `python` can be launched by running this command in a **new** terminal:
```shell
poetry install
python --version
```
If this fails, add the directory that contains the `python` executable to your `PATH` environment variable.

## Running the tests

1. Run this command:
3. Install [Poetry](https://python-poetry.org/docs/master/#installing-with-the-official-installer) with the official installer. Follow the instructions for your operating system in the linked document.
4. Verify that `poetry` can be launched by running this command in a **new** terminal:
```shell
poetry run pytest
poetry --version
```
If this fails, add the directory that contains the `poetry` executable to your `PATH` environment variable.

## Project setup

Follow the instructions for your preferred IDE. If you want to use neither [PyCharm](https://www.jetbrains.com/pycharm/) nor [Visual Studio Code](https://code.visualstudio.com/), use the generic instructions. You only need to do these steps once.

!!! note

All terminal commands listed in this section are assumed to be run from the root of the repository.

=== "PyCharm"

1. Clone the repository.
2. Open the project folder in PyCharm.
3. Follow the instructions in the [PyCharm documentation](https://www.jetbrains.com/help/pycharm/poetry.html#poetry-env) to create a **new** Poetry environment and to install the dependencies of the project.
4. Open the PyCharm settings and search for "Python Integrated Tools". Set the "Default test runner" to "pytest" and the "Docstring format" to "NumPy". Your settings should look like this:
![PyCharm settings "Python Integrated Tools"](./img/pycharm_python_integrated_tools.png)

=== "Visual Studio Code"

1. Clone the repository.
2. Open the project folder in Visual Studio Code.
3. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python).
4. Create a new Poetry environment and install the dependencies of the project by running this command:
```shell
poetry install
```
5. Find the path to the Poetry environment that was created in step 4 by running this command:
```shell
poetry env info --path
```
6. Copy the output of step 5 to your clipboard.
7. Open the command palette and search for "Python: Select Interpreter".
8. Select the Poetry environment that matches the output of step 5. It should show up in the list of available interpreters. If it does not, you can pick it manually by choosing "Enter interpreter path..." and pasting the path that you copied in step 6 into the input field.
9. Open the command palette and search for "Python: Configure Tests".
10. Select "pytest" as the test runner.
11. Select "tests" as the directory containing tests.

=== "Generic"

1. Clone the repository.
2. Create a new Poetry environment and install the dependencies of the project by running this command:
```shell
poetry install
```

## Running the tests

=== "PyCharm"

Right-click the `tests` directory in the [Project tool window](https://www.jetbrains.com/help/pycharm/project-tool-window.html) and select "Run 'pytest in tests'".

=== "Visual Studio Code"

Run the tests by opening the command palette and searching for "Test: Run All Tests".

=== "Generic"

Run this command from the root of the repository:
```shell
poetry run pytest
```

## Serving the documentation

1. Start the server by running this command:
1. Start the server by running this command from the root of the repository:
```shell
poetry run mkdocs serve
```
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/examples/house_sales.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"execution_count": null,
"outputs": [],
"source": [
"house_sales.schema"
"print(str(house_sales.schema))"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -123,7 +123,7 @@
" \"latitude\",\n",
" \"longitude\"\n",
"])\n",
"house_sales_correlation.correlation_heatmap()"
"house_sales_correlation.plot_correlation_heatmap()"
],
"metadata": {
"collapsed": false
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/titanic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"execution_count": null,
"outputs": [],
"source": [
"titanic.schema"
"print(str(titanic.schema))"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -122,7 +122,7 @@
" \"fare\",\n",
" \"survived\"\n",
"])\n",
"titanic_correlation.correlation_heatmap()"
"titanic_correlation.plot_correlation_heatmap()"
],
"metadata": {
"collapsed": false
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ theme:
features:
- content.code.copy
- navigation.tabs
- content.tabs.link
- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.tabs
- navigation.top

plugins:
Expand Down Expand Up @@ -121,6 +123,10 @@ markdown_extensions:
- toc:
permalink: true

# Tabs
- pymdownx.tabbed:
alternate_style: true

extra_javascript:
- javascript/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
Expand Down
Loading

0 comments on commit 17ebf6e

Please sign in to comment.