-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from rdnfn/dev/general
v0.5.1
- Loading branch information
Showing
18 changed files
with
147 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule beobench_contrib
updated
2 files
+1 −1 | gyms/energym/env_creator.py | |
+1 −1 | gyms/sinergym/env_creator.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,4 @@ general: | |
# experiment once. | ||
num_samples: 1 | ||
# Beobench version | ||
version: 0.5.0 | ||
version: 0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
agent: | ||
origin: random_action | ||
config: | ||
stop: | ||
timesteps_total: 10 | ||
env: | ||
gym: sinergym | ||
config: | ||
name: Eplus-5Zone-hot-continuous-v1 | ||
wrappers: | ||
- origin: general | ||
class: WandbLogger | ||
general: | ||
wandb_entity: beobench | ||
wandb_project: demo | ||
# wandb_api_key: HIDDEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Logging utilities for Beobench.""" | ||
|
||
from loguru import logger | ||
import sys | ||
|
||
|
||
def setup(include_time=False) -> None: | ||
"""Setup Beobench loguru logging setup.""" | ||
if include_time: | ||
time_str = "<light-black>[{time:YYYY-MM-DD, HH:mm:ss.SSSS}]</light-black> " | ||
else: | ||
time_str = "" | ||
logger.remove() | ||
logger.level("INFO", color="") | ||
logger.add( | ||
sys.stdout, | ||
colorize=True, | ||
format=( | ||
"<blue><b>Beobench</b></blue> " | ||
"<y>⚡️</y>" | ||
f"{time_str}" | ||
"<level>{message}</level>" | ||
), | ||
) | ||
|
||
|
||
def log_subprocess(pipe, process_name="subprocess"): | ||
"""Log subprocess pipe. | ||
Adapted from from https://stackoverflow.com/a/21978778. | ||
Color setting of context is described in https://stackoverflow.com/a/33206814. | ||
""" | ||
for line in iter(pipe.readline, b""): # b'\n'-separated lines | ||
context = f"\033[34m{process_name}:\033[0m" # .decode("ascii") | ||
line = line.decode("utf-8").rstrip() | ||
logger.info(f"{context} {line}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.