Skip to content

Commit

Permalink
Add support for python 3.11.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzakka committed Jun 3, 2023
1 parent 2d67aaa commit 93cb7d7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ We've created an introductory [Colab](https://colab.research.google.com/github/g

## Installation

RoboPianist is supported on both Linux and macOS and can be installed with Python 3.8 up to 3.10. We recommend using [Miniconda](https://docs.conda.io/en/latest/miniconda.html) to manage your Python environment.

**3.11 will be supported once the numba team resolves [#8304](https://github.com/numba/numba/issues/8304).**
RoboPianist is supported on both Linux and macOS and can be installed with Python >= 3.8. We recommend using [Miniconda](https://docs.conda.io/en/latest/miniconda.html) to manage your Python environment.

### Install from source

Expand Down
2 changes: 1 addition & 1 deletion robopianist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from pathlib import Path

__version__ = "1.0.8"
__version__ = "1.0.9"

# Path to the root of the project.
_PROJECT_ROOT = Path(__file__).parent.parent
Expand Down
2 changes: 1 addition & 1 deletion robopianist/suite/tasks/piano_with_one_shadow_hand.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _compute_key_press_reward(self, physics) -> float:
rew += 0.5 * rews.mean()
# If there's any false positive, the remaining 0.5 reward is lost.
off = np.flatnonzero(1 - self._goal_current[:-1])
rew += 0.5 * (1 - self.piano.activation[off].any())
rew += 0.5 * (1 - float(self.piano.activation[off].any()))
return rew

def _compute_fingering_reward(self, physics) -> float:
Expand Down
2 changes: 1 addition & 1 deletion robopianist/suite/tasks/piano_with_shadow_hands.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _compute_key_press_reward(self, physics: mjcf.Physics) -> float:
rew += 0.5 * rews.mean()
# If there are any false positives, the remaining 0.5 reward is lost.
off = np.flatnonzero(1 - self._goal_current[:-1])
rew += 0.5 * (1 - self.piano.activation[off].any())
rew += 0.5 * (1 - float(self.piano.activation[off].any()))
return rew

def _compute_fingering_reward(self, physics: mjcf.Physics) -> float:
Expand Down
4 changes: 3 additions & 1 deletion robopianist/viewer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ class TimeSeries:
sequences of floats. Will be used to annotate the legend.
"""

data: Deque[Union[float, Sequence[float]]] = deque(maxlen=mujoco.mjMAXLINE)
data: Deque[Union[float, Sequence[float]]] = field(
default_factory=lambda: deque(maxlen=mujoco.mjMAXLINE)
)
linename: List[str] = field(default_factory=list)

def add(self, value: float) -> None:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

Expand All @@ -94,7 +95,7 @@
license="Apache License 2.0",
license_files=("LICENSE",),
packages=find_packages(exclude=["examples"]),
python_requires=">=3.8, <3.11",
python_requires=">=3.8",
install_requires=core_requirements,
include_package_data=True,
classifiers=classifiers,
Expand Down

0 comments on commit 93cb7d7

Please sign in to comment.