Skip to content

Commit

Permalink
Link to homework
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Nov 1, 2023
1 parent 2c72f62 commit 4c952d3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
14 changes: 7 additions & 7 deletions _modules.qmd
Original file line number Diff line number Diff line change
@@ -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?
* [Homework](projects/data_cleaning/Project_module_07.md)
31 changes: 13 additions & 18 deletions projects/data_cleaning/Project_module_05.md
Original file line number Diff line number Diff line change
@@ -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)
31 changes: 18 additions & 13 deletions projects/data_cleaning/Project_module_06.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 4c952d3

Please sign in to comment.