Skip to content
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 dockers/base-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get install -y \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-distutils \
python3-setuptools \
python${PYTHON_VERSION}-dev \
&& \
update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \
Expand Down
2 changes: 1 addition & 1 deletion dockers/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN \
dvipng \
texlive-pictures \
python3 \
python3-distutils \
python3-setuptools \
python3-dev \
&& \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
Expand Down
18 changes: 17 additions & 1 deletion examples/fabric/reinforcement_learning/rl/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import math
import os
from distutils.util import strtobool
from typing import TYPE_CHECKING, Optional, Union

import gymnasium as gym
Expand All @@ -12,6 +11,23 @@
from rl.agent import PPOAgent, PPOLightningAgent


def strtobool(val):
"""Convert a string representation of truth to true (1) or false (0).

True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'.
Raises ValueError if 'val' is anything else.

Note: taken from distutils after its deprecation.

"""
val = val.lower()
if val in ("y", "yes", "t", "true", "on", "1"):
return 1
if val in ("n", "no", "f", "false", "off", "0"):
return 0
raise ValueError(f"invalid truth value {val!r}")


def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--exp-name", type=str, default="default", help="the name of this experiment")
Expand Down
Loading