forked from MIT-Emerging-Talent/ET6-practice-code-review
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 27-binary_to_decimal_converter
- Loading branch information
Showing
6 changed files
with
160 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
# Notes | ||
|
||
## Meeting Notes and Task Assignments | ||
|
||
### First Meeting | ||
|
||
- **Introductions**: | ||
- Members introduced themselves and shared their locations. | ||
- **Discussion**: | ||
- Assignment to practice document formatting. | ||
- Task: Comment on a single topic — **Preparing Group Norms**. | ||
- **Outcome**: | ||
- Gained familiarity with document file commenting using instructions from Evan. | ||
|
||
--- | ||
|
||
### Transition to GitHub Format | ||
|
||
- **Reason**: | ||
- After mastering the document file format, decided to transition to GitHub for task management and creating branches to represent specific tasks. | ||
- **Second Meeting**: | ||
- Discussed specific tasks and group assignments. | ||
|
||
--- | ||
|
||
### Task Assignments and Reviews | ||
|
||
1. **Group Norms**: | ||
- **Task Members**: Abel and Banchiamlak | ||
- Modified the file and pushed it to GitHub. | ||
- **Reviewers**: Gai and Yonatan | ||
|
||
2. **Communication File**: | ||
- **Task Members**: Robel and Zeinab | ||
- Prepared the file and submitted it for review. | ||
- **Reviewers**: Viktoriya and Mohammed | ||
|
||
3. **Learning Objectives**: | ||
- **Task Members**: Viktoriya and Mohammed | ||
- Prepared the file and marked it as done on the project table. | ||
- **Reviewers**: Linah and Khusro | ||
|
||
4. **Retrospective Task**: | ||
- **Task Members**: Gai and Yonatan | ||
- Waited for all other tasks to complete before preparing the file. | ||
- **Reviewers**: Abel and Banchiamlak | ||
|
||
--- | ||
|
||
### Post-Task Activities | ||
|
||
- Played with other files, including the **README** file. | ||
|
||
--- | ||
|
||
### Future Plans | ||
|
||
- **Scheduling**: | ||
- Plan tasks for the upcoming week. | ||
- Prepare a **solutions schedule** for future assignments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Cheat Sheets that can help 📚 | ||
|
||
--- | ||
|
||
## These **cheat sheets** cover key topics and best practices that we might encounter in our work | ||
|
||
- [VS Code Cheat Sheet](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf) ⚡ | ||
- [Python Cheat Sheet](https://kieranholland.com/best-python-cheat-sheet/) 🐍 | ||
|
||
### Feel free to add yours ➕📝 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
A module for sorting a list of numbers. | ||
Module contents: sorted list of numbers | ||
Created on 2024-12-30 | ||
@author: Viktoriya Haiduk | ||
""" | ||
|
||
|
||
def sort_numbers(numbers: list) -> list: | ||
""" | ||
Sorts a list of numbers. | ||
Parameters: | ||
numbers (list): A list of numbers to be sorted. | ||
- May contain integers or floats. | ||
- Must not contain non-numeric values. | ||
Returns -> list: Sorted list of numbers in ascending order. | ||
Raises: ValueError if the list is empty or contains non-numeric values. | ||
Examples: | ||
>>> sort_numbers([3, 1, 2]) | ||
[1, 2, 3] | ||
>>> sort_numbers([4.5, 15.4, 6, 7, 2]) | ||
[2, 4.5, 6, 7, 15.4] | ||
>>> sort_numbers([3.14159, 1.618, 2.718]) | ||
[1.618, 2.718, 3.14159] | ||
""" | ||
if not isinstance(numbers, list): | ||
raise ValueError("Input must be a list.") | ||
|
||
if not numbers: | ||
raise ValueError("The list is empty. Please provide numbers to sort.") | ||
|
||
if not all(isinstance(num, (int, float)) for num in numbers): | ||
raise ValueError("The list contains non-numeric values.") | ||
|
||
return sorted(numbers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
Test module for sort_numbers function. | ||
Contains tests for testing sort_numbers function. | ||
Created on 2024-12-30 | ||
Author: Viktoriya Haiduk | ||
""" | ||
|
||
import unittest | ||
|
||
from solutions.sort_numbers import sort_numbers | ||
|
||
|
||
class TestSortNumbers(unittest.TestCase): | ||
def test_sorted_numbers(self): | ||
self.assertEqual(sort_numbers([4, 1, 3, 2]), [1, 2, 3, 4]) | ||
|
||
def test_floats(self): | ||
self.assertEqual(sort_numbers([4.5, 2.3, 1.7, 3.9]), [1.7, 2.3, 3.9, 4.5]) | ||
|
||
def test_mixed_numbers(self): | ||
self.assertEqual(sort_numbers([4, 2.5, 3, 1.2]), [1.2, 2.5, 3, 4]) | ||
|
||
def test_invalid_input(self): | ||
with self.assertRaises(ValueError) as context: | ||
sort_numbers(["a", None, 3]) | ||
self.assertEqual( | ||
str(context.exception), "The list contains non-numeric values." | ||
) | ||
|
||
def test_empty_list(self): | ||
with self.assertRaises(ValueError) as context: | ||
sort_numbers([]) | ||
self.assertEqual( | ||
str(context.exception), "The list is empty. Please provide numbers to sort." | ||
) | ||
|
||
def test_negative_numbers(self): | ||
self.assertEqual(sort_numbers([-3, -1, -4, -2]), [-4, -3, -2, -1]) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |