Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove python 3.7 support and add 3.10 support #117

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
if: github.event.pull_request.draft == false
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Installing nnablaRL is easy!
$ pip install nnabla-rl
```

nnablaRL only supports Python version >= 3.7 and [nnabla](https://github.com/sony/nnabla) version >= 1.17.
nnablaRL only supports Python version >= 3.8 and [nnabla](https://github.com/sony/nnabla) version >= 1.17.

### Enabling GPU accelaration (Optional)

Expand Down
14 changes: 8 additions & 6 deletions nnabla_rl/environments/wrappers/hybrid_env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Sony Group Corporation.
# Copyright 2023,2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import cast
from typing import SupportsIndex, cast

import gym
import gym.spaces
Expand Down Expand Up @@ -46,8 +46,9 @@ def __init__(self, env: Env):
self._original_observation_space = env.observation_space

if self._is_box(env.observation_space):
self.observation_space = gym.spaces.Box(low=-np.ones(shape=env.observation_space.shape),
high=np.ones(shape=env.observation_space.shape),
observation_shape = cast(SupportsIndex, env.observation_space.shape)
self.observation_space = gym.spaces.Box(low=-np.ones(shape=observation_shape),
high=np.ones(shape=observation_shape),
dtype=np.float32)
elif self._is_tuple(env.observation_space):
spaces = [gym.spaces.Box(low=-np.ones(shape=space.shape),
Expand Down Expand Up @@ -85,8 +86,9 @@ def __init__(self, env: Env):
self._original_action_space = env.action_space

if self._is_box(env.action_space):
self.action_space = gym.spaces.Box(low=-np.ones(shape=env.action_space.shape),
high=np.ones(shape=env.action_space.shape),
action_shape = cast(SupportsIndex, env.action_space.shape)
self.action_space = gym.spaces.Box(low=-np.ones(shape=action_shape),
high=np.ones(shape=action_shape),
dtype=np.float32)
elif self._is_tuple(env.action_space):
spaces = [gym.spaces.Box(low=-np.ones(shape=space.shape),
Expand Down
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021,2022,2023 Sony Group Corporation.
# Copyright 2021,2022,2023,2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,12 +29,12 @@ classifiers =
Topic :: Scientific/Engineering :: Artificial Intelligence
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Operating System :: POSIX :: Linux
keywords = deep learning artificial intelligence machine learning neural network
python_requires = >=3.7
python_requires = >=3.8

[options]
packages = find:
Expand Down Expand Up @@ -87,7 +87,7 @@ skip_glob=external

[mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html for detail description of each configuration
python_version = 3.7
python_version = 3.8
ignore_missing_imports = True
no_implicit_optional = True
warn_unused_configs = True
Expand Down
Loading