Skip to content

Commit

Permalink
Merge branch 'main' into sracho
Browse files Browse the repository at this point in the history
  • Loading branch information
srajan-kiyotaka committed Jun 17, 2024
2 parents 0df7eea + 2ef8155 commit ad13204
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 8 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.6"
- os: windows-latest
python-version: "3.6"
- os: ubuntu-latest
python-version: "3.6"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install prettytable
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb
xvfb-run -a python -m unittest discover -s tests
- name: Run tests on macOS
if: runner.os == 'macOS'
run: python -m unittest discover -s tests

- name: Run tests on Windows
if: runner.os == 'Windows'
run: python -m unittest discover -s tests
37 changes: 37 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test using Conda

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: conda install prettytable
- name: Install Xvfb
run: sudo apt-get install -y xvfb
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Lint with flake8
run: |
conda install flake8
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: python -m unittest discover -s tests
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ For detailed installation instructions, refer to our [installation guide]().

If you are new to Traverse Craft, start with the [tutorial]() available in our online documentation. The documentation includes a [tutorial](), [example gallery](), [API reference](), FAQ, and other useful information.

To build the documentation locally, please refer to [doc/README.md](doc/README.md).
To build the documentation locally, please refer to [docs/ReadMe.md](docs/ReadMe.md).

Explore the source code for deeper insights, or reach out to our community for help. For further assistance, visit our online documentation.

Expand Down Expand Up @@ -133,4 +133,4 @@ If you use Traverse Craft in your research or publications, please cite our libr
note = {Version 1.0.0},
publisher = {Traverse Craft Team},
}
```
```
8 changes: 4 additions & 4 deletions docs/graphWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Class representing a graph world.
- `buttonText` (str): Text displayed on buttons. Default is "Start Agent".
- `logoPath` (str, optional): File path to the logo image. Default is None.

#### Attributes
## Attributes

- `worldID` (str): Class identifier for the graph world.
- `nodeMap` (dict): Dictionary mapping node IDs to canvas objects.
- `root` (TreeNode): The root of the graph data structure.
- **worldID (str)**: Class identifier for the tree world.
- **nodeMap (dict)**: Dictionary mapping node IDs to canvas objects.
- **_agent**: The agent in the world.

## Methods

Expand Down
8 changes: 7 additions & 1 deletion docs/gridAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

The `GridAgent` class represents an agent that operates within a grid world environment.

## Parameters
## Initialization

### `__init__(self, world, agentName:str, agentColor:str="blue", heatMapView:bool=True, heatMapColor:str="#FFA732", agentPos:tuple=(0,0), heatGradient:float=0.05):`

The constructor initializes an instance of the `GridAgent` class, which represents an agent operating within a grid-based world.

- **Parameters**:

- `world` (CreateGridWorld): The grid world object in which the agent operates.
- `agentName` (str): The name of the agent.
Expand Down
9 changes: 8 additions & 1 deletion docs/treeAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
## Class: `TreeAgent`
The `TreeAgent` class represents an agent that operates within a tree-structured environment. The agent can traverse the tree, track its movement, and visualize its path using a heat map.

### Parameters

## Initialization

### `__init__(self, world, agentName:str, agentColor:str="blue", heatMapView:bool=True, heatMapColor:str="#FFA732", heatGradient:float=0.05):`

The constructor initializes an instance of the `TreeAgent` class, which represents an agent operating within a tree-based world.

- **Parameters**:
- **world** (`CreateTreeWorld`): The world object that the agent belongs to.
- **agentName** (`str`): The name of the agent.
- **agentColor** (`str`, optional): The color of the agent. Defaults to "blue".
Expand Down

0 comments on commit ad13204

Please sign in to comment.