Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/adamamer20/mesa-frames into…
Browse files Browse the repository at this point in the history
… masked_do_agentset
  • Loading branch information
adamamer20 committed Jul 2, 2024
2 parents eef3b66 + dc41b47 commit a3aca41
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 14 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: build

on:
push:
branches:
- main
- release**
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'

# This will cancel previous run if a newer job that obsoletes the said previous
# run, is started.
# Based on https://github.com/zulip/zulip/commit/4a11642cee3c8aec976d305d51a86e60e5d70522
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}-latest
# We need an explicit timeout because sometimes the batch_runner test never
# completes.
timeout-minutes: 6
strategy:
fail-fast: False
matrix:
os: [windows, ubuntu, macos]
python-version: ["3.12"]
include:
- os: ubuntu
python-version: "3.11"
- os: ubuntu
python-version: "3.10"
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253
#- os: ubuntu
# python-version: 'pypy-3.8'

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
run: pip install uv
- name: Install mesa-frames
# See https://github.com/astral-sh/uv/issues/1945
run: |
uv pip install --system .[dev]
- name: Test with pytest
run: pytest --durations=10 --cov=mesa_frames tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
name: Codecov
uses: codecov/codecov-action@v4
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ cd mesa_frames
If you want to install it into a new environment:

```bash
conda create -n myenv -f requirements.txt
pip install -e .
conda create -n myenv
```

If you want to install it into an existing environment:

```bash
conda activate myenv
conda install -f requirements.txt
pip install -e .
```

Then, to install mesa-frames itself:
```bash
# For pandas backend
pip install -e .[pandas]
# Alternatively, for Polars backend
pip install -e .[polars]
```

### Installing in a Python Virtual Environment
Expand All @@ -50,18 +55,23 @@ If you want to install it into a new environment:
```bash
python3 -m venv myenv
source myenv/bin/activate # On Windows, use `myenv\Scripts\activate`
pip install -r requirements.txt
pip install -e .
```

If you want to install it into an existing environment:

```bash
source myenv/bin/activate # On Windows, use `myenv\Scripts\activate`
pip install -r requirements.txt
pip install -e .
```

Then, to install mesa-frames itself:
```bash
# For pandas backend
pip install -e .[pandas]
# Alternatively, for Polars backend
pip install -e .[polars]
```


## Usage

**Note:** mesa-frames is currently in its early stages of development. As such, the usage patterns and API are subject to change. Breaking changes may be introduced. Reports of feedback and issues are encouraged.
Expand Down Expand Up @@ -143,4 +153,4 @@ mesa-frames is made available under the MIT License. This license allows you to
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- The software is provided "as is", without warranty of any kind.

For the full license text, see the [LICENSE](https://github.com/adamamer20/mesa_frames/blob/main/LICENSE) file in the GitHub repository.
For the full license text, see the [LICENSE](https://github.com/adamamer20/mesa_frames/blob/main/LICENSE) file in the GitHub repository.
22 changes: 21 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,29 @@ name = "mesa_frames"
version = "0.1.0-alpha1"
description = "An extension to the Mesa framework which uses pandas/Polars DataFrames for enhanced performance"
authors = [
{ name = "Adam Amer" },
{ name = "Adam Amer" },
]
license = { text = "MIT" }
dependencies = [
"numpy~=1.26",
]

[project.optional-dependencies]
pandas = [
"pandas~=2.2",
"geopandas",
"pyarrow",
]
polars = [
"polars",
]
dev = [
"mesa_frames[pandas,polars]",
"pytest",
"pytest-cov",
"typeguard",
"mesa",
]

[tool.hatch.build.targets.wheel]
packages = ["mesa_frames"]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

0 comments on commit a3aca41

Please sign in to comment.