mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-11-18 09:54:10 +00:00
Relax logger check for Windows (#1615)
* Relax logger check for Windows * Update tests
This commit is contained in:
parent
61e1060525
commit
a730b9b66a
4 changed files with 10 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ Changelog
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
|
||||||
Release 2.1.0a1 (WIP)
|
Release 2.1.0a2 (WIP)
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
Breaking Changes:
|
Breaking Changes:
|
||||||
|
|
@ -25,6 +25,7 @@ New Features:
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
- Relaxed check in logger, that was causing issue on Windows with colorama
|
||||||
|
|
||||||
Deprecations:
|
Deprecations:
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
|
@ -164,8 +164,10 @@ class HumanOutputFormat(KVWriter, SeqWriter):
|
||||||
if isinstance(filename_or_file, str):
|
if isinstance(filename_or_file, str):
|
||||||
self.file = open(filename_or_file, "w")
|
self.file = open(filename_or_file, "w")
|
||||||
self.own_file = True
|
self.own_file = True
|
||||||
elif isinstance(filename_or_file, TextIOBase):
|
elif isinstance(filename_or_file, TextIOBase) or hasattr(filename_or_file, "write"):
|
||||||
self.file = filename_or_file
|
# Note: in theory `TextIOBase` check should be sufficient,
|
||||||
|
# in practice, libraries don't always inherit from it, see GH#1598
|
||||||
|
self.file = filename_or_file # type: ignore[assignment]
|
||||||
self.own_file = False
|
self.own_file = False
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Expected file or str, got {filename_or_file}")
|
raise ValueError(f"Expected file or str, got {filename_or_file}")
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.1.0a1
|
2.1.0a2
|
||||||
|
|
|
||||||
|
|
@ -437,8 +437,9 @@ def test_ep_buffers_stats_window_size(algo, stats_window_size):
|
||||||
assert model.ep_success_buffer.maxlen == stats_window_size
|
assert model.ep_success_buffer.maxlen == stats_window_size
|
||||||
|
|
||||||
|
|
||||||
def test_human_output_format_custom_test_io():
|
@pytest.mark.parametrize("base_class", [object, TextIOBase])
|
||||||
class DummyTextIO(TextIOBase):
|
def test_human_output_format_custom_test_io(base_class):
|
||||||
|
class DummyTextIO(base_class):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.lines = [[]]
|
self.lines = [[]]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue