Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

build(deps): bump safe-ds from 0.21.0 to 0.26.0 #169

Merged
merged 4 commits into from
Jun 17, 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
108 changes: 0 additions & 108 deletions .github/linters/.ruff.toml

This file was deleted.

2 changes: 2 additions & 0 deletions docs/datasets/disable_warnings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Disable output of warnings."""

from __future__ import annotations

import logging
import warnings

Expand Down
44 changes: 14 additions & 30 deletions docs/datasets/display_column_description.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@
"""Display column descriptions."""

import pandas as pd
from IPython.core.display_functions import DisplayHandle
from IPython.display import display
from __future__ import annotations

from IPython.core.display import DisplayObject
from IPython.display import Markdown
from safeds.data.tabular.containers import Table


def display_column_descriptions(column_descriptions: Table) -> DisplayHandle:
def display_column_descriptions(column_descriptions: Table) -> DisplayObject:
"""
Display a Table containing the column descriptions.

Parameters
----------
column_descriptions : Table
column_descriptions:
The column descriptions.

Returns
-------
DisplayHandle
The display handle.
display_object:
The display object.
"""
# Remember the current value of the max_colwidth option
max_colwidth = pd.get_option("max_colwidth")

# Don't cut off the column descriptions
pd.set_option("max_colwidth", None)

# Create a DisplayHandle that displays the column descriptions nicely
styler = (
column_descriptions._data.style.relabel_index(["Name", "Description"], axis="columns")
.hide(axis="index")
.set_properties(
**{
"text-align": "left",
"white-space": "pre-wrap",
},
)
)
result = display(styler)

# Restore the max_colwidth option
pd.set_option("max_colwidth", max_colwidth)

return result
result = ""

for name, description in column_descriptions._data_frame.iter_rows():
result += f"- **{name}:** {description}\n"

return Markdown(result)
16 changes: 5 additions & 11 deletions docs/datasets/house_sales.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"house_sales.slice_rows(end=10)"
],
"source": "house_sales.data.slice_rows(length=10)",
"metadata": {
"collapsed": false
}
Expand All @@ -73,9 +71,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"print(str(house_sales.schema))"
],
"source": "print(str(house_sales.data.schema))",
"metadata": {
"collapsed": false
}
Expand All @@ -93,9 +89,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"house_sales.summarize_statistics()"
],
"source": "house_sales.data.summarize_statistics()",
"metadata": {
"collapsed": false
}
Expand All @@ -114,7 +108,7 @@
"execution_count": null,
"outputs": [],
"source": [
"house_sales_correlation = house_sales.remove_columns([\n",
"house_sales_correlation = house_sales.data.remove_columns([\n",
" \"id\",\n",
" \"year\",\n",
" \"month\",\n",
Expand All @@ -123,7 +117,7 @@
" \"latitude\",\n",
" \"longitude\"\n",
"])\n",
"house_sales_correlation.plot_correlation_heatmap()"
"house_sales_correlation.plot.correlation_heatmap()"
],
"metadata": {
"collapsed": false
Expand Down
16 changes: 5 additions & 11 deletions docs/datasets/titanic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"titanic.slice_rows(end=10)"
],
"source": "titanic.data.slice_rows(length=10)",
"metadata": {
"collapsed": false
}
Expand All @@ -73,9 +71,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"print(str(titanic.schema))"
],
"source": "print(str(titanic.data.schema))",
"metadata": {
"collapsed": false
}
Expand All @@ -93,9 +89,7 @@
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"titanic.summarize_statistics()"
],
"source": "titanic.data.summarize_statistics()",
"metadata": {
"collapsed": false
}
Expand All @@ -114,15 +108,15 @@
"execution_count": null,
"outputs": [],
"source": [
"titanic_correlation = titanic.keep_only_columns([\n",
"titanic_correlation = titanic.data.remove_columns_except([\n",
" \"age\",\n",
" \"siblings_spouses\",\n",
" \"parents_children\",\n",
" \"travel_class\",\n",
" \"fare\",\n",
" \"survived\"\n",
"])\n",
"titanic_correlation.plot_correlation_heatmap()"
"titanic_correlation.plot.correlation_heatmap()"
],
"metadata": {
"collapsed": false
Expand Down
Loading