Skip to content

Commit

Permalink
add swig setup dependency and remove unrar/swig from github scripts (#…
Browse files Browse the repository at this point in the history
…321)

* add swig setup dependency and remove unrar/swig from github scripts

* remove box2d dependency

* remove box2d envs from tests
  • Loading branch information
cpnota authored Mar 7, 2024
1 parent a12a828 commit dec247d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install swig
sudo apt-get install unrar
python -m pip install --upgrade pip
pip install torch~=2.0 --extra-index-url https://download.pytorch.org/whl/cpu
make install
- name: Lint code
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install swig
sudo apt-get install unrar
pip install torch~=2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install setuptools wheel
make install
Expand Down
6 changes: 3 additions & 3 deletions all/presets/continuous_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

class TestContinuousPresets(unittest.TestCase):
def setUp(self):
self.env = GymEnvironment("LunarLanderContinuous-v2")
self.env = GymEnvironment("MountainCarContinuous-v0")
self.env.reset()
self.parallel_env = DuplicateEnvironment(
[
GymEnvironment("LunarLanderContinuous-v2"),
GymEnvironment("LunarLanderContinuous-v2"),
GymEnvironment("MountainCarContinuous-v0"),
GymEnvironment("MountainCarContinuous-v0"),
]
)
self.parallel_env.reset()
Expand Down
2 changes: 1 addition & 1 deletion all/scripts/train_continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
continuous,
GymEnvironment,
description="Train an agent on a continuous control environment.",
env_help="The name of the environment (e.g., LunarLanderContinuous-v2).",
env_help="The name of the environment (e.g., MountainCarContinuous-v0).",
default_frames=10e6,
)

Expand Down
6 changes: 3 additions & 3 deletions integration/continuous_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class TestContinuousPresets(unittest.TestCase):
def test_ddpg(self):
validate_agent(
ddpg.device("cpu").hyperparameters(replay_start_size=50),
GymEnvironment("LunarLanderContinuous-v2"),
GymEnvironment("MountainCarContinuous-v0"),
)

def test_ppo(self):
validate_agent(ppo.device("cpu"), GymEnvironment("LunarLanderContinuous-v2"))
validate_agent(ppo.device("cpu"), GymEnvironment("MountainCarContinuous-v0"))

def test_sac(self):
validate_agent(
sac.device("cpu").hyperparameters(replay_start_size=50),
GymEnvironment("LunarLanderContinuous-v2"),
GymEnvironment("MountainCarContinuous-v0"),
)

def test_mujoco(self):
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"atari": [
f"gymnasium[atari, accept-rom-license]~={GYMNASIUM_VERSION}",
],
"box2d": [
f"gymnasium[box2d]~={GYMNASIUM_VERSION}",
],
"pybullet": [
"pybullet>=3.2.2,<4",
"gym>=0.10.0,<0.26.0",
Expand All @@ -37,11 +34,7 @@
}

extras["all"] = (
extras["atari"]
+ extras["box2d"]
+ extras["mujoco"]
+ extras["pybullet"]
+ extras["ma-atari"]
extras["atari"] + extras["mujoco"] + extras["pybullet"] + extras["ma-atari"]
)
extras["dev"] = extras["all"] + extras["test"] + extras["docs"]

Expand Down Expand Up @@ -75,7 +68,7 @@
"numpy~=1.22", # math library
"matplotlib~=3.7", # plotting library
"opencv-python-headless~=4.0", # used by atari wrappers
"torch~=2.0", # core deep learning library
"torch~=2.2", # core deep learning library
"tensorboard~=2.8", # logging and visualization
"cloudpickle~=2.0", # used to copy environments
],
Expand Down

0 comments on commit dec247d

Please sign in to comment.