mirror of
https://github.com/wassname/ray.git
synced 2026-08-10 12:30:14 +08:00
[minor][tune] Support Type Hinting for py3 (#6571)
* fullargspec for new pyversion * fi
This commit is contained in:
@@ -6,7 +6,7 @@ FROM ray-project/base-deps
|
||||
# a test runner.
|
||||
RUN conda install -y numpy
|
||||
RUN pip install -U pip
|
||||
RUN pip install -U https://ray-wheels.s3-us-west-2.amazonaws.com/latest/ray-0.9.0.dev-cp36-cp36m-manylinux1_x86_64.whl
|
||||
RUN pip install -U https://ray-wheels.s3-us-west-2.amazonaws.com/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl
|
||||
RUN pip install -U boto3
|
||||
# We install this after the latest wheels -- this should not override the latest wheels.
|
||||
# Needed to run Tune example with a 'plot' call - which does not actually render a plot, but throws an error.
|
||||
|
||||
@@ -7,6 +7,7 @@ import time
|
||||
import inspect
|
||||
import threading
|
||||
import traceback
|
||||
import sys
|
||||
from six.moves import queue
|
||||
|
||||
from ray.tune import track
|
||||
@@ -248,7 +249,10 @@ def wrap_function(train_func):
|
||||
|
||||
use_track = False
|
||||
try:
|
||||
func_args = inspect.getargspec(train_func).args
|
||||
if sys.version_info >= (3, 3):
|
||||
func_args = inspect.getfullargspec(train_func).args
|
||||
else:
|
||||
func_args = inspect.getargspec(train_func).args
|
||||
use_track = ("reporter" not in func_args and len(func_args) == 1)
|
||||
if use_track:
|
||||
logger.info("tune.track signature detected.")
|
||||
|
||||
Reference in New Issue
Block a user