[tune] API revamp fix (#10518)

This commit is contained in:
Richard Liaw
2020-09-05 15:34:53 -07:00
committed by GitHub
parent 8a891b3c30
commit 551c597312
26 changed files with 349 additions and 269 deletions
+12
View File
@@ -1,5 +1,6 @@
import copy
import logging
import os
import inspect
import threading
import time
@@ -152,6 +153,17 @@ class Tee(object):
self.stream2.flush(*args, **kwargs)
def env_integer(key, default):
# TODO(rliaw): move into ray.constants
if key in os.environ:
value = os.environ[key]
if value.isdigit():
return int(os.environ[key])
raise ValueError(f"Found {key} in environment, but value must "
f"be an integer. Got: {value}.")
return default
def merge_dicts(d1, d2):
"""
Args: