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

v0.5.4 #100

Merged
merged 18 commits into from
Jan 16, 2023
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 CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
version: 0.5.3
version: 0.5.4
url: https://github.com/rdnfn/beobench
authors:
- given-names: Arduin
Expand Down
11 changes: 11 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
History
=======

0.5.4 (2023-01-16)
------------------

* Fixes:

* Ensure agent script stdout is shown (e.g. log statements and so on) by replacing ``check_output`` call with ``check_call``. This fixes #99 raised by @XkunW (Thanks!).

* Other:

* Add note on maintenance status of project to main readme and docs. Beobench is only receiving minor maintenance updates at this point. Therefore, Beobench may also no longer support the latest versions of the integrated building simulation tools. If you would like to use the latest versions of these tools, it is recommended to use them directly without Beobench.

0.5.3 (2022-11-18)
------------------

Expand Down
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@

</p>


..


**Warning**

Beobench is only receiving minor maintenance updates at this point. Therefore, Beobench may also no longer support the latest versions of the integrated building simulation tools. If you would like to use the latest versions of these tools, it is recommended to use them directly without Beobench.




.. start-in-sphinx-docs

.. image:: https://img.shields.io/pypi/v/beobench.svg
Expand All @@ -24,6 +35,8 @@
:target: https://opensource.org/licenses/MIT
:alt: License



A toolkit providing easy and unified access to building control environments for reinforcement learning (RL). Compared to other domains, `RL environments for building control <https://github.com/rdnfn/rl-building-control#environments>`_ tend to be more difficult to install and handle. Most environments require the user to either manually install a building simulator (e.g. `EnergyPlus <https://github.com/NREL/EnergyPlus>`_) or to manually manage Docker containers. This can be tedious.

Beobench was created to make building control environments easier to use and experiments more reproducible. Beobench uses Docker to manage all environment dependencies in the background so that the user doesn't have to. A standardised API, illustrated in the figure below, allows the user to easily configure experiments and evaluate new RL agents on building control environments.
Expand Down
2 changes: 1 addition & 1 deletion beobench/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Beobench authors"""
__email__ = "-"
__version__ = "0.5.3"
__version__ = "0.5.4"

import os
from loguru import logger
Expand Down
2 changes: 1 addition & 1 deletion beobench/beobench_contrib
2 changes: 1 addition & 1 deletion beobench/data/configs/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ general:
# experiment once.
num_samples: 1
# Beobench version
# version: 0.5.3
# version: 0.5.4
2 changes: 1 addition & 1 deletion beobench/experiment/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def run(
str(container_ro_dir_abs / _get_agent_file(config)[0].name),
]
if not dry_run:
subprocess.check_output(args)
subprocess.check_call(args)

else:
# First build container image and then execute experiment inside container
Expand Down
2 changes: 1 addition & 1 deletion beobench/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def log_subprocess(pipe, process_name="subprocess"):
Color setting of context is described in https://stackoverflow.com/a/33206814.
"""
lines = []
max_len = 1000
max_len = 5000

for i, line in enumerate(iter(pipe.readline, b"")): # b'\n'-separated lines
context = f"\033[34m{process_name}:\033[0m" # .decode("ascii")
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Beobench docs
*************

.. warning::

Beobench is only receiving minor maintenance updates at this point. Therefore, Beobench may also no longer support the latest versions of the integrated building simulation tools. If you would like to use the latest versions of these tools, it is recommended to use them directly without Beobench.


.. include:: ../README.rst
:start-after: start-in-sphinx-docs
:end-before: end-in-sphinx-docs
Expand Down
36 changes: 0 additions & 36 deletions docs/make.bat

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.3
current_version = 0.5.4
commit = True
tag = True

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
with open("HISTORY.rst", encoding="UTF-8") as history_file:
history = history_file.read()

version = "0.5.3" # pylint: disable=invalid-name
version = "0.5.4" # pylint: disable=invalid-name

requirements = [
"docker",
Expand All @@ -27,7 +27,8 @@
]

rllib_requirements = [
"ray[rllib]",
"ray[rllib]<=2.1.0", # see https://github.com/ray-project/ray/pull/31331
"numpy<1.24.0", # see https://github.com/ray-project/ray/issues/31293
"torch",
"gym",
"wandb",
Expand Down
15 changes: 14 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
import stable_baselines3
"""

AGENT_BROKEN = """
raise ValueError
"""


REQUIREMENTS_SB3 = """
stable-baselines3[extra]
"""
Expand All @@ -34,7 +39,15 @@ def rand_agent_config():
@pytest.fixture(scope="session")
def agent_sb3(tmp_path_factory):
agent_file_path = create_tmp_file(
"agent_tmp", "agent.py", AGENT_SB3, tmp_path_factory
"agent_tmp", "agent_sb3.py", AGENT_SB3, tmp_path_factory
)
return agent_file_path


@pytest.fixture(scope="session")
def agent_broken(tmp_path_factory):
agent_file_path = create_tmp_file(
"agent_tmp", "agent_broken.py", AGENT_BROKEN, tmp_path_factory
)
return agent_file_path

Expand Down
15 changes: 15 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Module to test main run command."""

import pytest
import subprocess

import beobench

Expand Down Expand Up @@ -49,3 +50,17 @@ def test_reqs_install(agent_sb3, requirements_sb3):
},
}
beobench.run(config=config, **CMD_CONFIG)


@pytest.mark.slow
def test_broken_agent_install(agent_broken, requirements_sb3):
"""Ensure broken agent error propagates to the main script."""
config = {
"agent": {
"origin": str(agent_broken),
"requirements": str(requirements_sb3),
"config": {"stop": {"timesteps_total": 10}},
},
}
with pytest.raises(subprocess.CalledProcessError):
beobench.run(config=config, **CMD_CONFIG)