Skip to content

Commit

Permalink
fixup! Import example learning agents
Browse files Browse the repository at this point in the history
  • Loading branch information
juztamau5 committed Mar 10, 2024
1 parent f03fc0c commit 395568b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'

Expand All @@ -38,7 +40,7 @@ jobs:
uses: actions/cache@v4
with:
path: openai
key: ${{ runner.os }}-cache-openai-${{ hashFiles('openai/**') }}-
key: ${{ runner.os }}-cache-openai-${{ hashFiles('openai/**') }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
29 changes: 25 additions & 4 deletions src/learning/test/test_random_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,30 @@
#
################################################################################

import retroai.retro_env # noqa: F401
import os
import sys

# Get the absolute path of the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))

def test_example():
# Replace with an actual test
assert True
# Get the parent directory of the current directory, which is the project root
project_root = os.path.dirname(current_dir)

# Add the project root to sys.path
sys.path.insert(0, project_root)


import retroai.retro_env


def test_random_agent():
env = retroai.retro_env.retro_make(game="Airstriker-Genesis")

env.reset()
for _ in range(1000):
obs, rew, done, info = env.step(env.action_space.sample())
print(info)
if done:
env.reset()

env.close()

0 comments on commit 395568b

Please sign in to comment.