Skip to content

Incompatibility with numpy>=2.4 (np.reshape(newshape=...) incorrect) #9

@nhuet

Description

@nhuet

Starting from numpy 2.4, newhape arg has been removed from np.reshape (replaced by shape). It was already deprecated from numpy 2.1.
But SimplifiedActionRDDLEnv.step() use it:

from pyRDDLGym_rl.core.env import SimplifiedActionRDDLEnv
import pyRDDLGym

rddl_gym_env = pyRDDLGym.make(
    "CartPole_Continuous_gym",
    "0",
    base_class=SimplifiedActionRDDLEnv,
)

rddl_gym_env.reset()
rddl_gym_env.step(0.0)

leads to

Traceback (most recent call last):
File "xxxxxx.py", line 11, in
rddl_gym_env.step(0.0)
File "xxxxx/site-packages/pyRDDLGym_rl/core/env.py", line 287, in step
actions = self._gym_to_rddl_actions(actions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xxxxx/site-packages/pyRDDLGym_rl/core/env.py", line 265, in _gym_to_rddl_actions
actions[var] = np.reshape(
^^^^^^^^^^^
TypeError: reshape() got an unexpected keyword argument 'newshape'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions