Collaborative git
| Previous: Solo git | Next: Functions, namespace, memory management |
Required course material for the lesson
Powerpoint: Git
Optional - do you want to know more
Online: Coderefinery's introduction to git This is one of many git resources on the net.
Online: Markdown guide
Online: CI/CD - Continuous Integration and Continuous Delivery. It’s a DevOps practice used with GitHub/GitLab.
Resource: Example code - parsing command line options
Subjects covered
- GitHub - inviting people to your repo
- Git - branching, merging
Exercises to be handed in
Do the exercises in Python where applicable. Use git to track changes. Make one program per exercise (if relevant). Commit at least once per solved exercise - more often if you feel it relevant. At the end push everything to GitHub or more frequently if that is your pleasure - backup is nice. You gather all exercises into one file and hand that in on DTU Learn, hint cat in Unix. This is going to be the way we operate for large parts of the course.
Create a new private repository for your collaborative exercises for this single lesson on GitHub as described in the powerpoint. You can choose whatever name you like for the repository. Form a little group, preferably a group of two, but max three if a person is left out. Invite your fellow group member(s) to your repository. You are to "share" repositories.
A less exciting alternative to forming a small group, is to create two local repos of your GitHub repository as shown in the powerpoint. You will then have to pretend to be two persons working together. However, you will have an opportunity to test more things with git and how it works as you have full control.
Generally the hand-in to each exercise is the program you made/fixed/updated, plus the git commands you used to manage the repo. This can be be made in one file with comments.
- Copy exercise 9 from last week into your new repository and introduce an error in the exercise. Make it a real algorithm error, not just a syntax error.
- Now switch with the other person: Download his/hers repo, fix the error, push it back to the repo.
- First read and understand the Example code - parsing command line options. Now you have to make a program that can work with options. As more options are going to be added as the exercises progresses, better be smart and systematic about it from the beginning. The file input to this program will always be a tab-separated file, like ex1.dat. Make a program stat.py which takes a file name from the command line. There may be an option '-c <positiveinteger>' that denotes a column name in the file.
br> - Change exercise 2 in the following way: There is an input file, negative_list.txt, which is a list of genes which can NOT be part of the output. They are banned from your analysis. As can be seen, the genes are identified by their swissprot id. In order to translate from swissprot id to accession number so you can relate it to the scores.txt, you must use the input file translation.txt, where the first item on the line is a accession number, second item is the corresponding swissprot id.