Skip to content

Commit

Permalink
Merge branch 'main' into test-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Moealfadil authored Jan 11, 2025
2 parents b1568d3 + 8b398de commit 4221c7d
Show file tree
Hide file tree
Showing 14 changed files with 550 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ about: A template PR for code review with a checklist

- [ ] The function's name describes it's behavior
- [ ] The function's name matches the file name
- _It's ok to have extra helper functions if necessary, like with mergesort_
- [ ] The function has correct type annotations
- [ ] The function is not called at the top level of the function file
- _Recursive solutions **can** call the function from **inside** the function body_
Expand All @@ -69,7 +68,7 @@ about: A template PR for code review with a checklist

### Don'ts

- [ ] The function's strategy _is not_ described in any docstrings or tests
- [ ] The function's strategy _is not_ described in the documentation
- [ ] Comments explain the _strategy_, **not** the _implementation_
- [ ] The function _does not_ have more comments than code
- If it does, consider finding a new strategy or a simpler implementation
Expand Down
75 changes: 75 additions & 0 deletions collaboration/retrospective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-- this template is for inspiration, feel free to change it however you like! -->

# Retrospective: Group 18 - Collaborative Work Activity

## Stop Doing

- **Inefficient Coordination:** Stop relying on informal communication
methods that cause misunderstandings or delays.

- **Overloading Tasks:** Avoid taking on excessive responsibilities
without proper delegation or prioritization.

- **Passive Participation:** Stop being a silent participant in discussions;
ensure to actively contribute to conversations.

## Continue Doing

- **Effective Teamwork:** Continue fostering collaboration by sharing ideas
openly and respecting diverse perspectives.

- **Timely Updates:** Maintain a habit of providing timely progress updates
to keep the team aligned.

- **Using Tools:** Keep leveraging collaborative tools
(e.g., shared documents, project management software) to enhance productivity.

## Start Doing

- **Structured Planning:** Begin creating more detailed action plans with
clear milestones and deadlines.

- **Feedback Loops:** Start implementing regular feedback sessions to
evaluate progress and address challenges early.

- **Skill Development:** Focus on improving specific skills related
to collaborative work and presentation to contribute more effectively.

## Lessons Learned

- Effective communication is crucial to avoid duplication of efforts and ensure alignment.

- Clear roles and responsibilities significantly enhance team productivity.

- Flexibility in strategy allows for better adaptation to unforeseen challenges.

- Regular check-ins help maintain momentum and ensure accountability.

______________________________________________________________________

## Strategy vs. Board

### What parts of your plan went as expected?

- Collaboration tools were effectively utilized to
share resources and coordinate tasks.

- The team successfully met initial deadlines for project deliverables.

- Team members demonstrated a willingness to support each other when challenges arose.

### What parts of your plan did not work out?

- Some tasks were delayed due to unclear task ownership.

- Miscommunication led to redundant efforts in certain areas.

- Time zone differences caused occasional scheduling conflicts.

### Did you need to add things that weren't in your strategy?

- Yes, we added weekly synchronization meetings to
address miscommunications and ensure alignment.

- Included additional training sessions for team members to
improve tool usage efficiency.
9 changes: 9 additions & 0 deletions notes/cheetsheets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 📝 Cheat Sheets That We Can Use

## 🚀 These cheat sheets will cover Python and VS Code

- 🔧 [**VS Code Cheat Sheet**](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf)
— Boost your productivity with essential shortcuts. 🚀

