mirror of
https://github.com/wassname/ray.git
synced 2026-07-29 11:26:04 +08:00
Change /tmp to platform-specific temporary directory (#7529)
This commit is contained in:
@@ -294,14 +294,16 @@ class TrainableFunctionApiTest(unittest.TestCase):
|
||||
|
||||
def testLogdir(self):
|
||||
def train(config, reporter):
|
||||
assert "/tmp/logdir/foo" in os.getcwd(), os.getcwd()
|
||||
assert os.path.join(ray.utils.get_user_temp_dir(), "logdir",
|
||||
"foo") in os.getcwd(), os.getcwd()
|
||||
reporter(timesteps_total=1)
|
||||
|
||||
register_trainable("f1", train)
|
||||
run_experiments({
|
||||
"foo": {
|
||||
"run": "f1",
|
||||
"local_dir": "/tmp/logdir",
|
||||
"local_dir": os.path.join(ray.utils.get_user_temp_dir(),
|
||||
"logdir"),
|
||||
"config": {
|
||||
"a": "b"
|
||||
},
|
||||
@@ -330,14 +332,16 @@ class TrainableFunctionApiTest(unittest.TestCase):
|
||||
|
||||
def testLongFilename(self):
|
||||
def train(config, reporter):
|
||||
assert "/tmp/logdir/foo" in os.getcwd(), os.getcwd()
|
||||
assert os.path.join(ray.utils.get_user_temp_dir(), "logdir",
|
||||
"foo") in os.getcwd(), os.getcwd()
|
||||
reporter(timesteps_total=1)
|
||||
|
||||
register_trainable("f1", train)
|
||||
run_experiments({
|
||||
"foo": {
|
||||
"run": "f1",
|
||||
"local_dir": "/tmp/logdir",
|
||||
"local_dir": os.path.join(ray.utils.get_user_temp_dir(),
|
||||
"logdir"),
|
||||
"config": {
|
||||
"a" * 50: tune.sample_from(lambda spec: 5.0 / 7),
|
||||
"b" * 50: tune.sample_from(lambda spec: "long" * 40),
|
||||
|
||||
Reference in New Issue
Block a user