From 94e097b089aa4ec76e4f91f1a68f03db39fa963a Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Wed, 14 Aug 2024 11:00:05 +0200 Subject: [PATCH] Removed assert on OrderedDict (clashes with gymnasium 1), Changelog --- CHANGELOG.md | 23 ++++++++++++++++++++--- tianshou/env/worker/subproc.py | 2 -- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8313a6be..1c8195689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## Release 1.2.0 + +### Changes/Improvements + +- trainer: + - Custom scoring now supported for selecting the best model. #1202 + +### Breaking Changes + +- data: + - stats: + - `InfoStats` has a new non-optional field `best_score` which is used + for selecting the best model. #1202 + ## Release 1.1.0 ### Highlights @@ -89,9 +103,12 @@ A detailed list of changes can be found below. correctly). #1074 #1131 - Add class `ExperimentCollection` for the convenient execution of multiple experiment runs #1131 - - The `World` object, containing all low-level objects needed for experimentation, - can now be extracted from an `Experiment` instance. This enables customizing - the experiment prior to its execution, bridging the low and high-level interfaces. #1187 + - The `World` object, containing all low-level objects needed for + experimentation, + can now be extracted from an `Experiment` instance. This enables + customizing + the experiment prior to its execution, bridging the low and high-level + interfaces. #1187 - `ExperimentBuilder`: - Add method `build_seeded_collection` for the sound creation of multiple diff --git a/tianshou/env/worker/subproc.py b/tianshou/env/worker/subproc.py index 74193e920..7756f6e8f 100644 --- a/tianshou/env/worker/subproc.py +++ b/tianshou/env/worker/subproc.py @@ -1,7 +1,6 @@ import ctypes import multiprocessing import time -from collections import OrderedDict from collections.abc import Callable from multiprocessing import connection from multiprocessing.context import BaseContext @@ -68,7 +67,6 @@ def get(self) -> np.ndarray: def _setup_buf(space: gym.Space, ctx: BaseContext) -> dict | tuple | ShArray: if isinstance(space, gym.spaces.Dict): - assert isinstance(space.spaces, OrderedDict) return {k: _setup_buf(v, ctx) for k, v in space.spaces.items()} if isinstance(space, gym.spaces.Tuple): assert isinstance(space.spaces, tuple)