- 🐍 [**Python Cheat Sheet**](https://kieranholland.com/best-python-cheat-sheet/)
— Quickly reference key Python concepts and syntax. ✏️
34 changes: 34 additions & 0 deletions notes/creating_linking_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 🚀 How to create and link an issue to a pull request

## 📝 How to Create an Issue

1. Go to the **Issues** tab. 🐛
2. Click on **New Issue** ➕.
3. Fill out the issue template with all relevant details. 📋
4. Assign labels 🏷️ and add it to the project board 📌.

---

## 🔗 Linking an Issue to a Pull Request

1. Create a branch for your changes. 🌱
2. Make the necessary edits. ✏️
3. Open a Pull Request (PR) 🛠️:
- Use `Fixes #<issue_number>` in the description to close the issue automatically
on merge. ✅
- For example:

```markdown
Fixes #123
```

---

### Link the issue manually if needed

- Go to the **Linked Issues** section in the PR.
- Search for the issue and add it. 🔗

## 📣 Need Help?

If you're stuck, don't hesitate to reach out! 🆘
134 changes: 134 additions & 0 deletions notes/extenstions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# 🚀 Guide: Installing and Running Ruff, Black, Pylint, and MarkdownLint in VS Code

This guide will help you set up and use Ruff, Black, Pylint, and MarkdownLint in
Visual Studio Code (VS Code) to maintain clean and consistent code and Markdown
files and pass all the CI checks.

---

## 🛠️ Prerequisites

Before starting, ensure the following are installed on your system:

- [Python](https://www.python.org/)
- [VS Code](https://code.visualstudio.com/)
- [Node.js](https://nodejs.org/) (for MarkdownLint)

---

## 🔧 Install Extensions in VS Code

1. Open VS Code.
2. Go to the Extensions Marketplace (`Ctrl+Shift+X` or `Cmd+Shift+X` on Mac).
3. Install the following extensions:
- **Python** (by Microsoft)
- **MarkdownLint** (by David Anson)

---

## ⚙️ Setting Up Ruff, Black, and Pylint

### 1️⃣ Install Ruff

Ruff is a fast Python linter and formatter.

```bash
pip install ruff
```

To integrate Ruff with VS Code:

1. Open the VS Code settings (`Ctrl+,` or `Cmd+,` on Mac).
2. Search for `Python › Linting: Enabled` and ensure it is checked.

### 2️⃣ Install Black

Black is a Python code formatter.

```bash
pip install black
```

To use Black in VS Code:

1. Go to the VS Code settings.
2. Search for `Python › Formatting: Provider` and set it to `black`.

### 3️⃣ Install Pylint

Pylint is a Python linter that checks for errors and enforces a coding standard.

```bash
pip install pylint
```

Enable Pylint in VS Code:

1. Open the VS Code settings.
2. Search for `Python › Linting: Pylint Enabled` and ensure it is checked.

---

## 📜 Setting Up MarkdownLint

MarkdownLint checks for style and consistency issues in Markdown files.

### Install MarkdownLint

1. Use npm to install MarkdownLint globally:

```bash
npm install -g markdownlint-cli
```

### Run MarkdownLint

- **From the command line**:

```bash
markdownlint yourfile.md
```

- **In VS Code**:
MarkdownLint will automatically highlight issues in your `.md` files as you
edit them.

---

## ▶️ Running the Tools

### Run Ruff, Black, and Pylint for Python Files

1. **Ruff**:

```bash
ruff path/to/your/code
```

2. **Black**:

```bash
black path/to/your/code
```

3. **Pylint**:

```bash
pylint path/to/your/code
```

### Run MarkdownLint for Markdown Files

1. **MarkdownLint**:

```bash
markdownlint path/to/your/file.md
```

---

## 🎉 You're All Set

You are now ready to use Ruff, Black, Pylint, and MarkdownLint in VS Code to
ensure your code and documentation are clean, consistent, and professional.
Happy coding! 🚀
47 changes: 47 additions & 0 deletions solutions/area_of_circle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
A module for calculating the area of a circle.
Module contents:
- area_of_circle: calculates the area of a circle given its radius.
Created on 01 04 2025
@author: Raghad
"""

import math


# Define a function to calculate the area of a circle.
def area_of_circle(radius: float) -> float:
"""Calculate the area of a circle given its radius.
Parameters:
radius: float, the radius of the circle
Returns -> float: area of the circle
Raises:
ValueError: if the radius is negative
Examples:
>>> area_of_circle(5)
78.53981633974483
>>> area_of_circle(0)
0.0
>>> area_of_circle(3.5)
38.48451000647496
"""
# Raise an error if the radius is negative.
if radius < 0:
raise ValueError("Radius cannot be negative")

# Calculate and return the area using the formula: area = π * r^2
return math.pi * radius**2


# Entry point for script execution
if __name__ == "__main__":
# Example usage: Calculate the area of a circle with a radius of 5.
radius = 5
area = area_of_circle(radius)
print("Area of the circle:", area)
8 changes: 4 additions & 4 deletions solutions/cumulative_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- cumulative_sum(numbers: list) -> list:
Computes and returns a list of cumulative sums from the input list.
Author: Falaq Youniss
Author: Falaq Youniss.
Date: 29/12/2024
"""

Expand Down Expand Up @@ -44,9 +44,9 @@ def cumulative_sum(numbers: list) -> list:
# Validate input
assert numbers is not None, "Input cannot be None."
assert isinstance(numbers, list), "Input must be a list of numeric values."
assert all(
isinstance(num, (int, float)) for num in numbers
), "All elements in the list must be numeric."
assert all(isinstance(num, (int, float)) for num in numbers), (
"All elements in the list must be numeric."
)
# Compute cumulative sums
cumulative_list = []
current_sum = 0
Expand Down
Loading

0 comments on commit 4221c7d

Please sign in to comment.