Remove deprecation warnings when running actor tests (#3563)

* remove deprecation warnings when running actor tests

* replacing logger.warn with logger.warning

* Update worker.py

* Update policy_client.py

* Update compression.py
This commit is contained in:
Alexey Tumanov
2018-12-18 17:04:51 -08:00
committed by Philipp Moritz
parent fb33fa9097
commit c4cba98c75
12 changed files with 23 additions and 21 deletions
+3 -3
View File
@@ -216,7 +216,7 @@ class ActorMethod(object):
return self._remote(args, kwargs)
def _submit(self, args, kwargs, num_return_vals=None):
logger.warn(
logger.warning(
"WARNING: _submit() is being deprecated. Please use _remote().")
return self._remote(
args=args, kwargs=kwargs, num_return_vals=num_return_vals)
@@ -338,7 +338,7 @@ class ActorClass(object):
num_cpus=None,
num_gpus=None,
resources=None):
logger.warn(
logger.warning(
"WARNING: _submit() is being deprecated. Please use _remote().")
return self._remote(
args=args,
@@ -679,7 +679,7 @@ class ActorHandle(object):
# If the worker is a driver and driver id has changed because
# Ray was shut down re-initialized, the actor is already cleaned up
# and we don't need to send `__ray_terminate__` again.
logger.warn(
logger.warning(
"Actor is garbage collected in the wrong driver." +
" Actor id = %s, class name = %s.", self._ray_actor_id,
self._ray_class_name)
+1 -1
View File
@@ -69,7 +69,7 @@ class DistributedSGD(object):
all_reduce_alg="simple"):
if num_workers == 1 and strategy == "ps":
logger.warn(
logger.warning(
"The parameter server strategy does not make sense for single "
"worker operation, falling back to simple mode.")
strategy = "simple"
+1 -1
View File
@@ -77,7 +77,7 @@ class RemoteFunction(object):
num_cpus=None,
num_gpus=None,
resources=None):
logger.warn(
logger.warning(
"WARNING: _submit() is being deprecated. Please use _remote().")
return self._remote(
args=args,
+2 -2
View File
@@ -118,7 +118,7 @@ class PPOAgent(Agent):
if waste_ratio > 1.5:
raise ValueError(msg)
else:
logger.warn(msg)
logger.warning(msg)
if self.config["sgd_minibatch_size"] > self.config["train_batch_size"]:
raise ValueError(
"Minibatch size {} must be <= train batch size {}.".format(
@@ -136,6 +136,6 @@ class PPOAgent(Agent):
"simple_optimizer=True if this doesn't work for you.")
if self.config["observation_filter"] != "NoFilter":
# TODO(ekl): consider setting the default to be NoFilter
logger.warn(
logger.warning(
"By default, observations will be normalized with {}".format(
self.config["observation_filter"]))
+1 -1
View File
@@ -53,7 +53,7 @@ def summarize_episodes(episodes, new_episodes, num_dropped):
"""
if num_dropped > 0:
logger.warn("WARNING: {} workers have NOT returned metrics".format(
logger.warning("WARNING: {} workers have NOT returned metrics".format(
num_dropped))
episode_rewards = []
@@ -300,7 +300,7 @@ class PolicyEvaluator(EvaluatorInterface):
self.batch_mode))
if input_evaluation_method == "simulation":
logger.warn(
logger.warning(
"Requested 'simulation' input evaluation method: "
"will discard all sampler outputs and keep only metrics.")
sample_async = True
+1 -1
View File
@@ -311,7 +311,7 @@ def _process_observations(async_vector_env, policies, batch_builder_pool,
if (not _large_batch_warned and
episode.batch_builder.total() > max(1000, unroll_length * 10)):
_large_batch_warned = True
logger.warn(
logger.warning(
"More than {} observations for {} env steps ".format(
episode.batch_builder.total(),
episode.batch_builder.count) + "are buffered in "
+1 -1
View File
@@ -42,7 +42,7 @@ class JsonReader(InputReader):
if isinstance(inputs, six.string_types):
if os.path.isdir(inputs):
inputs = os.path.join(inputs, "*.json")
logger.warn(
logger.warning(
"Treating input directory as glob pattern: {}".format(
inputs))
if urlparse(inputs).scheme:
+3 -3
View File
@@ -15,9 +15,9 @@ try:
import lz4.frame
LZ4_ENABLED = True
except ImportError:
logger.warn("lz4 not available, disabling sample compression. "
"This will significantly impact RLlib performance. "
"To install lz4, run `pip install lz4`.")
logger.warning("lz4 not available, disabling sample compression. "
"This will significantly impact RLlib performance. "
"To install lz4, run `pip install lz4`.")
LZ4_ENABLED = False
+3 -2
View File
@@ -11,8 +11,9 @@ try:
import requests # `requests` is not part of stdlib.
except ImportError:
requests = None
logger.warn("Couldn't import `requests` library. Be sure to install it on"
" the client side.")
logger.warning(
"Couldn't import `requests` library. Be sure to install it on"
" the client side.")
class PolicyClient(object):
+1 -1
View File
@@ -227,7 +227,7 @@ def _is_resolved(v):
def _try_resolve(v):
if isinstance(v, types.FunctionType):
logger.warn(
logger.warning(
"Deprecation warning: Function values are ambiguous in Tune "
"configuations. Either wrap the function with "
"`tune.function(func)` to specify a function literal, or "
+5 -4
View File
@@ -1381,8 +1381,9 @@ def _init(address_info=None,
driver_mode = SCRIPT_MODE
if redis_max_memory and collect_profiling_data:
logger.warn("Profiling data cannot be LRU evicted, so it is disabled "
"when redis_max_memory is set.")
logger.warning(
"Profiling data cannot be LRU evicted, so it is disabled "
"when redis_max_memory is set.")
collect_profiling_data = False
# Get addresses of existing services.
@@ -1646,8 +1647,8 @@ def init(redis_address=None,
# Add the use_raylet option for backwards compatibility.
if use_raylet is not None:
if use_raylet:
logger.warn("WARNING: The use_raylet argument has been "
"deprecated. Please remove it.")
logger.warning("WARNING: The use_raylet argument has been "
"deprecated. Please remove it.")
else:
raise DeprecationWarning("The use_raylet argument is deprecated. "
"Please remove it.")