From e583d5a421c6287505b885246bed731a957cd0bb Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Sun, 26 Nov 2017 13:11:12 -0800 Subject: [PATCH] Give warnings for unimplemented Python mode methods. (#1256) --- python/ray/worker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/ray/worker.py b/python/ray/worker.py index 443459f7b..10831880f 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -906,6 +906,9 @@ def get_gpu_ids(): Each ID is an integer in the range [0, NUM_GPUS - 1], where NUM_GPUS is the number of GPUs that the node has. """ + if _mode() == PYTHON_MODE: + raise Exception("ray.get_gpu_ids() currently does not work in PYTHON " + "MODE.") return global_worker.local_scheduler_client.gpu_ids() @@ -930,6 +933,9 @@ def get_webui_url(): Returns: The URL of the web UI as a string. """ + if _mode() == PYTHON_MODE: + raise Exception("ray.get_webui_url() currently does not work in " + "PYTHON MODE.") return _webui_url_helper(global_worker.redis_client)