Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
23db052
first commit
IronMax03 Apr 26, 2025
52ee4ac
Merge pull request #1 from IronMax03/enhancement/improve-workflow
IronMax03 Apr 26, 2025
358b8bc
example of change
IronMax03 Apr 26, 2025
af22686
helloWorld
IronMax03 Apr 26, 2025
51494c6
test
IronMax03 Apr 26, 2025
7ebd7e7
Merge pull request #2 from IronMax03/enhancement/improve-workflow
IronMax03 Apr 26, 2025
61e2353
update tester
IronMax03 Apr 27, 2025
ea40cd5
update requirement.txt
IronMax03 Apr 27, 2025
b8d83fc
test
IronMax03 Apr 27, 2025
ce53978
test
IronMax03 Apr 27, 2025
59797a3
clean file structure
IronMax03 Apr 27, 2025
6efdeab
update
IronMax03 Apr 27, 2025
031bb0f
using 1 docker file for issue renaming
IronMax03 Apr 27, 2025
7cbb52f
fix
IronMax03 Apr 27, 2025
4280607
fix
IronMax03 Apr 27, 2025
4fd1e16
fix
IronMax03 Apr 27, 2025
2cf1017
changing issue bug report template
IronMax03 Apr 28, 2025
922fe9c
fix bug_repport.yaml
IronMax03 Apr 28, 2025
a5a3396
naming fix
IronMax03 Apr 28, 2025
8db5250
changing triggers of Issue Automatic Renaming
IronMax03 Apr 28, 2025
faf4a2d
fix typo inside CONTRIBUTING.md
IronMax03 Apr 28, 2025
1d3037c
small improvements in code-tester.yaml
IronMax03 Apr 30, 2025
ed6785f
other small improvements in code-tester.yaml
IronMax03 Apr 30, 2025
d9f4f40
fixing actions/checkout@v3
IronMax03 Apr 30, 2025
b365c56
fixing trigger in code-tester.yaml
IronMax03 Apr 30, 2025
c74ebe4
small fix
IronMax03 Apr 30, 2025
66e1a21
Adding Style Check to Code Tester
IronMax03 Apr 30, 2025
f74b2a4
clear code
IronMax03 Apr 30, 2025
9dabbc9
new algo issue form
IronMax03 May 1, 2025
f90fee7
fix issue template
IronMax03 May 1, 2025
3865d13
update file structur
IronMax03 May 3, 2025
d2441b4
change issue automatic renaming following the pull request(#54) review
IronMax03 May 6, 2025
8031209
issue automatic renaming small fix
IronMax03 May 6, 2025
b942fd7
changing code tester following the pull request(#54) review
IronMax03 May 6, 2025
7c742a2
fix code-tester
IronMax03 May 6, 2025
3496ceb
fix
IronMax03 May 6, 2025
f4a5ece
fix
IronMax03 May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_repport.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: Bug Report
description: File a bug report.
title: 'Enter a short title that describes the issue' # Placeholder for the user to edit
title: 'Enter a short title that describes the issue'
labels: [bug]

body:
- type: dropdown
attributes:
label: Severity
label: Type
options:
- 🔥 Blocker
- 🛑 Major
- ⚠️ Minor
- ❓ Not sure
- 🧮 Algorithm Implementation
- 🛠 CI/Tooling Issue
- 📘 Algorithm Documentation
- 🖋 General Documentation
- 🧪 Test Failure or Adding Testcase
- ❓ Other / Not Sure

default: 0
validations:
required: true
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/auto-fill-algo-name.yaml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/auto-fill-bug-title.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/code-tester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Tester

on: [pull_request]

jobs:
checks:
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v5

- name: Download Repo In Docker
uses: actions/checkout@v4

Copy link
Member

@eliemada eliemada May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  - name: Install uv
    uses: astral-sh/setup-uv@v5
    with:
      enable-cache: true
      cache-dependency-glob: "uv.lock"

  - name: Install the project
    run: uv sync --locked --all-extras --dev

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv is already installed by:

    - name: Install dependencies
      run: pip install -r requirements.txt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but requirements.txt is a terrible design choice

Copy link
Member Author

@IronMax03 IronMax03 May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line complementary or does it replace the code below?

uses: actions/checkout@v3
      with:
        fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Run tests
run: |
pip install pytest
pytest tests --quiet --collect-only

- name: Style Check
run: ruff check
84 changes: 84 additions & 0 deletions .github/workflows/issue-Automatic-renaming.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Issue Automatic Renaming

on:
issues:
types: [opened, edited]

permissions:
issues: write

jobs:
rename-issue:
runs-on: ubuntu-latest
steps:
- name: Rename for New Algo Issues
uses: actions/github-script@v7
if: contains(github.event.issue.body, '### Algo_Name')
with:
script: |
const issueBody = context.payload.issue.body;
console.log("Issue Body:\n", issueBody);

const match = /### Algo_Name\s*\n+(.+?)(\n+###|\n*$)/s.exec(issueBody);
if (!match) {
console.log("🚫 Could not find algo name in Markdown.");
return;
}

const algoName = match[1].trim();
const issueNumber = context.issue.number;
const formattedAlgoName = algoName
.toLowerCase()
.replace(/\s+/g, '_') // Replace spaces with underscores
.replace(/[^\w_]/g, '') // Remove special characters
.replace(/_+/g, '_'); // Replace multiple underscores with single

const newTitle = `✨ Implement ${formattedAlgoName}`;

console.log(`🔧 Updating issue title to: ${newTitle}`);

await github.rest.issues.update({
...context.repo,
issue_number: issueNumber,
title: newTitle,
body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names.`
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

          await github.rest.issues.createComment({
            ...context.repo,
            issue_number: issueNumber,
            body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names.`
          });

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove title: newTitle?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

body: `📝 Algorithm has been formatted for consistency as \`${formattedAlgoName}\`. Please use this format in your implementation file names. thats nice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove title: newTitle?
Did not remove it I suggested adding a comment

- name: Rename for Bug Report Issues
uses: actions/github-script@v7
if: contains(github.event.issue.body, '### Type')
with:
script: |
const body = context.payload.issue.body;
console.log("Issue Body:\n", body);

const typeMatch = /### Type\s+(.+?)\s*(###|$)/s.exec(body);
const Type = typeMatch ? typeMatch[1].trim() : null;

if (!Type) {
console.log("🚫 Could not find Type in Markdown.");
return;
}

const typeMap = {
"🧮 Algorithm Implementation": "🧮",
"🛠 CI/Tooling Issue": "🛠",
"📘 Algorithm Documentation": "📘",
"🖋 General Documentation": "🖋",
"🧪 Test Failure or Adding Testcase": "🧪",
"❓ Other / Not Sure": "❓",
};
const typeIcon = typeMap[Type] || "❓";

const rawTitle = context.payload.issue.title;

const issueNumber = context.issue.number;
const updatedTitle = `⚠️ - ${typeIcon} [Bug]: ${rawTitle}`;

console.log(`🔧 Updating issue title to: ${updatedTitle}`);

await github.rest.issues.update({
...context.repo,
issue_number: issueNumber,
title: updatedTitle
});
104 changes: 54 additions & 50 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,18 @@ We welcome all kinds of contributions—whether you're fixing bugs, improving do

## ✅ What you can contribute

- Report bug
- Add a new algorithm or data structure
- Improve or correct existing implementations
- Write or update documentation
- Add test cases or enhance test coverage
- Fix typos or bugs
- Fix typos

## Guidelines
## How to contribut

- **Coding Standards:**
Follow clean and consistent coding practices. Use meaningful variable and function names.
Every change in the repository should be merged through [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). All commit execute [Ruff](https://docs.astral.sh/ruff/) to insure some level of coding standard.

- **Document Your Code:**
Ensure all functions have clear and concise comments/description.

- **Test Your Changes:**
While we understand that fully testing this library may be challenging, ensure your code works as intended before submitting. Focus on edge cases and confirm that your changes integrate smoothly with existing functionality.

- **Be Respectful**:
Engage in discussions respectfully and constructively.

- **Follow The File Structure Templates**: Each Algorithm should have its own file in **scr** with: A README based on the template and the python file. Parallel to that you should create another file inside tests with a python file torun the tests and a YAML file to store the tests cases.

## Before Contributing
### Before Contributing

Before making the first commit of the session, you should set up the **pre-commit** framework and activate the **virtual environment**. This has to be done for each new session.

Expand All @@ -43,6 +32,53 @@ Before making the first commit of the session, you should set up the **pre-commi
pre-commit install
```

### Implementing a new algorithm

Before implementing a new algorithm. The Python virtual environment should include [rich](https://pypi.org/project/rich/) and [pytest](https://pypi.org/project/pytest/). From the cloned repository run the command below for a quick installation.

```bash
pip install -r requirements.txt
```

Every algorithm implementation should have a dedicated **issue**. This issue should be built with the **Implement Algorithm** issue form. If no issue exists for the specific algorithm to be implemented create one. Every file inside the new repository and the **test file** should follow the file structure inside [File Structure](#📁-file-structure) section.

All algorithm should be accompanied with a **README.md** file. This file should follow the template in the [Algorithm README.md](#algorithm-readme) section.

Every algorithm should be tested using [pytest](https://docs.pytest.org/en/stable/).

## 🐛 Bug Report

To report a bug, simply create a new issue using the **Bug Report** form and fill out all sections.
The form is straightforward, but if you’d like a bit more guidance, follow the steps below. 👇

### 📝 Steps to Report a Bug

1. **Enter a clear, short title**
Use a short, clear title that describes the issue.

> Example: `Crash when clicking the login button`

2. **What type of issue is this? (Bug Type)**

- 🧮 Algorithm Implementation - The logic or output of an algorithm is incorrect.
- 🛠 CI/Tooling Issue - Problems with continuous integration or scripts.
- 📘 Algorithm Documentation - Missing or incorrect explanations/comments for an algorithm.
- 🖋 General Documentation - Typos, formatting, or missing information inside documentation that is not related to an algorithm.
- 🧪 Test Failure or Adding Testcase - Broken tests or missing edge case coverage.
- ❓ Other / Not Sure - You’re unsure how bad it is or some other kind of issue.

3. **In the Steps to Reproduce & What Happens section:**

- List step-by-step instructions to trigger the bug
- Describe what actually happens

4. **Describe what you expected to happen(Expected Behavior):**
In the Expected Behavior section, explain what you thought would happen instead.

5. **Create the issue:**
Once you create the issue, our system will automatically format the title.
This formatting takes about 4 seconds.

## 📁 File Structure

When adding a new algorithm, follow this structure:
Expand Down Expand Up @@ -70,12 +106,11 @@ AlgoHub/
│ └── algorithm_type
│ └── your_algorithm/
│ ├── test_new_algorithm.py
│ ├── __init__.py
│ └── test_cases.yaml # Test cases
│ └── __init__.py

```

### Algorithm README.md
### Algorithm README

The README.md inside the **New_Algorithm** folder should follow the following template.

Expand Down Expand Up @@ -153,34 +188,3 @@ The README.md inside the **New_Data_Structure** folder should follow the followi
- **Search**:

```

## 🐛 Bug Report

To report a bug, simply create a new issue using the **Bug Report** form and fill out all sections.
The form is straightforward, but if you’d like a bit more guidance, follow the steps below. 👇

### 📝 Steps to Report a Bug

1. **Enter a clear, short title**
Use a short, clear title that describes the issue.

> Example: `Crash when clicking the login button`

2. **Choose how serious the issue is (severity):**

- 🔥 Blocker – Completely breaks core functionality
- 🛑 Major – Important features aren’t working
- ⚠️ Minor – Small issues or annoyances
- ❓ Not sure – You’re unsure how bad it is

3. **In the Steps to Reproduce & What Happens section:**

- List step-by-step instructions to trigger the bug
- Describe what actually happens

4. **Describe what you expected to happen(Expected Behavior):**
In the Expected Behavior section, explain what you thought would happen instead.

5. **Create the issue:**
Once you create the issue, our system will automatically format the title.
This formatting takes about 4 seconds.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy
ruff
rich
pytest
Comment on lines +1 to +4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file, I do no like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is more scalable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this is absolutely not scalable, uv does that for us

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading