Skip to content

Commit

Permalink
Update numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmariegaard committed Nov 1, 2023
1 parent 6f243e5 commit 0df625e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions projects/data_cleaning/Project_module_03.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Create new branch "package-test" (Make sure changes from last module have been merged, and that you start from the main branch)
- Make sure pytest and pytest-cov are installed
- 3.1 Installable package
- 4.1 Organize the files into folders and add setup.py. Call your package tscleaner.
- 3.1.1 Organize the files into folders and add setup.py. Call your package tscleaner.
- subfolders: tscleaner, scripts, notebooks, tests
- make init-file in tscleaner with
- `from .cleaning import SpikeCleaner, FlatPeriodCleaner, OutOfRangeCleaner`
Expand All @@ -20,16 +20,16 @@
packages=find_packages(),
install_requires=['numpy', 'matplotlib'],
)
- 4.2 Install the package in editable mode.
- 3.1.2 Install the package in editable mode.
- `>pip install -e .`
- 4.3 Modify import statements in notebook_A and script main.py and make sure they run.
- 4.4 Modify cleaner tools by raising exceptions for invalid inputs.
- 4.5 Move the csv file to `/tests/testdata` and update notebook with relative path to the file
- 3.1.3 Modify import statements in notebook_A and script main.py and make sure they run.
- 3.1.4 Modify cleaner tools by raising exceptions for invalid inputs.
- 3.1.5 Move the csv file to `/tests/testdata` and update notebook with relative path to the file
- 3.2 Pytest
- 4.2.1 Write unit tests with pytest in the `/tests` folder. Create an empty init-py file in the folder. Create a file `test_cleaning.py` and create at least five tests that verify that the cleaning tools work as intended
- 3.2.1 Write unit tests with pytest in the `/tests` folder. Create an empty init-py file in the folder. Create a file `test_cleaning.py` and create at least five tests that verify that the cleaning tools work as intended
- [Optional] Consider to make a fixture that reads the csv file and you can read in all tests
- 4.2.2 Run the tests from the commandline by writting `>pytest` in the project root (can you also run the tests from VSCode?)
- 4.2.3 Assess the test coverage with `>pytest --cov=tscleaner tests`
- 3.2.2 Run the tests from the commandline by writting `>pytest` in the project root (can you also run the tests from VSCode?)
- 3.2.3 Assess the test coverage with `>pytest --cov=tscleaner tests`
- Optional: Get coverage as html with `>pytest --cov=tscleaner --cov-report html` (check the index.html in the htmlcov subfolder afterwards)
- Create pull request in GitHub and "request review" from your reviewers
- Get feedback, Adjust code until approval, then merge (and delete branch)
24 changes: 12 additions & 12 deletions projects/data_cleaning/Project_module_04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

- Create new branch "action-formatting" (Make sure changes from last module have been merged, and that you start from the main branch)
- 4.1 Github Action
- 5.1.1 Copy the GitHub action "python-app.yml" from the python template https://github.com/DHI/template-python-library to your own library (make sure it sits in the same folder).
- 5.1.2 Change all occurrences of "my_library" in the yml file to your package name "tscleaner"
- 5.1.3 Comment out the line with "ruff-action" with "#"
- 5.1.4 Commit, push and create a pull request; the tests should now run, verify that they all run before you move on
- 4.1.1 Copy the GitHub action "python-app.yml" from the python template https://github.com/DHI/template-python-library to your own library (make sure it sits in the same folder).
- 4.1.2 Change all occurrences of "my_library" in the yml file to your package name "tscleaner"
- 4.1.3 Comment out the line with "ruff-action" with "#"
- 4.1.4 Commit, push and create a pull request; the tests should now run, verify that they all run before you move on
- 4.2 Ruff
- 5.2.1 Enable the "ruff-action" be removing the "#" you added above
- 5.2.2 Commit and push, your actions will probably fail now - inspect the problems by clicking the red cross (did you also get an email?)
- 5.2.3 Install "ruff" on your local machine with mamba/conda/pip
- 5.2.4 Navigate to your project root folder and run ruff with "ruff ."
- 5.2.5 Add `__all__ = ["SpikeCleaner", "FlatPeriodCleaner", "OutOfRangeCleaner", "plot_timeseries"]` to your `__init__.py` file and fix remaining issues until ruff passes
- 5.2.6 Commit, push and verify that you action now succeeds
- 4.2.1 Enable the "ruff-action" be removing the "#" you added above
- 4.2.2 Commit and push, your actions will probably fail now - inspect the problems by clicking the red cross (did you also get an email?)
- 4.2.3 Install "ruff" on your local machine with mamba/conda/pip
- 4.2.4 Navigate to your project root folder and run ruff with "ruff ."
- 4.2.5 Add `__all__ = ["SpikeCleaner", "FlatPeriodCleaner", "OutOfRangeCleaner", "plot_timeseries"]` to your `__init__.py` file and fix remaining issues until ruff passes
- 4.2.6 Commit, push and verify that you action now succeeds
- 4.3 Black
- 5.3.1 Install "black" on your local machine with mamba/conda/pip
- 5.3.2 Run black from your project root folder; inspect the differences; commit
- 4.3.1 Install "black" on your local machine with mamba/conda/pip
- 4.3.2 Run black from your project root folder; inspect the differences; commit
- 4.4 pyproject.toml
- Copy the pyproject.toml from the python template https://github.com/DHI/template-python-library (this file will replace your setup.py)
- Modify to fit your package
Expand Down

0 comments on commit 0df625e

Please sign in to comment.