- Create a new github repository, check all marks:
- gitignore,
- license,
- README.
- Clone the repository on your computer
- Write docstring for the function
- Organize code as a package:
folder/code/functions.py, and add an__init__.pyfile, in which only the version is present. - At the root, write a
pyproject.tomlfunction that will allow to install the package, and then dopip install -e.. This should not return errors. - In the code folder, create a
testsfolder, atest_linear_regression.pyfile in it and write several test functions, with names starting withtest_. Then, runpytestat the root file. All tests should pass. - Check that the code is compatible with pep 8 using the command
ruff, this can be installed usingpip install ruff. - Upload everything on github by first adding all new files using
git add ..., then commiting by usinggit commit -am(write a message here) and thengit push. Check on github that the new code is here.
- At the root, create an
examplesfolder. In this folder, create a functionplot_simple_examplein which you write a small example of what the linear regression code can do. - Add some plots using matplotlib.
- Create an empty branch
gh-pageson you repo
git stash
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "INIT gh-pages branch"
git push -u origin gh-pages
git checkout main
git stash pop- In the settings, activate the the doc rendering options.
- Add a
.github/workflowsfolder at the root, and write aunittests.ymlfile in it that runs continuous integration on github. This should run theruffand unit tests command, everytime there is a push on the main github branch, or that somebody does a pull request
-
By pair, fork the github repository of one of the other student, create a new branch using
git checkout -b branch-name, then implement regularized linear regression in thelinear_regression/linear_regression.pyfile. Then, commit your changes, push the branch on github, and do a pull request on the other students' repo. -
Check that the continuous integration tests are run, and that everything it ok. Then, merge the pull request.