Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ llm_rules.md
.python-version

benchmarks/results/*
docs/api/_build/*
docs/api/reference/*
docs/api/_build
docs/api/reference/**/mesa_frames.*.rst
examples/**/results/*
docs/general/**/data_*
docs/site/*
docs/general/tutorials/data_csv
docs/general/tutorials/data_parquet
docs/general/tutorials/*.ipynb
docs/site
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Version 0.1.0-alpha — 2024-08-28

## What's Changed

* Refactoring mesa.Agent, mesa.AgentSet, mesa.Model -> AgentSetDF, AgentsDF, ModelDF by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/8>
* setup: Migrate from setup.py to pyproject.toml by @rht in <https://github.com/adamamer20/mesa-frames/pull/13>
* ci: Add pre-commit configuration by @rht in <https://github.com/adamamer20/mesa-frames/pull/14>
* Merge requirements.txt into pyproject.toml by @rht in <https://github.com/adamamer20/mesa-frames/pull/15>
* ci: Add GA for tests by @rht in <https://github.com/adamamer20/mesa-frames/pull/17>
* Changes to AgentSetDF and AgentsDF before time.py -> CopyMixin by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/16>
* benchmark: Split Polars agent into native and concise by @rht in <https://github.com/adamamer20/mesa-frames/pull/23>
* benchmark: Split pandas agent into native and concise by @rht in <https://github.com/adamamer20/mesa-frames/pull/24>
* speed up mesa readme_plot script by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/26>
* Adding DataFrameMixin for improved reusability/encapsulation by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/27>
* Abstract SpaceDF by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/29>
* Adding Abstract DiscreteSpaceDF by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/30>
* Adding abstract GridDF by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/32>
* Additional methods and fixes to DataFrameMixin by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/43>
* Concrete GridPandas by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/44>
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in <https://github.com/adamamer20/mesa-frames/pull/55>
* Fixes and Tests for PolarsMixin by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/56>
* Adding Comparison and Indexing methods to DataFrameMixin by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/58>
* Concrete GridPolars by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/60>
* Sugarscape Instantaneous Growback (Pandas-with-loop implementation) by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/63>
* Adding pydoclint and properly format docstring by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/69>
* Docs with material-from-mkdocs by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/70>
* Enforce correct numpy docstring formatting with ruff.pydocstyle by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/74>
* API Documentation with Sphinx by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/75>
* Move images from docs to docs/general to make it available for mkdocs by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/79>
* Adding user guide by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/81>
* Adding SugarScape IG (polars with loops) by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/71>
* Automatic publishing on PyPI on new release by @adamamer20 in <https://github.com/adamamer20/mesa-frames/pull/77>

## New Contributors

* @adamamer20 made their first contribution in <https://github.com/adamamer20/mesa-frames/pull/8>
* @rht made their first contribution in <https://github.com/adamamer20/mesa-frames/pull/13>
* @pre-commit-ci made their first contribution in <https://github.com/adamamer20/mesa-frames/pull/55>

**Full Changelog**: <https://github.com/adamamer20/mesa-frames/commits/v0.1.0-alpha>
74 changes: 33 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ Before contributing, we recommend reviewing our [roadmap](https://projectmesa.gi
Before you begin contributing, ensure that you have the necessary tools installed:

- **Install Python** (at least the version specified in `requires-python` of `pyproject.toml`). 🐍
- We recommend using a virtual environment manager like:
- [Astral's UV](https://docs.astral.sh/uv/#installation) 🌟
- [Hatch](https://hatch.pypa.io/latest/install/) 🏗️

-- We recommend using a virtual environment manager like:

- [Astral's UV](https://docs.astral.sh/uv/#installation) 🌟
- [Hatch](https://hatch.pypa.io/latest/install/) 🏗️

- Install **pre-commit** to enforce code quality standards before pushing changes:

- [Pre-commit installation guide](https://pre-commit.com/#install) ✅
- [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)
- If using **VS Code**, consider installing these extensions to automatically enforce formatting:
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) – Python linting & formatting 🐾
- [Markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) – Markdown linting (for documentation) ✍️
- [Git Hooks](https://marketplace.visualstudio.com/items?itemName=lakshmikanthayyadevara.githooks) – Automatically runs & visualizes pre-commit hooks 🔗

-- If using **VS Code**, consider installing these extensions to automatically enforce formatting:

- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) – Python linting & formatting 🐾
- [Markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) – Markdown linting (for documentation) ✍️
- [Git Hooks](https://marketplace.visualstudio.com/items?itemName=lakshmikanthayyadevara.githooks) – Automatically runs & visualizes pre-commit hooks 🔗

---

Expand Down Expand Up @@ -58,28 +64,13 @@ Before you begin contributing, ensure that you have the necessary tools installe

#### **Step 3: Install Dependencies** 📦

It is recommended to set up a virtual environment before installing dependencies.

- **Using UV**:

```sh
uv add --dev .[dev]
```

- **Using Hatch**:
We manage the development environment with [uv](https://docs.astral.sh/uv/):

```sh
hatch env create dev
```
```sh
uv sync --all-extras
```

- **Using Standard Python**:

```sh
python3 -m venv myenv
source myenv/bin/activate # macOS/Linux
myenv\Scripts\activate # Windows
pip install -e ".[dev]"
```
This creates `.venv/` and installs mesa-frames with the development extras.

#### **Step 4: Make and Commit Changes** ✨

Expand All @@ -99,33 +90,35 @@ It is recommended to set up a virtual environment before installing dependencies
- **Run pre-commit hooks** to enforce code quality standards:

```sh
pre-commit run
uv run pre-commit run -a
```

- **Run tests** to ensure your contribution does not break functionality:

```sh
pytest --cov
uv run pytest -q --cov=mesa_frames --cov-report=term-missing
```

- If using UV: `uv run pytest --cov`
-- **Optional: Runtime Type Checking (beartype)** 🔍

- **Optional: Enable runtime type checking** during development for enhanced type safety:
You can enable stricter runtime validation of function arguments/returns with `beartype` during local development:

```sh
MESA_FRAMES_RUNTIME_TYPECHECKING=1 uv run pytest --cov
MESA_FRAMES_RUNTIME_TYPECHECKING=1 uv run pytest -q --cov=mesa_frames --cov-report=term-missing
```

!!! tip "Automatically Enabled"
Runtime type checking is automatically enabled in these scenarios:
Quick facts:

- **Hatch development environment** (`hatch shell dev`)
- **VS Code debugging** (when using the debugger)
- **VS Code testing** (when running tests through VS Code's testing interface)
- Automatically enabled in: Hatch dev env (`hatch shell dev`), VS Code debugger, and VS Code test runs.
- Enable manually by exporting `MESA_FRAMES_RUNTIME_TYPECHECKING=1` (any of 1/true/yes).
- Use only for development/debugging; adds overhead—disable for performance measurements or large simulations.
- Unset with your shell (e.g. `unset`/`Remove-Item Env:` depending on shell) to turn it off.

No manual setup needed in these environments!
Example for a one-off test run:

For more details on runtime type checking, see the [Development Guidelines](https://projectmesa.github.io/mesa-frames/development/).
```sh
MESA_FRAMES_RUNTIME_TYPECHECKING=1 uv run pytest -q
```

#### **Step 6: Documentation Updates (If Needed)** 📖

Expand All @@ -135,8 +128,7 @@ It is recommended to set up a virtual environment before installing dependencies
- Preview your changes by running:

```sh
mkdocs serve
uv run mkdocs serve #If using uv
uv run mkdocs serve
```

- Open `http://127.0.0.1:8000` in your browser to verify documentation updates.
Expand Down
Loading
Loading