diff --git a/CITATION.cff b/CITATION.cff index 9e655247..b6a84a90 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -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 diff --git a/HISTORY.rst b/HISTORY.rst index 2f1f1873..e84e91d6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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) ------------------ diff --git a/README.rst b/README.rst index 0dac83d5..a7c8b4a2 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,17 @@

+ +.. + + + **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 @@ -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 `_ tend to be more difficult to install and handle. Most environments require the user to either manually install a building simulator (e.g. `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. diff --git a/beobench/__init__.py b/beobench/__init__.py index 806a1360..3646e82b 100644 --- a/beobench/__init__.py +++ b/beobench/__init__.py @@ -2,7 +2,7 @@ __author__ = """Beobench authors""" __email__ = "-" -__version__ = "0.5.3" +__version__ = "0.5.4" import os from loguru import logger diff --git a/beobench/beobench_contrib b/beobench/beobench_contrib index d19ebfb1..307785fb 160000 --- a/beobench/beobench_contrib +++ b/beobench/beobench_contrib @@ -1 +1 @@ -Subproject commit d19ebfb1876a671724b79fba85f757ee70b49880 +Subproject commit 307785fb3dac9b05c42d88bc7d953dcb3259b10d diff --git a/beobench/data/configs/default.yaml b/beobench/data/configs/default.yaml index bcf85a4f..27bf9c4e 100644 --- a/beobench/data/configs/default.yaml +++ b/beobench/data/configs/default.yaml @@ -107,4 +107,4 @@ general: # experiment once. num_samples: 1 # Beobench version - # version: 0.5.3 + # version: 0.5.4 diff --git a/beobench/experiment/scheduler.py b/beobench/experiment/scheduler.py index 3c503729..7b1a0518 100644 --- a/beobench/experiment/scheduler.py +++ b/beobench/experiment/scheduler.py @@ -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 diff --git a/beobench/logging.py b/beobench/logging.py index fa979de1..1fd884f6 100644 --- a/beobench/logging.py +++ b/beobench/logging.py @@ -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") diff --git a/docs/index.rst b/docs/index.rst index 503a1b72..08bb8018 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 45c316cb..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=python -msphinx -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=beobench - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The Sphinx module was not found. Make sure you have Sphinx installed, - echo.then set the SPHINXBUILD environment variable to point to the full - echo.path of the 'sphinx-build' executable. Alternatively you may add the - echo.Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/setup.cfg b/setup.cfg index 161e7337..6dd4db08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.5.3 +current_version = 0.5.4 commit = True tag = True diff --git a/setup.py b/setup.py index 2689d8ee..8342351e 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -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", diff --git a/tests/conftest.py b/tests/conftest.py index 8d4c8665..541fa9f5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,11 @@ import stable_baselines3 """ +AGENT_BROKEN = """ +raise ValueError +""" + + REQUIREMENTS_SB3 = """ stable-baselines3[extra] """ @@ -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 diff --git a/tests/test_run.py b/tests/test_run.py index 84dae26c..c8a4567f 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -1,6 +1,7 @@ """Module to test main run command.""" import pytest +import subprocess import beobench @@ -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)