Skip to content

Commit ea7e8f7

Browse files
authored
Support Numpy 2.0 and Bump Python Version (#120)
1 parent 95615fc commit ea7e8f7

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.9', '3.10', '3.11', '3.12']
14+
python-version: ['3.10', '3.11', '3.12', '3.13']
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python ${{ matrix.python-version }}

mo_gymnasium/envs/lunar_lander/lunar_lander.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def step(self, action):
7272
)
7373

7474
if self.continuous:
75-
action = np.clip(action, -1, +1).astype(np.float32)
75+
action = np.clip(action, -1, +1).astype(np.float64)
7676
else:
7777
assert self.action_space.contains(action), f"{action!r} ({type(action)}) invalid "
7878

mo_gymnasium/envs/mario/mario.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class MOSuperMarioBros(SuperMarioBrosEnv, gym.Env, EzPickle):
2020
## Description
2121
Multi-objective version of the SuperMarioBro environment.
2222
23+
Obs: To run this environment, it is required numpy==1.21 due to nes-py dependency.
24+
2325
See [gym-super-mario-bros](https://github.com/Kautenja/gym-super-mario-bros) for more information.
2426
2527
## Reward Space

mo_gymnasium/envs/minecart/minecart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def compute_angle(p0, p1, p2):
786786
v0 = np.array(p0) - np.array(p1)
787787
v1 = np.array(p2) - np.array(p1)
788788

789-
angle = np.math.atan2(np.linalg.det([v0, v1]), np.dot(v0, v1))
789+
angle = np.arctan2(np.linalg.det([v0, v1]), np.dot(v0, v1))
790790
return np.degrees(angle)
791791

792792

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ build-backend = "setuptools.build_meta"
66
name = "mo-gymnasium"
77
description="A standard API for MORL and a diverse set of reference environments."
88
readme = "README.md"
9-
requires-python = ">= 3.9"
9+
requires-python = ">= 3.10"
1010
authors = [{ name = "Farama Foundation", email = "contact@farama.org" }]
1111
license = { text = "MIT License" }
1212
keywords = ["Reinforcement Learning", "Multi-Objective", "RL", "AI", "Gymnasium"]
1313
classifiers = [
1414
"Development Status :: 4 - Beta", # change to `5 - Production/Stable` when ready
1515
"License :: OSI Approved :: MIT License",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
2121
'Intended Audience :: Science/Research',
2222
'Topic :: Scientific/Engineering :: Artificial Intelligence',
2323
]
2424
dependencies = [
2525
"gymnasium >=1.1.0",
26-
"numpy >=1.21.0,<2.0",
26+
"numpy >=1.21",
2727
"pygame >=2.1.3",
2828
"scipy >=1.7.3",
2929
]
3030
dynamic = ["version"]
3131

3232
[project.optional-dependencies]
3333
# Update dependencies in `all` if any are added or removed
34-
mario = ["nes-py", "gym-super-mario-bros"]
34+
mario = ["nes-py", "gym-super-mario-bros", "numpy >=1.21.0,<2.0"]
3535
minecart = ["scipy >=1.7.3 "]
3636
mujoco = ["mujoco >=2.2.0", "imageio >=2.14.1"]
3737
highway = ["highway-env >=1.8"]

tests/test_envs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
continue
1717

1818
# collect MO Gymnasium envs
19-
if env_spec.entry_point.split(".")[0] == "mo_gymnasium":
19+
if env_spec.entry_point.split(".")[0] == "mo_gymnasium" and "mario" not in env_spec.id:
2020
all_testing_env_specs.append(env_spec)
2121

2222

0 commit comments

Comments
 (0)