Skip to content

Commit

Permalink
BLD: return the received algo id to the user
Browse files Browse the repository at this point in the history
  • Loading branch information
AvishaiW committed Aug 21, 2018
1 parent e797811 commit c0c9981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 3 additions & 10 deletions catalyst/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,7 @@ def remote_run(ctx,
if mail is None or not re.match(r"[^@]+@[^@]+\.[^@]+", mail):
ctx.fail("must specify a valid email with '--mail'")

click.echo('Running in backtesting mode.', sys.stdout)

perf = remote_backtest(
algo_id = remote_backtest(
initialize=None,
handle_data=None,
before_trading_start=None,
Expand Down Expand Up @@ -709,13 +707,8 @@ def remote_run(ctx,
stats_output=None,
mail=mail,
)

if output == '-':
click.echo(str(perf), sys.stdout)
elif output != os.devnull: # make the catalyst magic not write any data
perf.to_pickle(output)

return perf
print(algo_id)
return algo_id


@main.command(name='remote-status')
Expand Down
6 changes: 4 additions & 2 deletions catalyst/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def handle_response(response, mode):
EXCEPTION_LOG)
else: # if the run was successful
if mode == BACKTEST:
algo_id = response.json()['algo_id']
log.info('In order to follow your algo run use the following id: '
+ response.json()['algo_id'])
+ algo_id)
return algo_id
elif mode == STATUS:
return handle_status(response.json())

Expand Down Expand Up @@ -171,7 +173,7 @@ def send_digest_request(json_file, path, method):
'opaque="{5}"'.
format(key, d['realm'], d['nonce'], path,
result, d['opaque'])})
else: # method == GET
else: # method == GET
return session.get('{}{}'.format(AUTH_SERVER, path),
json=json.dumps(json_file, default=convert_date),
verify=False,
Expand Down

0 comments on commit c0c9981

Please sign in to comment.