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

Commit

Permalink
feat: update metadata and project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Apr 26, 2024
1 parent eda940a commit 5f33362
Show file tree
Hide file tree
Showing 21 changed files with 1,366 additions and 1,301 deletions.
2,599 changes: 1,332 additions & 1,267 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[tool.poetry]
name = "safe-ds-examples"
version = "0.17.1"
description = "Ready-to-use examples for the Safe-DS Python library."
name = "safe-ds-datasets"
version = "0.18.0"
description = "Ready-to-use datasets for the Safe-DS Python library."
license = "MIT"
authors = ["Lars Reimann <[email protected]>"]
readme = "docs/README.md"
repository = "https://github.com/Safe-DS/Library-Examples"
documentation = "https://library-examples.safe-ds.com"
keywords = ["data-science", "machine-learning", "usability", "learnability"]
repository = "https://github.com/Safe-DS/Datasets"
documentation = "https://datasets.safe-ds.com"
keywords = ["data-science", "datasets", "machine-learning"]
packages = [
{ include = "safeds_examples", from = "src" },
{ include = "safeds_datasets", from = "src" },
]

[tool.poetry.dependencies]
python = "^3.11,<3.12"
python = "^3.11,<3.13"
safe-ds = ">=0.17,<0.22"

[tool.poetry.group.dev.dependencies]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from safeds.data.tabular.containers import Table

from safeds_examples.tabular.containers import ExampleTable
from safeds_datasets.tabular.containers import TabularDataset

_path = Path(__file__).parent / "data" / "house_sales.csv"


def load_house_sales() -> ExampleTable:
def load_house_sales() -> TabularDataset:
"""
Load the "House Sales" dataset.
Expand All @@ -16,7 +16,7 @@ def load_house_sales() -> ExampleTable:
house_sales :
The "House Sales" dataset.
"""
return ExampleTable(
return TabularDataset(
Table.from_csv_file(str(_path)),
column_descriptions={
"id": "A unique identifier",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from safeds.data.tabular.containers import Table

from safeds_examples.tabular.containers import ExampleTable
from safeds_datasets.tabular.containers import TabularDataset

_path = Path(__file__).parent / "data" / "titanic.csv"


def load_titanic() -> ExampleTable:
def load_titanic() -> TabularDataset:
"""
Load the "Titanic" dataset.
Expand All @@ -16,7 +16,7 @@ def load_titanic() -> ExampleTable:
titanic :
The "Titanic" dataset.
"""
return ExampleTable(
return TabularDataset(
Table.from_csv_file(str(_path)),
column_descriptions={
"id": "A unique identifier",
Expand Down
5 changes: 5 additions & 0 deletions src/safeds_datasets/tabular/containers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Classes that can store tabular data."""

from ._tabular_dataset import TabularDataset

__all__ = ["TabularDataset"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from safeds.exceptions import UnknownColumnNameError


class ExampleTable(Table):
class TabularDataset(Table):
"""
A `Table` with descriptions for its columns.
Expand Down
5 changes: 0 additions & 5 deletions src/safeds_examples/tabular/containers/__init__.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from safeds.data.tabular.containers import Table
from safeds.data.tabular.typing import Integer, RealNumber, Schema
from safeds_examples.tabular import load_house_sales
from safeds_datasets.tabular import load_house_sales


class TestLoadHouseSales:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from safeds.data.tabular.containers import Table
from safeds.data.tabular.typing import Anything, Integer, RealNumber, Schema, String
from safeds_examples.tabular import load_titanic
from safeds_datasets.tabular import load_titanic


class TestLoadTitanic:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import pytest
from safeds.data.tabular.containers import Column, Table
from safeds.exceptions import UnknownColumnNameError
from safeds_examples.tabular.containers import ExampleTable
from safeds_datasets.tabular.containers import TabularDataset


@pytest.fixture()
def example_table() -> ExampleTable:
return ExampleTable(
def tabular_dataset() -> TabularDataset:
return TabularDataset(
Table.from_columns(
[
Column("a", [1, 2, 3]),
Expand All @@ -20,7 +20,7 @@ def example_table() -> ExampleTable:
class TestInit:
def test_should_raise_if_column_does_not_exist(self) -> None:
with pytest.raises(UnknownColumnNameError):
ExampleTable(
TabularDataset(
Table.from_columns(
[
Column("a", [1, 2, 3]),
Expand All @@ -32,8 +32,8 @@ def test_should_raise_if_column_does_not_exist(self) -> None:


class TestColumnDescriptions:
def test_should_map_column_names_to_descriptions(self, example_table: ExampleTable) -> None:
assert example_table.column_descriptions == Table.from_columns(
def test_should_map_column_names_to_descriptions(self, tabular_dataset: TabularDataset) -> None:
assert tabular_dataset.column_descriptions == Table.from_columns(
[
Column("Name", ["a", "b"]),
Column("Description", ["The first column", ""]),
Expand All @@ -42,12 +42,12 @@ def test_should_map_column_names_to_descriptions(self, example_table: ExampleTab


class TestGetColumnDescription:
def test_should_return_description_for_column(self, example_table: ExampleTable) -> None:
assert example_table.get_column_description("a") == "The first column"
def test_should_return_description_for_column(self, tabular_dataset: TabularDataset) -> None:
assert tabular_dataset.get_column_description("a") == "The first column"

def test_should_return_empty_string_if_no_description_exists(self, example_table: ExampleTable) -> None:
assert example_table.get_column_description("b") == ""
def test_should_return_empty_string_if_no_description_exists(self, tabular_dataset: TabularDataset) -> None:
assert tabular_dataset.get_column_description("b") == ""

def test_should_raise_error_if_column_does_not_exist(self, example_table: ExampleTable) -> None:
def test_should_raise_error_if_column_does_not_exist(self, tabular_dataset: TabularDataset) -> None:
with pytest.raises(UnknownColumnNameError):
example_table.get_column_description("c")
tabular_dataset.get_column_description("c")

0 comments on commit 5f33362

Please sign in to comment.