Skip to content

Commit 1d75987

Browse files
Merge branch 'main' into optimizefunction
2 parents 7afe600 + 9db99c9 commit 1d75987

File tree

19 files changed

+3808
-58
lines changed

19 files changed

+3808
-58
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,59 @@ body:
77
- type: markdown
88
attributes:
99
value: |
10-
Thanks for taking the time to fill out this bug report! 🙏
10+
Thanks for taking the time to fill out this bug report! 🙏
1111
Please provide as much detail as possible to help us address the issue.
12-
13-
Use the following suggested headers to structure your bug report.
14-
Feel free to modify or add sections as needed to best communicate the issue.
15-
16-
## 📝 Description
17-
[Provide a clear and concise description of the bug]
18-
19-
## 🔄 Steps to Reproduce
20-
[Provide a minimal code example that reproduces the error, see https://stackoverflow.com/help/minimal-reproducible-example]
21-
```python
22-
# Your code here
23-
```
24-
25-
## 🎯 Expected Behavior
26-
[What did you expect to happen?]
27-
28-
## 🚨 Actual Behavior
29-
[What actually happened? Include any error messages or unexpected output]
30-
31-
## 🖥️ Environment Information
32-
Python version:
33-
Operating System:
34-
35-
Relevant packages (output of `pip list` or the specific packages related to this issue):
36-
```
37-
# Paste your pip list output or relevant package versions here
38-
```
39-
40-
## 📊 Relevant log output
41-
```
42-
# Paste any relevant log output here
43-
```
44-
45-
## ➕ Additional Context
46-
[Add any other context about the problem here]
12+
- type: textarea
13+
id: description
14+
attributes:
15+
label: "📝 Description"
16+
description: "Provide a clear and concise description of the bug."
17+
placeholder: "Describe the bug here..."
18+
- type: textarea
19+
id: steps
20+
attributes:
21+
label: "🔄 Steps to Reproduce"
22+
description: "Provide a minimal code example that reproduces the error. See [this guide](https://stackoverflow.com/help/minimal-reproducible-example) for more details."
23+
placeholder: "```python\n# Your code here\n```"
24+
- type: textarea
25+
id: expected_behavior
26+
attributes:
27+
label: "🎯 Expected Behavior"
28+
description: "What did you expect to happen?"
29+
placeholder: "Describe expected behavior here..."
30+
- type: textarea
31+
id: actual_behavior
32+
attributes:
33+
label: "🚨 Actual Behavior"
34+
description: "What actually happened? Include any error messages or unexpected output."
35+
placeholder: "Describe what actually happened..."
36+
- type: input
37+
id: python_version
38+
attributes:
39+
label: "🖥️ Python Version"
40+
description: "e.g., Python 3.8.10"
41+
placeholder: "Python version..."
42+
- type: input
43+
id: operating_system
44+
attributes:
45+
label: "Operating System"
46+
description: "e.g., Windows 10, macOS 11.2, etc."
47+
placeholder: "Operating system..."
48+
- type: textarea
49+
id: pip_list
50+
attributes:
51+
label: "Relevant Packages"
52+
description: "Output of `pip list` or the specific packages related to this issue."
53+
placeholder: "Paste your pip list output here..."
54+
- type: textarea
55+
id: log_output
56+
attributes:
57+
label: "📊 Relevant Log Output"
58+
description: "Paste any relevant log output here."
59+
placeholder: "Log output..."
60+
- type: textarea
61+
id: additional_context
62+
attributes:
63+
label: "➕ Additional Context"
64+
description: "Add any other context about the problem here."
65+
placeholder: "Additional context..."

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@ body:
77
- type: markdown
88
attributes:
99
value: |
10-
Thanks for taking the time to fill out this feature request! 🙏
10+
Thanks for taking the time to fill out this feature request! 🙏
1111
We appreciate your ideas to improve our project.
12-
13-
Please use the following suggested headers to structure your feature request.
14-
Feel free to modify or add sections as needed to best communicate your idea.
15-
16-
## 🤔 Problem Description
17-
[Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.]
18-
19-
## 💡 Proposed Solution
20-
[Describe the solution you'd like. What do you want to happen?]
21-
22-
## 🔄 Alternatives Considered
23-
[Have you considered any alternative solutions or features? If so, please describe them.]
24-
25-
## ➕ Additional Context
26-
[Add any other context, screenshots, or examples about the feature request here.]
12+
- type: textarea
13+
id: problem_description
14+
attributes:
15+
label: "🤔 Problem Description"
16+
description: "Is your feature request related to a problem? Provide a clear and concise description of the problem."
17+
placeholder: "Describe the problem here..."
18+
- type: textarea
19+
id: proposed_solution
20+
attributes:
21+
label: "💡 Proposed Solution"
22+
description: "Describe the solution you'd like. What do you want to happen?"
23+
placeholder: "Describe your proposed solution here..."
24+
- type: textarea
25+
id: alternatives
26+
attributes:
27+
label: "🔄 Alternatives Considered"
28+
description: "Have you considered any alternative solutions or features? If so, please describe them."
29+
placeholder: "Describe any alternatives considered..."
30+
- type: textarea
31+
id: additional_context
32+
attributes:
33+
label: "➕ Additional Context"
34+
description: "Add any other context, screenshots, or examples about the feature request here."
35+
placeholder: "Additional context, screenshots, or examples..."

.github/workflows/presubmit.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: AI Review
2+
3+
on:
4+
pull_request_target:
5+
types: [review_requested]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
check-membership:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
member: ${{ steps.check.outputs.member }}
14+
if: github.event_name == 'issue_comment' && github.event.issue.pull_request != null
15+
steps:
16+
- name: Check if commenter is in projectmesa
17+
id: check
18+
run: |
19+
username="${{ github.event.comment.user.login }}"
20+
echo "Checking membership for $username..."
21+
# GitHub API returns a 204 status code if the user is a member.
22+
response=$(curl -s -o /dev/null -w "%{http_code}" \
23+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
24+
https://api.github.com/orgs/projectmesa/members/$username)
25+
if [ "$response" -eq 204 ]; then
26+
echo "member=true" >> $GITHUB_OUTPUT
27+
else
28+
echo "member=false" >> $GITHUB_OUTPUT
29+
fi
30+
31+
run-ai-review:
32+
runs-on: ubuntu-latest
33+
needs: check-membership
34+
if: >
35+
(github.event_name == 'pull_request_target' && github.event.action == 'review_requested')
36+
||
37+
(
38+
github.event_name == 'issue_comment' &&
39+
github.event.issue.pull_request != null &&
40+
contains(github.event.comment.body, '/pr-ai-review') &&
41+
(
42+
needs.check-membership.outputs.member == 'true' ||
43+
github.event.comment.author_association == 'OWNER' ||
44+
github.event.comment.author_association == 'COLLABORATOR' ||
45+
github.event.comment.author_association == 'MEMBER' ||
46+
github.actor == 'adamamer20'
47+
)
48+
)
49+
steps:
50+
- name: Check required secrets
51+
run: |
52+
if [ -z "${{ secrets.LLM_API_KEY }}" ]; then
53+
echo "Error: LLM_API_KEY secret is not configured"
54+
exit 1
55+
fi
56+
57+
- name: Run AI Reviewer
58+
uses: presubmit/ai-reviewer@latest
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
62+
LLM_MODEL: "claude-3-7-sonnet-20250219"

.markdownlint.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"MD013": false,
3-
"MD046": false
3+
"MD046": false,
4+
"no-duplicate-heading": {
5+
"siblings_only": true
6+
},
7+
"first-line-h1": false
48
}

CONTRIBUTING.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Contributing to mesa-frames 🚀
2+
3+
Thank you for taking the time to contribute to **mesa-frames**! Since the project is still in its early stages, we warmly welcome contributions that will help shape its development. 🎉
4+
5+
For a more general and comprehensive guide, please refer to [mesa's main contribution guidelines](https://github.com/projectmesa/mesa/blob/main/CONTRIBUTING.md). 📜
6+
7+
## Project Roadmap 🗺️
8+
9+
Before contributing, we recommend reviewing our [roadmap](https://projectmesa.github.io/mesa-frames/roadmap/) file to understand the project's current priorities, upcoming features, and long-term vision. This will help ensure your contributions align with the project's direction.
10+
11+
## How to Contribute 💡
12+
13+
### 1. Prerequisite Installations ⚙️
14+
15+
Before you begin contributing, ensure that you have the necessary tools installed:
16+
17+
- **Install Python** (at least the version specified in `requires-python` of `pyproject.toml`). 🐍
18+
- We recommend using a virtual environment manager like:
19+
- [Astral's UV](https://docs.astral.sh/uv/#installation) 🌟
20+
- [Hatch](https://hatch.pypa.io/latest/install/) 🏗️
21+
- Install **pre-commit** to enforce code quality standards before pushing changes:
22+
- [Pre-commit installation guide](https://pre-commit.com/#install)
23+
- [More about pre-commit hooks](https://stackoverflow.com/collectives/articles/71270196/how-to-use-pre-commit-to-automatically-correct-commits-and-merge-requests-with-g)
24+
- If using **VS Code**, consider installing these extensions to automatically enforce formatting:
25+
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) – Python linting & formatting 🐾
26+
- [Markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) – Markdown linting (for documentation) ✍️
27+
- [Git Hooks](https://marketplace.visualstudio.com/items?itemName=lakshmikanthayyadevara.githooks) – Automatically runs & visualizes pre-commit hooks 🔗
28+
29+
---
30+
31+
### 2. Contribution Process 🛠️
32+
33+
#### **Step 1: Choose an Issue** 📌
34+
35+
- Pick an existing issue or create a new one if necessary.
36+
- Ensure that your contribution aligns with the project's goals.
37+
38+
#### **Step 2: Set Up Your Local Repository** 💻
39+
40+
1. **Fork the repository** on GitHub.
41+
2. **Clone your fork** to your local machine:
42+
43+
```sh
44+
git clone https://github.com/YOUR_USERNAME/mesa-frames.git
45+
```
46+
47+
3. **Create a new branch** with a descriptive name:
48+
49+
```sh
50+
git checkout -b feature-name
51+
```
52+
53+
4. **Prevent merge commit clutter** by setting rebase mode:
54+
55+
```sh
56+
git config pull.rebase true
57+
```
58+
59+
#### **Step 3: Install Dependencies** 📦
60+
61+
It is recommended to set up a virtual environment before installing dependencies.
62+
63+
- **Using UV**:
64+
65+
```sh
66+
uv add --dev .[dev]
67+
```
68+
69+
- **Using Hatch**:
70+
71+
```sh
72+
hatch env create dev
73+
```
74+
75+
- **Using Standard Python**:
76+
77+
```sh
78+
python3 -m venv myenv
79+
source myenv/bin/activate # macOS/Linux
80+
myenv\Scripts\activate # Windows
81+
pip install -e ".[dev]"
82+
```
83+
84+
#### **Step 4: Make and Commit Changes**
85+
86+
1. Make necessary edits and save the code.
87+
2. **Add and commit** your changes with meaningful commit messages:
88+
89+
```sh
90+
git add FILE_NAME
91+
git commit -m "Fix issue X: Brief description of the fix"
92+
```
93+
94+
- Keep commits **small and focused** on a single logical change.
95+
- Follow [Tim Pope’s commit message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 📝
96+
97+
#### **Step 5: Code Quality and Testing**
98+
99+
- **Run pre-commit hooks** to enforce code quality standards:
100+
101+
```sh
102+
pre-commit run
103+
```
104+
105+
- **Run tests** to ensure your contribution does not break functionality:
106+
107+
```sh
108+
pytest --cov
109+
```
110+
111+
- If using UV: `uv run pytest --cov`
112+
113+
#### **Step 6: Documentation Updates (If Needed)** 📖
114+
115+
- If you add a new feature, update the documentation accordingly.
116+
- We use **[MKDocs](https://www.mkdocs.org/)** for documentation:
117+
- Modify or create markdown files in the `docs/` folder.
118+
- Preview your changes by running:
119+
120+
```sh
121+
mkdocs serve
122+
uv run mkdocs serve #If using uv
123+
```
124+
125+
- Open `http://127.0.0.1:8000` in your browser to verify documentation updates.
126+
127+
#### **Step 7: Push Changes and Open a Pull Request (PR)** 🚀
128+
129+
1. **Push your changes** to your fork:
130+
131+
```sh
132+
git push origin feature-name
133+
```
134+
135+
2. **Open a pull request (PR)**:
136+
- Follow [GitHub’s PR guide](https://help.github.com/articles/creating-a-pull-request/).
137+
- Link the issue you are solving in the PR description.
138+
139+
---
140+
141+
Thank you again for your contribution! 🎉

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ mesa-frames is an extension of the [mesa](https://github.com/projectmesa/mesa) f
66

77
DataFrames are optimized for simultaneous operations through [SIMD processing](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data). At the moment, mesa-frames supports the use of two main libraries: pandas and Polars.
88

9+
>[!WARNING]
10+
>The pandas version will be deprecated in the next release. Refer to [this issue](https://github.com/projectmesa/mesa-frames/issues/89) for more information. Please consider transitioning to Polars for future compatibility.
11+
912
- [pandas](https://pandas.pydata.org/) is a popular data-manipulation Python library, developed using C and Cython. pandas is known for its ease of use, allowing for declarative programming and high performance.
1013
- [Polars](https://pola.rs/) is a new DataFrame library with a syntax similar to pandas but with several innovations, including a backend implemented in Rust, the Apache Arrow memory format, query optimization, and support for larger-than-memory DataFrames.
1114

0 commit comments

Comments
 (0)