diff --git a/_modules.qmd b/_modules.qmd index 4ea8642..bf2afdd 100644 --- a/_modules.qmd +++ b/_modules.qmd @@ -1,14 +1,14 @@ 1. [Git, Pull Requests, and code reviews](01_version_control.qmd) + * [Homework](projects/data_cleaning/Project_module_01.md) 2. [Python functions, classes, and modules](02_function_classes.qmd) + * [Homework](projects/data_cleaning/Project_module_02.md) 3. [Testing and auto-formatting](03_testing.qmd) + * [Homework](projects/data_cleaning/Project_module_03.md) 3. [Dependencies and GitHub actions](04_dependencies_ci.qmd) + * [Homework](projects/data_cleaning/Project_module_04.md) 4. [Documentation](05_documentation.qmd) + * [Homework](projects/data_cleaning/Project_module_05.md) 6. [Object oriented design in Python](06_oop.qmd) + * [Homework](projects/data_cleaning/Project_module_06.md) 7. [Distributing your package](07_packaging.qmd) - - -## Include files - -Are you using the same content in many documents, presentations and reports? - -Have you considered to use include files? \ No newline at end of file + * [Homework](projects/data_cleaning/Project_module_07.md) \ No newline at end of file diff --git a/projects/data_cleaning/Project_module_05.md b/projects/data_cleaning/Project_module_05.md index b1be10e..d54d10c 100644 --- a/projects/data_cleaning/Project_module_05.md +++ b/projects/data_cleaning/Project_module_05.md @@ -1,21 +1,16 @@ -## Module 5: Object-oriented design +## Module 6: Documentation -- Create new branch "oop-dataclasses" (Make sure changes from last module have been merged, and that you start from the main branch) -- 5.1 Type Hints - - Add type hints to all functions and methods. Commit -- 5.2 Data class - - Make all the cleaner classes dataclasses. - - remove the init method (not needed anymore) - - Check that the notebook still runs and that the classes indeed work as data classes (e.g. have a string representation and support equality testing etc) - - Commit -- 5.3 Module level function - - Make a private module function _print_stats() that prints the number of cleaned values - - call from each of the clean methods -- 5.4 Composition or inheritance - - Create a new cleaner class called CleanerWorkflow that takes a list of cleaners when constructed and has a clean method that run all the cleaners' clean methods. - - Modify the notebook to use the CleanerWorkflow instead of looping over the cleaners - - Consider what type of validation you would want CleanerWorkflow - - Consider whether it would be better to create a base class BaseCleaner - write down your considerations as a comment in the pull request, refer to specific lines of code - - e.g. how would you handle e.g. common plotting functionality in the cleaner classes? +- Create new branch "docs" (Make sure changes from last module have been merged, and that you start from the main branch) +- 6.1 README + - Write a README file with basic information about the project. +- 6.2 Docstrings + - Write NumPy style docstrings for all functions and classes. + - [Optional] Install the autodocstrings extension in VSCode (set the style to NumPy) +- 6.3 mkdocs + - Install mkdocs, mkdocstrings and material design `mamba/pip install mkdocstrings-python mkdocs-material` + - Create a `mkdocs.yml` file (copy from https://github.com/DHI/template-python-library and adapt). + - Create a docs folder and create a markdown file `index.md` inside. + - Create API documentation locally using `>mkdocs serve`. + - Check the generated HTML documentation. - Create pull request in GitHub and "request review" from your reviewers - Get feedback, Adjust code until approval, then merge (and delete branch) \ No newline at end of file diff --git a/projects/data_cleaning/Project_module_06.md b/projects/data_cleaning/Project_module_06.md index d54d10c..b1be10e 100644 --- a/projects/data_cleaning/Project_module_06.md +++ b/projects/data_cleaning/Project_module_06.md @@ -1,16 +1,21 @@ -## Module 6: Documentation +## Module 5: Object-oriented design -- Create new branch "docs" (Make sure changes from last module have been merged, and that you start from the main branch) -- 6.1 README - - Write a README file with basic information about the project. -- 6.2 Docstrings - - Write NumPy style docstrings for all functions and classes. - - [Optional] Install the autodocstrings extension in VSCode (set the style to NumPy) -- 6.3 mkdocs - - Install mkdocs, mkdocstrings and material design `mamba/pip install mkdocstrings-python mkdocs-material` - - Create a `mkdocs.yml` file (copy from https://github.com/DHI/template-python-library and adapt). - - Create a docs folder and create a markdown file `index.md` inside. - - Create API documentation locally using `>mkdocs serve`. - - Check the generated HTML documentation. +- Create new branch "oop-dataclasses" (Make sure changes from last module have been merged, and that you start from the main branch) +- 5.1 Type Hints + - Add type hints to all functions and methods. Commit +- 5.2 Data class + - Make all the cleaner classes dataclasses. + - remove the init method (not needed anymore) + - Check that the notebook still runs and that the classes indeed work as data classes (e.g. have a string representation and support equality testing etc) + - Commit +- 5.3 Module level function + - Make a private module function _print_stats() that prints the number of cleaned values + - call from each of the clean methods +- 5.4 Composition or inheritance + - Create a new cleaner class called CleanerWorkflow that takes a list of cleaners when constructed and has a clean method that run all the cleaners' clean methods. + - Modify the notebook to use the CleanerWorkflow instead of looping over the cleaners + - Consider what type of validation you would want CleanerWorkflow + - Consider whether it would be better to create a base class BaseCleaner - write down your considerations as a comment in the pull request, refer to specific lines of code + - e.g. how would you handle e.g. common plotting functionality in the cleaner classes? - Create pull request in GitHub and "request review" from your reviewers - Get feedback, Adjust code until approval, then merge (and delete branch) \ No newline at end of file