From 8df0d48ab8b10d7e3544407fa9a95e56b0c1fc6d Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Sat, 4 Mar 2023 12:44:10 +0100 Subject: [PATCH 1/2] docs: fix generation of reference pages --- .../generate_reference_pages.py | 7 ++++--- docs/{Tutorials => tutorials}/README.md | 0 .../data_processing.md | 0 .../machine_learning.md | 0 .../resources/boxplot.png} | Bin .../resources/heatmap.png} | Bin .../resources/histogram.png} | Bin .../resources/lineplot.png} | Bin .../resources/scatterplot.png} | Bin .../resources/summary.png} | Bin .../resources/table.png} | Bin .../{Tutorials => tutorials}/visualization.md | 18 +++++++++--------- 12 files changed, 13 insertions(+), 12 deletions(-) rename docs/{Reference => reference}/generate_reference_pages.py (88%) rename docs/{Tutorials => tutorials}/README.md (100%) rename docs/{Tutorials => tutorials}/data_processing.md (100%) rename docs/{Tutorials => tutorials}/machine_learning.md (100%) rename docs/{Tutorials/Resources/Boxplot.png => tutorials/resources/boxplot.png} (100%) rename docs/{Tutorials/Resources/Heatmap.png => tutorials/resources/heatmap.png} (100%) rename docs/{Tutorials/Resources/Histogram.png => tutorials/resources/histogram.png} (100%) rename docs/{Tutorials/Resources/Lineplot.png => tutorials/resources/lineplot.png} (100%) rename docs/{Tutorials/Resources/Scatterplot.png => tutorials/resources/scatterplot.png} (100%) rename docs/{Tutorials/Resources/Summary.png => tutorials/resources/summary.png} (100%) rename docs/{Tutorials/Resources/Table.png => tutorials/resources/table.png} (100%) rename docs/{Tutorials => tutorials}/visualization.md (83%) diff --git a/docs/Reference/generate_reference_pages.py b/docs/reference/generate_reference_pages.py similarity index 88% rename from docs/Reference/generate_reference_pages.py rename to docs/reference/generate_reference_pages.py index eca4f49bf..3439c6554 100644 --- a/docs/Reference/generate_reference_pages.py +++ b/docs/reference/generate_reference_pages.py @@ -20,10 +20,11 @@ def list_class_and_function_names_in_module(module_name: str) -> list[str]: nav = mkdocs_gen_files.Nav() +root = "src" -for path in sorted(Path("Runtime/safe-ds").rglob("__init__.py")): - module_path = path.relative_to("Runtime/safe-ds").with_suffix("") - doc_path = path.relative_to("Runtime/safe-ds").with_suffix(".md") +for path in sorted(Path(root).rglob("__init__.py")): + module_path = path.relative_to(root).with_suffix("") + doc_path = path.relative_to(root).with_suffix(".md") full_doc_path = Path("reference", doc_path) # Skip demos, tests, etc. diff --git a/docs/Tutorials/README.md b/docs/tutorials/README.md similarity index 100% rename from docs/Tutorials/README.md rename to docs/tutorials/README.md diff --git a/docs/Tutorials/data_processing.md b/docs/tutorials/data_processing.md similarity index 100% rename from docs/Tutorials/data_processing.md rename to docs/tutorials/data_processing.md diff --git a/docs/Tutorials/machine_learning.md b/docs/tutorials/machine_learning.md similarity index 100% rename from docs/Tutorials/machine_learning.md rename to docs/tutorials/machine_learning.md diff --git a/docs/Tutorials/Resources/Boxplot.png b/docs/tutorials/resources/boxplot.png similarity index 100% rename from docs/Tutorials/Resources/Boxplot.png rename to docs/tutorials/resources/boxplot.png diff --git a/docs/Tutorials/Resources/Heatmap.png b/docs/tutorials/resources/heatmap.png similarity index 100% rename from docs/Tutorials/Resources/Heatmap.png rename to docs/tutorials/resources/heatmap.png diff --git a/docs/Tutorials/Resources/Histogram.png b/docs/tutorials/resources/histogram.png similarity index 100% rename from docs/Tutorials/Resources/Histogram.png rename to docs/tutorials/resources/histogram.png diff --git a/docs/Tutorials/Resources/Lineplot.png b/docs/tutorials/resources/lineplot.png similarity index 100% rename from docs/Tutorials/Resources/Lineplot.png rename to docs/tutorials/resources/lineplot.png diff --git a/docs/Tutorials/Resources/Scatterplot.png b/docs/tutorials/resources/scatterplot.png similarity index 100% rename from docs/Tutorials/Resources/Scatterplot.png rename to docs/tutorials/resources/scatterplot.png diff --git a/docs/Tutorials/Resources/Summary.png b/docs/tutorials/resources/summary.png similarity index 100% rename from docs/Tutorials/Resources/Summary.png rename to docs/tutorials/resources/summary.png diff --git a/docs/Tutorials/Resources/Table.png b/docs/tutorials/resources/table.png similarity index 100% rename from docs/Tutorials/Resources/Table.png rename to docs/tutorials/resources/table.png diff --git a/docs/Tutorials/visualization.md b/docs/tutorials/visualization.md similarity index 83% rename from docs/Tutorials/visualization.md rename to docs/tutorials/visualization.md index b9e43d334..e67abe2f5 100644 --- a/docs/Tutorials/visualization.md +++ b/docs/tutorials/visualization.md @@ -16,18 +16,18 @@ data = Table.from_csv("path/to/your/data.csv") Now we want to have a look at what our dataset looks like. For this, we use Jupyter Notebooks native display function. ```python -data    # calls display(data) +data # calls display(data) ``` -![Table](./Resources/Table.png) +![Table](docs/tutorials/resources/table.png) Next some statistics. ```python -data.summary()  # returns a table with various statistics for each column +data.summary() # returns a table with various statistics for each column ``` -![Summary](./Resources/Summary.png) +![Summary](docs/tutorials/resources/summary.png) As you can see here, the **idness** of the column _PassengerId_ is 1. This means, that every row has a unique value for this column. Since this isn't helpful for our usecase we can drop it. @@ -48,7 +48,7 @@ data_only_numerics = Table.from_columns(data_cleaned.list_columns_with_numerical correlation_heatmap(data_only_numerics) ``` -![Heatmap](./Resources/Heatmap.png) +![Heatmap](docs/tutorials/resources/heatmap.png) As you can see, the columns _Fare_ and _Pclass_ (Passenger Class) seem to heavily correlate. Let's have another look at that. ## Lineplot @@ -59,7 +59,7 @@ from safeds.plotting import lineplot lineplot(data_cleaned, "Pclass", "Fare") ``` -![Lineplot](./Resources/Lineplot.png) +![Lineplot](docs/tutorials/resources/lineplot.png) The line itself represents the central tendency and the hued area around it a confidence interval for that estimate. @@ -75,14 +75,14 @@ from safeds.plotting import boxplot boxplot(data_cleaned.get_column("Age")) ``` -![Boxplot](./Resources/Boxplot.png) +![Boxplot](docs/tutorials/resources/boxplot.png) ```python from safeds.plotting import histogram histogram(data_cleaned.get_column("Fare")) ``` -![Histogram](./Resources/Histogram.png) +![Histogram](docs/tutorials/resources/histogram.png) ```python from safeds.plotting import scatterplot @@ -90,4 +90,4 @@ from safeds.plotting import scatterplot scatterplot(data_cleaned, "Age", "Fare") ``` -![Scatterplot](./Resources/Scatterplot.png) +![Scatterplot](docs/tutorials/resources/scatterplot.png) From 85924867d159641201f606b0ea0550c786a10f69 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Sat, 4 Mar 2023 12:52:30 +0100 Subject: [PATCH 2/2] docs: fix dead links --- docs/tutorials/visualization.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/tutorials/visualization.md b/docs/tutorials/visualization.md index e67abe2f5..ada019936 100644 --- a/docs/tutorials/visualization.md +++ b/docs/tutorials/visualization.md @@ -19,7 +19,7 @@ Now we want to have a look at what our dataset looks like. For this, we use Jupy data # calls display(data) ``` -![Table](docs/tutorials/resources/table.png) +![Table](resources/table.png) Next some statistics. @@ -27,7 +27,7 @@ Next some statistics. data.summary() # returns a table with various statistics for each column ``` -![Summary](docs/tutorials/resources/summary.png) +![Summary](resources/summary.png) As you can see here, the **idness** of the column _PassengerId_ is 1. This means, that every row has a unique value for this column. Since this isn't helpful for our usecase we can drop it. @@ -48,7 +48,7 @@ data_only_numerics = Table.from_columns(data_cleaned.list_columns_with_numerical correlation_heatmap(data_only_numerics) ``` -![Heatmap](docs/tutorials/resources/heatmap.png) +![Heatmap](resources/heatmap.png) As you can see, the columns _Fare_ and _Pclass_ (Passenger Class) seem to heavily correlate. Let's have another look at that. ## Lineplot @@ -59,7 +59,7 @@ from safeds.plotting import lineplot lineplot(data_cleaned, "Pclass", "Fare") ``` -![Lineplot](docs/tutorials/resources/lineplot.png) +![Lineplot](resources/lineplot.png) The line itself represents the central tendency and the hued area around it a confidence interval for that estimate. @@ -75,14 +75,14 @@ from safeds.plotting import boxplot boxplot(data_cleaned.get_column("Age")) ``` -![Boxplot](docs/tutorials/resources/boxplot.png) +![Boxplot](resources/boxplot.png) ```python from safeds.plotting import histogram histogram(data_cleaned.get_column("Fare")) ``` -![Histogram](docs/tutorials/resources/histogram.png) +![Histogram](resources/histogram.png) ```python from safeds.plotting import scatterplot @@ -90,4 +90,4 @@ from safeds.plotting import scatterplot scatterplot(data_cleaned, "Age", "Fare") ``` -![Scatterplot](docs/tutorials/resources/scatterplot.png) +![Scatterplot](resources/scatterplot.png)