-
Notifications
You must be signed in to change notification settings - Fork 25
Implement exercise T6L2/branch-compare #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement exercise T6L2/branch-compare #115
Conversation
|
@lavanyagarg112 Can you mark this pull request as "open" instead of "draft"? |
@VikramGoyal23 Sorry for the delay, just have to fix a few bugs. Will open by the weekend. Thanks! |
jovnc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests and verification logic LGTM, but some changes are needed so that we can follow conventions in this repository.
Thanks for your contribution @lavanyagarg112, once the changes are made, do ping me for a re-review and we can merge the PR
| }, | ||
| "exercise_repo": { | ||
| "repo_type": "local", | ||
| "repo_name": "data_streams", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "repo_name": "data_streams", | |
| "repo_name": "data-streams", |
|
|
||
| ## Task | ||
|
|
||
| You are recording a numerical data stream from two sources. The data are stored in `data.txt`, using a different branch for each stream. The two data streams are supposed to be identical but can vary on rare occasions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be above Task
|
|
||
| Answer the questions given in `answers.txt`. | ||
|
|
||
| Run `gitmastery verify` to check if your answers are correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Run `gitmastery verify` to check if your answers are correct. |
We can remove this line
| @@ -0,0 +1,5 @@ | |||
| Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2? | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2? | |
| Q: Which numbers are present in stream-1 but not in stream-2? |
Should align with questions in issue
| Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2? | ||
| A: | ||
|
|
||
| Q: Which number (write only one number) is present in branch stream-2 but not in branch stream-1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Q: Which number (write only one number) is present in branch stream-2 but not in branch stream-1? | |
| Q: Which numbers are present in stream-2 but not in stream-1? |
| commit("Add empty data.txt", verbose) | ||
| checkout("stream-1", True, verbose) | ||
|
|
||
| for i in orig_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it would be more efficient to create the entire string first using join, then append only once to the file to prevent too many OS syscalls
|
|
||
| add(["data.txt"], verbose) | ||
| commit("Add data to data.txt", verbose) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| checkout("main", False, verbose) | ||
| checkout("stream-2", True, verbose) | ||
|
|
||
| for i in modified_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| from git_autograder.answers.rules import HasExactValueRule, NotEmptyRule | ||
|
|
||
|
|
||
| QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?" | |
| QUESTION_ONE = "Which numbers are present in stream-1 but not in stream-2?" |
|
|
||
|
|
||
| QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?" | ||
| QUESTION_TWO = "Which number (write only one number) is present in branch stream-2 but not in branch stream-1?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| QUESTION_TWO = "Which number (write only one number) is present in branch stream-2 but not in branch stream-1?" | |
| QUESTION_TWO = "Which numbers are present in stream-2 but not in stream-1?" |
Exercise Review
Exercise Discussion
#69
Checklist
Git-Masteryorganization, have you created a request for it?repo-smithto validate the exercise grading scheme?test-download.sh?git-autograder?app?